regularizeMxModel: Regularize an MxModel

Description Usage Arguments Value

View source: R/regularizeMxModel.R

Description

Create a regularized container object that encloses an unregularized mxModel. This was the first trial; you should now just create MxModels using MxModel.

Usage

1
2
3
4
5
6
regularizeMxModel(
  model,
  reg_params = NULL,
  penalty_value = 50,
  penalty_function = "lasso"
)

Arguments

model

the original mxmodel to regularize

reg_params

the list of parameters or algebra cells regularized by this object. The default (NULL) regularizes on all free parameters in the model.

penalty_function

the type of function to eb used for regularization. Currently supports "lasso" or "ridge"

...

arguments to the penalty function, usually 'lambda=' (for lasso or ridge) and 'alpha=' (for elastic net)

Value

A regularized MxModel; at this point a wrapper model with regularization enclosed


trbrick/mxregsem documentation built on Nov. 18, 2020, 7:30 p.m.