mc_remove_na: Remove Missing Observations from Matrix Linear Predictor

View source: R/mc_remove_na.R

mc_remove_naR Documentation

Remove Missing Observations from Matrix Linear Predictor

Description

Removes rows and columns corresponding to missing observations from each component of a matrix linear predictor. This function is typically applied after completing the data structure (e.g., via mc_complete_data) and before fitting the model, in order to ensure compatibility between the response vector and the covariance-related design matrices.

Usage

mc_remove_na(matrix_pred, cod)

Arguments

matrix_pred

A list of square matrices representing the components of the matrix linear predictor.

cod

An integer vector giving the indices of rows and columns to be removed. These indices usually correspond to missing observations in the stacked response vector.

Details

For each matrix Z_d in the matrix linear predictor, the function returns the submatrix obtained by deleting the rows and columns specified in cod. This operation preserves the symmetry and relative structure of the covariance components while aligning them with the reduced response vector.

This is an internal utility function and is not intended to be called directly by end users.

Value

A list of square matrices of the same length as matrix_pred, where, for each matrix, the rows and columns indexed by cod have been removed.

Author(s)

Wagner Hugo Bonat, wbonat@ufpr.br

See Also

mc_dglm, mc_ns, mc_ma, mc_rw


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