Functions

mev Namespace Reference

Functions

def mev
 Choice probability for a MEV model.
def mev_selectionBias
 Choice probability for a MEV model, including the correction for endogenous sampling as proposed by Bierlaire, Bolduc and McFadden (2008).

Function Documentation

def mev::mev (   V,
  Gi,
  av,
  choice 
)

Choice probability for a MEV model.

Parameters:
VA dictionary mapping each alternative id with the expression of the utility function.
GiA dictionary mapping each alternative id with the function

\[ \frac{\partial G}{\partial y_i}(e^{V_1},\ldots,e^{V_J}) \]

where $G$ is the MEV generating function. If an alternative $i$ is not available, then $G_i = 0$.

avA dictionary mapping each alternative id with its availability condition.
choiceExpression producing the id of the chosen alternative.
Returns:
Choice probability of the MEV model, given by

\[ \frac{e^{V_i + \ln G_i(e^{V_1},\ldots,e^{V_J})}}{\sum_j e^{V_j + \ln G_j(e^{V_1},\ldots,e^{V_J})}} \]

 def mev(V,Gi,av,choice) :
     H = {}
     for i,v in V.items() :
        H[i] =  Elem({0:0, 1: v + log(Gi[i])},Gi[i]!=0)  
     P = bioLogit(H,av,choice)
     return P
def mev::mev_selectionBias (   V,
  Gi,
  av,
  correction,
  choice 
)

Choice probability for a MEV model, including the correction for endogenous sampling as proposed by Bierlaire, Bolduc and McFadden (2008).

Parameters:
VA dictionary mapping each alternative id with the expression of the utility function.
GiA dictionary mapping each alternative id with the function

\[ \frac{\partial G}{\partial y_i}(e^{V_1},\ldots,e^{V_J}) \]

where $G$ is the MEV generating function.

avA dictionary mapping each alternative id with its availability condition.
correctionA dictionary mapping each alternative id with the expression of the correction. Typically, it is a value, or a parameter to be estimated.
choiceExpression producing the id of the chosen alternative.
Returns:
Choice probability of the MEV model, given by

\[ \frac{e^{V_i + \ln G_i(e^{V_1},\ldots,e^{V_J})}}{\sum_j e^{V_j + \ln G_j(e^{V_1},\ldots,e^{V_J})}} \]

 def mev_selectionBias(V,Gi,av,correction,choice) :
     H = {}
     for i,v in V.items() :
         H[i] = v + log(Gi[i]) + correction[i]
     P = bioLogit(H,av,choice)
     return P
 All Classes Namespaces Files Functions Variables