ribbon 发表于 2014-11-12 23:34 
integrate (function(sigma) {
bvn_normalize(x)*bvn_likelihood(x, sigma, rho)*bvn_prior(sigma, rho) ...
> #the marginal posterior density of rho
> bvn_posterior_rho = function(x, rho){
+ integrate (function(sigma) {
+ bvn_normalize(x)*bvn_likelihood(x, sigma, rho)*bvn_prior(sigma, rho)}, 0, Inf) $value
+ }
>> bvn_posterior_rho(Xa,0.5)
Error in integrate(f, lower = sigma.lower, upper = sigma.upper, rho = rho) :
non-finite function value
In addition: There were 50 or more warnings (use warnings() to see the first 50)
这个也不对 这个是求关于rho的后验密度