# NOT RUN {
lhspec <- bspec(lh, priordf=1, priorscale=0.6)
# draw sample from posterior:
posteriorsample <- sample(lhspec)
# plot the sample:
plot(lhspec)
lines(lhspec$freq, posteriorsample, type="b", col="red")
# compute prior, likelihood, posterior:
print(c("prior" = dprior(lhspec, posteriorsample),
"likelihood" = likelihood(lhspec, posteriorsample),
"posterior" = dposterior(lhspec, posteriorsample),
"marginal likelihood"= marglikelihood(lhspec)))
# }
Run the code above in your browser using DataLab