ctModelMatrices: Matrix view for ctStanModel objects

View source: R/ctStanModel.R

ctModelMatricesR Documentation

Matrix view for ctStanModel objects

Description

Access or replace the matrix representation of a ctStanModel while keeping the pars data frame as the canonical model specification.

Usage

ctModelMatrices(x)

ctModelMatrices(x) <- value

Arguments

x

A ctStanModel object.

value

A named list of matrices, typically copied from ctModelMatrices(x) or x$matrices.

Details

ctModelMatrices(x) reconstructs matrices from x$pars. The replacement form updates matching matrix, row, and col entries in x$pars. Numeric matrix entries become fixed values; non-numeric entries become parameter labels. Metadata such as transforms and individual variation settings is preserved when possible and reset to fit-ready defaults when fixed/free status changes.

The same view is available as x$matrices. Direct replacements such as x$matrices$DRIFT[1, 2] <- "cross" update x$pars; detached copies must be assigned back with x$matrices <- mats. A placeholder matrices element is stored in the object so the view is visible in names(x) and printed objects, but the matrix values are always derived from x$pars.

Value

ctModelMatrices() returns a named list of matrices. The replacement form returns the updated ctStanModel.


ctsem documentation built on June 30, 2026, 5:07 p.m.