Base class for RTMB Fit objects
Base class for RTMB Fit objects
Methods
Method EAP()
Calculate Expected A Posteriori (EAP) estimates from posterior samples.
Arguments
parsCharacter vector specifying the names of parameters to extract. Use "parameters" for only model parameters, "all" for all variables including transformed and generated quantities, or a character vector of specific variable names. Default is "parameters".
chainsNumeric vector specifying the chains to use. Default is NULL (all chains).
best_chainsInteger; number of best chains to retain based on mean log-posterior (lp) or ELBO. Default is NULL.
Method MAP()
Calculate Maximum A Posteriori (MAP) estimates from posterior samples.
Usage
RTMB_Fit_Base$MAP(
pars = "parameters",
chains = NULL,
best_chains = NULL,
type = c("marginal", "joint")
)Arguments
parsCharacter vector specifying the names of parameters to extract. Use "parameters" for only model parameters, "all" for all variables including transformed and generated quantities, or a character vector of specific variable names. Default is "parameters".
chainsNumeric vector specifying the chains to use. Default is NULL (all chains).
best_chainsInteger; number of best chains to retain based on mean log-posterior (lp) or ELBO. Default is NULL.
typeCharacter string specifying the type of MAP estimate. "marginal" (default) calculates the peak of the marginal posterior density for each parameter. "joint" returns the parameter values from the iteration with the highest log-posterior.
Method rotate()
Rotate sampled parameters.
Arguments
targetCharacter string specifying the target variable to base the rotation on.
referenceMatrix to rotate towards. If NULL, the target's point estimate is used.
linkedCharacter vector of variable names to be rotated in the same direction.
overwriteLogical; whether to overwrite the stored draws. If FALSE, adds to generated quantities. Default is FALSE.
suffixCharacter string to append to the rotated variable names when overwrite is FALSE. Default is "rot".
...Additional arguments passed to the rotation function.
Method fa_rotate()
Rotate factor loadings and optional factor scores.
Arguments
targetCharacter string specifying the target variable to base the rotation on.
linkedCharacter vector of variable names to be rotated in the same direction.
scoresCharacter vector of variable names to be rotated as factor scores (inverse direction).
rotateCharacter string specifying the rotation method.
...Additional arguments passed to the rotation function.