Model

Model

alias of larch.numba.model.NumbaModel

Attributes

Data Connection

Model.datatree

A source for data for the model

Model.dataset

Data arrays as loaded for model computation.

Model.n_cases

The number of cases in the attached data.

Choice Definition

Model.choice_ca_var

An idca variable giving the choices as indicator values.

Model.choice_co_vars

A mapping giving idco expressions that evaluate to indicator values.

Model.choice_co_code

An idco variable giving the choices as alternative id's.

Alternative Availability

Model.availability_ca_var

An idca variable or expression indicating if alternatives are available.

Model.availability_co_vars

A mapping giving idco expressions that evaluate to availability indicators.

Utility Definition

Model.utility_ca

The portion of the utility function computed from idca data.

Model.utility_co

The portion of the utility function computed from idco data.

Model.quantity_ca

The portion of the quantity function computed from idca data.

Parameters

Model.pf

The parameter frame, unmangling on access.

Methods

Setting Parameters

Model.set_values(self[, values, ...])

Set the parameter values for one or more parameters.

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

Set a fixed value for a model parameter.

Model.set_cap(self[, cap])

Set the parameter values for one or more parameters.

Model.remove_unused_parameters([verbose])

Remove parameters that are not used in the model.

Parameter Estimation

Model.maximize_loglike

Maximize the log likelihood.

Model.calculate_parameter_covariance

Compute the parameter covariance matrix.

Model Fitness

Model.loglike_nil

Compute the log likelihood with no model at all.

Model.loglike_null

Compute the log likelihood at null values.

Model.rho_sq_nil

Compute the rho squared value w.r.t.

Model.rho_sq_null

Compute the rho squared value w.r.t.

Reporting

Model.parameter_summary(self[, output])

Create a tabular summary of parameter values.

Model.estimation_statistics

Create an XHTML summary of estimation statistics.

Model.to_xlsx(filename[, save_now])

Write the model to an Excel file.

Ancillary Computation

Model.bhhh([x, start_case, stop_case, ...])

Model.check_d_loglike

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

Model.d_loglike([x, start_case, stop_case, ...])

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

Model.d_loglike_casewise([x, start_case, ...])

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

Compute the log likelihood of the model.

Model.loglike_casewise([x, start_case, ...])

Model.logsums(self[, x, arr])

Returns the model logsums.

Model.probability(self[, x, start_case, ...])

Compute probability values.

Model.quantity([x, start_case, stop_case, ...])

Model.total_weight()

The total weight of cases in the loaded data.

Model.utility([x, start_case, stop_case, ...])

Compute values for the utility function contained in the model.