Functions

cnl Namespace Reference

Functions

def cnl_avail
 Implements the cross-nested logit model as a MEV model.
def cnlmu

Function Documentation

def cnl::cnl_avail (   V,
  availability,
  nests,
  choice 
)

Implements the cross-nested logit model as a MEV model.

Parameters:
VA dictionary mapping each alternative id with the expression of the utility function.
availabilityA dictionary mapping each alternative id with its availability condition.
nestsA tuple containing as many items as nests. Each item is also a tuple containing two items:

  • An expression representing the nest parameter.
  • A dictionary mapping the alternative ids with the cross-nested parameters for the corresponding nest. Example with two nests and 6 alternatives:
    alphaA = {1: alpha1a,
              2: alpha2a,
              3: alpha3a,
              4: alpha4a,
              5: alpha5a,
              6: alpha6a}
    alphaB = {1: alpha1b,
              2: alpha2b,
              3: alpha3b,
              4: alpha4b,
              5: alpha5b,
              6: alpha6b}
    nesta = MUA , alphaA
    nestb = MUB , alphaB
    nests = nesta, nestb
    
Returns:
Choice probability for the cross-nested logit model.
def cnl::cnlmu (   V,
  availability,
  nests,
  choice,
  bmu 
)
 All Classes Namespaces Files Functions Variables