mc_transform_list_bdiag: Auxiliary Function for Block-Diagonal Matrix Construction

View source: R/mc_transform_list_bdiag.R

mc_transform_list_bdiagR Documentation

Auxiliary Function for Block-Diagonal Matrix Construction

Description

Constructs block-diagonal matrices used in the computation of derivatives of the covariance matrix C. Each input matrix is placed as the non-zero block corresponding to a given response variable, while all remaining blocks are set to zero.

Usage

mc_transform_list_bdiag(list_mat, mat_zero, response_number)

Arguments

list_mat

A list of matrices to be inserted as non-zero blocks.

mat_zero

A list of zero matrices defining the block-diagonal structure. This object is typically obtained from mc_build_bdiag.

response_number

An integer indicating the response variable position where each matrix in list_mat will be inserted.

Details

For each matrix in list_mat, a block-diagonal matrix is created by replacing the block corresponding to response_number in mat_zero with the given matrix. The output is a list of block-diagonal matrices with identical structure.

Value

A list of block-diagonal matrices, each corresponding to one element of list_mat. The returned object is intended for internal use only.


mcglm documentation built on Jan. 9, 2026, 1:07 a.m.