search for: postnormconst

Displaying 1 result from an estimated 1 matches for "postnormconst".

2008 Sep 27
0
compute posterior mean by numerical integration
...else res <- 0 ## noninformative prior return(res) } ## log posterior density "logPost" <- function(t, omega, beta, o1, o2, b1, b2) { res <- loglike(t, omega, beta) + prior(omega, beta, o1, o2, b1, b2) return(res) } ## posterior normalizing constant "PostNormConst" <- function(t, low, upw, lob, upb, o1, o2, b1, b2) { "g" <- function(beta, ...) { integrate(function(omega) {logPost(t=t, omega, beta, o1=o1, o2=o2, b1=b1, b2=b2)}, low, upw)$value } res <- integrate(Vectorize(function(b...