Description Usage Arguments Details See Also Examples
plot.bayescomm
creates summary plots of a subset of the parameter chains in a bayescomm
object using the coda
package.
1 2 |
x |
a |
chain |
a character string of the parameter chains to plot |
... |
further arguments to pass to |
chain
should be one of 'R'
(for correlation coefficients) or 'B$sp'
where sp
is the species of interest (for regression coefficients).
1 2 3 |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.