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

Description Usage Arguments Value Examples

View source: R/r2_sgv_est_Function.R

Description

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

Usage

1
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

1
2
3
4
5
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))

Example output

[1] 0.9327961

r2glmm documentation built on May 1, 2019, 9:09 p.m.