DIC: Deviance Information Criterion

Description Usage Arguments References See Also Examples

Description

Calculates Deviance Information Criteria for bayescomm objects.

Usage

1

Arguments

BC

a bayescomm object

References

Spiegelhalter, D.J.. Best, N.G., Carlin, B.P., van der Linde, A. (2002). Bayesian measures of model complexity and fit. Journal of the Royal Statistical Society, Series B, 64 (4): 583-639.

See Also

BC

Examples

1
2
m1 <- example(BC)[[1]]
DIC(m1)

Example output

BC> # create fake data
BC> n <- 100

BC> nsp <- 4

BC> k <- 3

BC> X <- matrix(c(rep(1, n), rnorm(n * k)), n)  # covariate matrix

BC> W <- matrix(rnorm(nsp * nsp), nsp)

BC> W <- W %*% t(W) / 2  # true covariance matrix

BC> B <- matrix(rnorm(nsp * (k + 1), 0, 3), nsp)  # true covariates

BC> mu <- apply(B, 1, function(b, x) x %*% b, X)  # true mean

BC> e <- matrix(rnorm(n * nsp), n) %*% chol(W)  # true e

BC> z <- mu + e  # true z

BC> Y <- ifelse(z > 0, 1, 0)  # true presence/absence

BC> # run BC (after removing intercept column from design matrix)
BC> m1 <- BC(Y, X[, -1], model = "full", its = 100)
[1] 115.7853

BayesComm documentation built on May 2, 2019, 1:43 p.m.