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.
bhhhcalculate_parameter_covarianceCompute the parameter covariance matrix.
check_d_loglikeCheck that the analytic and finite-difference gradients are approximately equal.
clear()clear_best_loglikecount(value)cross_validateA simple but well optimized cross-validated log likelihood.
d2_loglikeCompute the (approximate) second derivative of log likelihood with respect to the parameters.
d_loglikeCompute the first derivative of log likelihood with respect to the parameters.
d_probabilityCompute the partial derivative of probability w.r.t.
doctor([repair_ch_av, repair_ch_zq, ...])estimateA convenience method to load data, maximize loglike, and get covariance.
estimation_statisticsCreate 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_bhhhJump start optimization
likelihood_ratioCompute 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_bhhhCompute a log like, it first deriv, and the BHHH approx of the Hessian.
loglike3Compute a log likelihood value, it first derivative, and the finite-difference approximation of the Hessian.
loglike_constants_onlyloglike_nilCompute the log likelihood with no model at all.
loglike_nullCompute the log likelihood at null values.
mangle(self, *args, **kwargs)maximize_loglikeMaximize the log likelihood.
neg_d_loglikeneg_loglikeneg_loglike2neg_loglike3noopparameter_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_nilCompute the rho squared value w.r.t.
rho_sq_nullCompute 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_bhhhMakes a series of steps using the BHHH algorithm.
simple_step_bhhhMakes one step using the BHHH algorithm.
to_xlsx(filename[, save_now])The total weight of cases in the attached data of all grouped models.
unmangle(self[, force])update_values(self, values)Attributes
constrained_covariance_matrixconstraintscovariance_matrixdataframeshessian_matrixmost_recent_estimation_resultTotal number of cases in the attached data of all grouped models.
orderingordering_tailpboundsA copy of the current min-max bounds of the parameters.
pfThe parameter frame, unmangling on access.
pnamesA copy of the current names of the parameters.
possible_overspecificationpvalsA copy of the current value of the parameters.
robust_covariance_matrixtitle