Biogeme: Python Library  2.5
Functions
Functions helping to write the log likelihood function

Functions

def loglikelihood.loglikelihood (prob)
 Simply computes the log of the probability. More...
 
def loglikelihood.mixedloglikelihood (prob)
 Compute a simulated loglikelihood function. More...
 
def loglikelihood.likelihoodregression (meas, model, sigma)
 Computes likelihood function of a regression model. More...
 
def loglikelihood.loglikelihoodregression (meas, model, sigma)
 Computes log likelihood function of a regression model. More...
 
def weightedloglikelihood.weightedloglikelihood (prob, choice, weight)
 Computes the log likelihood function for the WESML estimator. More...
 

Detailed Description

Function Documentation

def loglikelihood.likelihoodregression (   meas,
  model,
  sigma 
)

Computes likelihood function of a regression model.

Parameters
measAn expression providing the value $y$ of the measure for the current observation.
modelAn expression providing the output $m$ of the model for the current observation.
sigmaAn expression (typically, a parameter) providing the standard error $\sigma$ of the error term.
Returns
The likelihood of the regression, assuming a normal distribution, that is

\[ \frac{1}{\sigma} \phi\left( \frac{y-m}{\sigma} \right) \]

where $ \phi(\cdot)$ is the pdf of the normal distribution.

Definition at line 50 of file loglikelihood.py.

def loglikelihood.loglikelihood (   prob)

Simply computes the log of the probability.

Parameters
probAn expression providing the value of the probability.
Returns
The logarithm of the probability.

Definition at line 13 of file loglikelihood.py.

def loglikelihood.loglikelihoodregression (   meas,
  model,
  sigma 
)

Computes log likelihood function of a regression model.

Parameters
measAn expression providing the value $y$ of the measure for the current observation.
modelAn expression providing the output $m$ of the model for the current observation.
sigmaAn expression (typically, a parameter) providing the standard error $\sigma$ of the error term.
Returns
The likelihood of the regression, assuming a normal distribution, that is

\[ -\left( \frac{(y-m)^2}{2\sigma^2} \right) - \log(\sigma) - \frac{1}{2}\log(2\pi) \]

Definition at line 70 of file loglikelihood.py.

def loglikelihood.mixedloglikelihood (   prob)

Compute a simulated loglikelihood function.

Parameters
probAn expression providing the value of the probability. Although it is not formally necessary, the expression should contain one or more random variables of a given distribution, and therefore write

\[ P(i|\xi_1,\ldots,\xi_L)\]

Returns
The simulated loglikelihood, given by

\[ \ln\left(\sum_{r=1}^R P(i|\xi^r_1,\ldots,\xi^r_L) \right)\]

where $R$ is the number of draws, and $\xi_j^r$ is the rth draw of the random variable $\xi_j$.

Definition at line 32 of file loglikelihood.py.

def weightedloglikelihood.weightedloglikelihood (   prob,
  choice,
  weight 
)

Computes the log likelihood function for the WESML estimator.

Parameters
probdictionary were the keys are the identifiers of the alternatives in the choice set, and the values are expressions representing the choice probabilities.
choiceexpression producing the id of the chosen alternative.
weightexpression producing the id of the chosen alternative.
Returns
value of the weighted log likelihood function

Definition at line 12 of file weightedloglikelihood.py.

Copyright 2016 Michel Bierlaire