I fit a gaussian process model and want to evaluate marginal likelihood through bridgesampling package. However, it returns error:
> marg.list[[1]] <- bridge_sampler(fit, m, method = "warp3",
+ repetitions=1, cores=1, verbose=TRUE)
[1] "summary(q12): (log_dens of proposal for posterior samples)"
Min. 1st Qu. Median Mean 3rd Qu. Max.
-2.709e+09 -2.225e+09 -2.144e+09 -2.147e+09 -2.058e+09 -1.135e+09
[1] "summary(q22): (log_dens of proposal for generated samples)"
[[1]]
Min. 1st Qu. Median Mean 3rd Qu. Max.
-3062 -2984 -2963 -2963 -2941 -2851
[1] "summary(q11): (log_dens of posterior for posterior samples)"
Min. 1st Qu. Median Mean 3rd Qu. Max.
-76756 -76667 -76645 -76645 -76621 -76555
[1] "summary(q21): (log_dens of posterior for generated samples)"
[[1]]
Min. 1st Qu. Median Mean 3rd Qu. Max.
-82434 -76886 -76786 -76869 -76712 -76522
Iteration: 1
Iteration: 2
Iteration: 1
Error in jj[2, ] : subscript out of bounds
In addition: Warning messages:
1: Infinite value in iterative scheme, returning NA.
Try rerunning with more samples.
2: logml could not be estimated within maxiter, rerunning with adjusted starting value.
Estimate might be more variable than usual.
Do you know what causes the problem and whether there are ways to solve it? I could provide fit and data if needed (however, it’s a bit large). Thank you!
Edit: included backticks for the code (by @Max_Mantei)