get.hpdintervals(y, X = NULL, fit.mcmc, num.lv)
NULL
, in which case it is assumed no model matrix was used.boral
with save.model = TRUE
, and the applying as.mcmc
on tX
.HPDinterval
function from the coda
package to obtain the HPD intervals. See HPDinterval
for details regarding the defintion of the HPD interval.library(mvabund) ## Load a dataset from the mvabund package
data(spider)
y <- spider$abun
n <- nrow(y); p <- ncol(y);
## Example 1 - model with two latent variables, site effects,
## and no environmental covariates
spider.fit.nb <- boral(y, family = "negative.binomial", num.lv = 2,
site.eff = TRUE, save.model = TRUE)
## Returns a list with components corresponding to values described above.
spider.fit.nb$hpdintervals
## Example 2 - model with one latent variable, site effects,
## and environmental covariates
spider.fit.nb2 <- boral(y, X = spider$x, family = "negative.binomial", num.lv = 1,
site.eff = TRUE, save.model = TRUE)
## Returns a list with components corresponding to values described above.
spider.fit.nb2$hpdintervals
Run the code above in your browser using DataLab