Learn R Programming

r2glmm (version 0.1.3)

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)

Value

The SGV of the covariance matrix vmat.

Arguments

nblocks

Number of blocks in the matrix.

blksizes

vector of block sizes

vmat

The blocked covariance matrix

Examples

Run this code
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