# glmmGS.CovarianceModel: Construct covariance models for the 'glmmGS' function In glmmGS: Gauss-Seidel Generalized Linear Mixed Model solver

## Description

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

## Usage

 `1` ``` glmmGS.CovarianceModel(type, ...) ```

## 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

`glmmGS`, `glmmGS.SparseMatrix`
 ``` 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); ```