R/histprior.R

histprior=function(p,midpts,prob)
{
binwidth=midpts[2]-midpts[1]
lo=round(10000*(midpts-binwidth/2))/10000
val=0*p
for (i in 1:length(p))
{
 val[i]=prob[sum(p[i]>=lo)]
}
return(val)
}

Try the LearnBayes package in your browser

Any scripts or data that you put into this service are public.

LearnBayes documentation built on May 1, 2019, 7:03 p.m.