A utility that extracts the estimated penalty matrix from a fitted object of class penfa.

penmat(x, type = "full", which = NULL)

Arguments

x

An object of class penfa, that is, a fitted penalized factor model.

type

Character denoting the type of penalization. Type equal to "full" returns the complete penalty matrix; type="shrink" returns the penalty matrix for shrinkage; type="diff" the penalty matrix for parameter equivalence. The matrix returned by type="full" is the sum of all the shrink and diff penalty sub-matrices.

which

Character prompting the extraction of the penalty matrix component corresponding to the specified model matrix. It is only valid when type="shrink" or type="diff". Possible values are "lambda", "psi", "phi", "tau", "kappa" and "none". Only the model matrices penalized during model fitting (i.e., in the penfa call) can appear in the which argument.

Value

A penalty matrix of class penfaPenMat. If multiple elements are specified in the which argument, a list of penalty matrices (one for each element, and each of class penfaPenMat) is returned.

See also