Learn R Programming

r2glmm (version 0.1.1)

calc_sgv: Compute the standardized generalized variance (SGV) of a blocked diagonal matrix.

Description

Compute the standardized generalized variance (SGV) of a blocked diagonal matrix.

Usage

calc_sgv(nblocks = NULL, blksizes = NULL, vmat)

Arguments

nblocks

Number of blocks in the matrix.

blksizes

vector of block sizes

vmat

The blocked covariance matrix

Value

The SGV of the covariance matrix vmat.

Examples

Run this code
# NOT RUN {
library(Matrix)
v1 = matrix(c(1,0.5,0.5,1), nrow = 2)
v2 = matrix(c(1,0.2,0.1,0.2,1,0.3,0.1,0.3,1), nrow = 3)
v3 = matrix(c(1,0.1,0.1,0.1,1,0.2,0.1,0.2,1), nrow = 3)
calc_sgv(nblocks = 3, blksizes = c(2,3,3), vmat = Matrix::bdiag(v1,v2,v3))
# }

Run the code above in your browser using DataLab