Last data update: 2014.03.03

R: Density function of a histogram distribution
histpriorR Documentation

Density function of a histogram distribution

Description

Computes the density of a probability distribution defined on a set of equal-width intervals

Usage

histprior(p,midpts,prob)

Arguments

p

vector of values for which density is to be computed

midpts

vector of midpoints of the intervals

prob

vector of probabilities of the intervals

Value

vector of values of the probability density

Author(s)

Jim Albert

Examples

midpts=c(.1,.3,.5,.7,.9)
prob=c(.2,.2,.4,.1,.1)
p=seq(.01,.99,by=.01)
plot(p,histprior(p,midpts,prob),type="l")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(LearnBayes)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LearnBayes/histprior.Rd_%03d_medium.png", width=480, height=480)
> ### Name: histprior
> ### Title: Density function of a histogram distribution
> ### Aliases: histprior
> ### Keywords: models
> 
> ### ** Examples
> 
> midpts=c(.1,.3,.5,.7,.9)
> prob=c(.2,.2,.4,.1,.1)
> p=seq(.01,.99,by=.01)
> plot(p,histprior(p,midpts,prob),type="l")
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>