powered by
Computes the density of a probability distribution defined on a set of equal-width intervals
histprior(p,midpts,prob)
vector of values for which density is to be computed
vector of midpoints of the intervals
vector of probabilities of the intervals
vector of values of the probability density
# NOT RUN { 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") # }
Run the code above in your browser using DataLab