Model Parameters

class larch.ModelParameter(model, index)

A ModelParameter is a reference object, referring to a Model and a parameter index. Unlike a roles.ParameterRef, a ModelParameter is explicitly bound to a specific Model, and edits to attributes of a ModelParameter automatically pass through to the underlying Model. These attributes support both reading and writing:

value

the current value for the parameter

null_value

the null value for the parameter (used for null models and t-stats)

initial_value

the initial value of the parameter

min_value

the min bound for the parameter during estimation

max_value

the max bound for the parameter during estimation

holdfast

a flag indicating if the parameter value should be held fast (constrained to keep its value) during estimation

These attributes are read-only:

name

the parameter name (read-only)

index

the parameter index within the model (read-only)

t_stat

the t-statistic for the estimator (read-only)

std_err

the standard error of the estimator (read-only)

robust_std_err

the robust standard error of the estimator via bhhh sandwich (read-only)

covariance

the covariance of the estimator (read-only)

robust_covariance

the robust covariance of the estimator via bhhh sandwich (read-only)

class larch.ParameterManager

The ParameterManager class provides the interface to interact with various model parameters. You can call a ParameterManager like a mathod, to add a new parameter to the model or to access an existing parameter. You can also use it with square brackets, to get and set ModelParameter items.

When called as a method, in addition to the required parameter name, you can specify other ModelParameter attributes as keyword arguments.

When getting or setting items (with square brackets) you can give the parameter name or integer index.

See the Model section for examples.