larch.model.model_group.ModelGroup

larch.model.model_group.ModelGroup

class ModelGroup(models, *, parameters=None, frame=None, title=None, dataservice=None, constraints=None)[source]

Bases: larch.model.abstract_model.AbstractChoiceModel, collections.abc.MutableSequence

__init__(models, *, parameters=None, frame=None, title=None, dataservice=None, constraints=None)[source]

Methods

__init__(models, *[, parameters, frame, ...])

append(value)

S.append(value) -- append value to the end of the sequence

batch_update(self)

This context manager suppresses internal updates when editing parameters.

bhhh

calculate_parameter_covariance

Compute the parameter covariance matrix.

check_d_loglike

Check that the analytic and finite-difference gradients are approximately equal.

clear()

clear_best_loglike

count(value)

cross_validate

A simple but well optimized cross-validated log likelihood.

d2_loglike

Compute the (approximate) second derivative of log likelihood with respect to the parameters.

d_loglike

Compute the first derivative of log likelihood with respect to the parameters.

d_probability

Compute the partial derivative of probability w.r.t.

doctor([repair_ch_av, repair_ch_zq, ...])

estimate

A convenience method to load data, maximize loglike, and get covariance.

estimation_statistics

Create an XHTML summary of estimation statistics.

extend(values)

S.extend(iterable) -- extend sequence by appending elements from the iterable

get_holdfast(self, name, *[, default])

get_slot_x(self, name[, holdfast_invalidates])

Get the position of a named parameter within the parameters index.

get_value(self, name, *[, default])

get_values(self)

index(value, [start, [stop]])

Raises ValueError if the value is not present.

insert(i, value)

S.insert(index, value) -- insert value before index

jumpstart_bhhh

Jump start optimization

likelihood_ratio

Compute a likelihood ratio for changing a parameter to its null value.

load_data([dataservice, autoscale_weights, ...])

lock_value(self, name, value[, note, ...])

Set a fixed value for a model parameter.

lock_values(self, *names[, note])

Set a fixed value for one or more model parameters.

loglike([x, start_case, stop_case, ...])

Compute a log likelihood value.

loglike2([x, start_case, stop_case, ...])

Compute a log likelihood value and its first derivative.

loglike2_bhhh

Compute a log like, it first deriv, and the BHHH approx of the Hessian.

loglike3

Compute a log likelihood value, it first derivative, and the finite-difference approximation of the Hessian.

loglike_constants_only

loglike_nil

Compute the log likelihood with no model at all.

loglike_null

Compute the log likelihood at null values.

mangle(self, *args, **kwargs)

maximize_loglike

Maximize the log likelihood.

neg_d_loglike

neg_loglike

neg_loglike2

neg_loglike3

noop

parameter_summary(self[, output])

Create a tabular summary of parameter values.

pf_sort(self)

Sort (on index, i.e. parameter name) and return the parameter frame.

pfo(self)

pformat(self, parameter_name[, ...])

Get the value of a parameter or a parameter expression.

pop([index])

Raise IndexError if list is empty or index is out of range.

pvalue(self, parameter_name[, ...])

Get the value of a parameter or a parameter expression.

remove(value)

S.remove(value) -- remove first occurrence of value.

reverse()

S.reverse() -- reverse IN PLACE

rho_sq_nil

Compute the rho squared value w.r.t.

rho_sq_null

Compute the rho squared value w.r.t.

set_cap(self[, cap])

Set the parameter values for one or more parameters.

set_frame(self, frame)

Assign a new parameter frame.

set_value(self, name[, value])

Set the value for a single model parameter.

set_values([values, respect_holdfast])

Set the parameter values for one or more parameters.

shift_values(self, shifts)

simple_fit_bhhh

Makes a series of steps using the BHHH algorithm.

simple_step_bhhh

Makes one step using the BHHH algorithm.

to_xlsx(filename[, save_now])

total_weight()

The total weight of cases in the attached data of all grouped models.

unmangle(self[, force])

update_values(self, values)

Attributes

constrained_covariance_matrix

constraints

covariance_matrix

dataframes

hessian_matrix

most_recent_estimation_result

n_cases

Total number of cases in the attached data of all grouped models.

ordering

ordering_tail

pbounds

A copy of the current min-max bounds of the parameters.

pf

The parameter frame, unmangling on access.

pnames

A copy of the current names of the parameters.

possible_overspecification

pvals

A copy of the current value of the parameters.

robust_covariance_matrix

title