glmmGS.CovarianceModel: Construct covariance models for the 'glmmGS' function

Description Usage Arguments Value Author(s) See Also Examples

Description

Construct a list defining a covariance model for the glmmGS function.

Usage

1

Arguments

type

a string specifying the type of the covariance model. Current valid types are: identity, precision. The covariance components of the identity and precision models represent the global precision parameters.

...

optional arguments containing information about the precision or covariance structure. If the type is identity, no optional arguments are required; if the type is precision, the optional argument is a precision matrix of either R matrix type or glmmGS.SparseMatrix type.

Value

A list of parameters specifying a covariance model for the glmmGS function.

Author(s)

Michele Morara, Louise Ryan, Subharup Guha, Christopher Paciorek

See Also

glmmGS, glmmGS.SparseMatrix

Examples

 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);

glmmGS documentation built on Sept. 12, 2016, 12:07 p.m.