powered by
Computes the posterior distribution for an arbitrary one parameter distribution for a discrete prior distribution.
discrete.bayes(df,prior,y,...)
name of the function defining the sampling density
vector defining the prior density; names of the vector define the parameter values and entries of the vector define the prior probabilities
vector of data values
any further fixed parameter values used in the sampling density function
vector of posterior probabilities
scalar with prior predictive probability
# NOT RUN { prior=c(.25,.25,.25,.25) names(prior)=c(.2,.25,.3,.35) y=5 n=10 discrete.bayes(dbinom,prior,y,size=n) # }
Run the code above in your browser using DataLab