biogeme.likelihood.linear_regression module

Calculates the contribution to the likelihood function of an observation in a linear regression context.

Michel Bierlaire Sun Aug 17 2025, 18:18:23

biogeme.likelihood.linear_regression.build_linear_terms(independent_variables, coefficients)[source]
Return type:

LinearUtility

Parameters:
  • independent_variables (list[Variable])

  • coefficients (list[Beta])

biogeme.likelihood.linear_regression.build_normalized_formula(dependent_variable, linear_terms, scale_parameter)[source]

Constructs the standardized residual expression used in the likelihood and loglikelihood.

Parameters:
  • dependent_variable (Expression) – The dependent variable expression.

  • linear_terms (Expression) – Expression for the linear terms.

  • scale_parameter (Expression) – The scale parameter expression (e.g., standard deviation).

Return type:

Expression

Returns:

An Expression representing the standardized residual (dependent_variable minus linear predictor, divided by scale).

biogeme.likelihood.linear_regression.regression_likelihood(dependent_variable, linear_terms, scale_parameter)[source]

Calculates the contribution of one observation to the likelihood under a normal regression model.

Parameters:
  • dependent_variable (Expression) – The dependent variable expression.

  • linear_terms (Expression) – Expression for the linear terms.

  • scale_parameter (Expression) – The scale parameter expression (e.g., standard deviation).

Return type:

Expression

Returns:

An Expression representing the likelihood contribution of the observation.

biogeme.likelihood.linear_regression.regression_loglikelihood(dependent_variable, linear_terms, scale_parameter)[source]

Calculates the log-likelihood contribution of one observation under a normal regression model.

Parameters:
  • dependent_variable (Expression) – The dependent variable expression.

  • linear_terms (Expression) – Expression for the linear terms.

  • scale_parameter (Expression) – The scale parameter expression (e.g., standard deviation).

Return type:

Expression

Returns:

An Expression representing the log-likelihood contribution of the observation.