build_var_mat: Reconstruct variance matrix L from L_params

View source: R/RcppExports.R

build_var_matR Documentation

Reconstruct variance matrix L from L_params

Description

Reconstruct variance matrix L from L_params

Usage

build_var_mat(L_params, K_w, rc_correlation)

Arguments

L_params

flattened choleski decomposition version of the random coefficient parameters matrix

K_w

dimension of the random coefficient parameter (symmetric) matrix

rc_correlation

whether random coefficients are correlated

Value

matrix equal to LL', where L is the choleski decomposition of random coefficient matrix

Examples

L_params <- c(log(1.0), 0.3, log(0.5))
Sigma <- choicer:::build_var_mat(L_params, K_w = 2, rc_correlation = TRUE)
Sigma  # 2x2 covariance matrix

choicer documentation built on Sept. 5, 2026, 1:07 a.m.