Description Usage Arguments Value Author(s) See Also Examples
Construct a list defining a covariance model for the glmmGS
function.
1 |
type |
a string specifying the type of the covariance model. Current valid types are:
|
... |
optional arguments containing information about the precision or covariance structure.
If the type is |
A list of parameters specifying a covariance model for the
glmmGS
function.
Michele Morara, Louise Ryan, Subharup Guha, Christopher Paciorek
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # Set number of columns
ncols <- 100;
# Identity covariance model (no need to specify matrix dimensions)
# Define dense-precision model
I <- glmmGS.CovarianceModel("identity");
# Dense-precision model
# Dense precision matrix
R <- as.matrix(rnorm(ncols * ncols), nrow = ncols, ncol = ncols);
R <- R %*% t(R);
# Define dense-precision model
T.dense <- glmmGS.CovarianceModel("precision", R);
# Sparse-precision model
# Sparse precision matrix
R <- diag(rep(1, ncols));
for (i in 2:ncols)
{
R[i - 1, i] <- 0.5;
R[i, i - 1] <- 0.5;
}
# Create sparse matrix from R
R.sparse = glmmGS.SparseMatrix(R);
# Define sparse-precision model
T.sparse <- glmmGS.CovarianceModel("precision", R.sparse);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.