Biogeme: Python Library  2.5
weightedloglikelihood.py
Go to the documentation of this file.
1 ## \file
2 # Log likelihood function for WESML
3 
4 from biogeme import *
5 
6 ## Computes the log likelihood function for the WESML estimator.
7 # @ingroup likelihood
8 # @param prob <a href="http://docs.python.org/py3k/tutorial/datastructures.html#dictionaries" target="_blank">dictionary</a> were the keys are the identifiers of the alternatives in the choice set, and the values are expressions representing the choice probabilities.
9 # @param choice expression producing the id of the chosen alternative.
10 # @param weight expression producing the id of the chosen alternative.
11 # @return value of the weighted log likelihood function
12 def weightedloglikelihood(prob,choice,weight):
13  BIOGEME_OBJECT.WEIGHT = weight
14  loglikelihood = log(Elem(prob,choice))
15  return loglikelihood
16 
def weightedloglikelihood(prob, choice, weight)
Computes the log likelihood function for the WESML estimator.
Copyright 2016 Michel Bierlaire