47 def cnl_avail(V,availability,nests,choice) :
54 for i,a
in m[1].items():
55 biosumlist.append(Elem({0:0,1:a**(m[0]) * exp(m[0] * (V[i]))},availability[i] != 0))
56 biosum = bioMultSum(biosumlist)
57 for i,a
in m[1].items():
58 Gidict[i].append(Elem({0:0,1:(biosum**((1.0/m[0])-1.0)) * (a**m[0]) * exp((m[0]-1.0)*(V[i]))},availability[i] != 0))
60 Gi[k] = bioMultSum(Gidict[k])
61 P =
mev(V,Gi,availability,choice)
112 for i,a
in m[1].items():
113 biosumlist.append(Elem({0:0,1:a**(m[0]) * exp(m[0] * (V[i]))},availability[i] != 0))
114 biosum = bioMultSum(biosumlist)
115 for i,a
in m[1].items():
116 Gidict[i].append(Elem({0:0,1:(biosum**((1.0/m[0])-1.0)) * (a**m[0]) * exp((m[0]-1.0)*(V[i]))},availability[i] != 0))
118 Gi[k] = bioMultSum(Gidict[k])
119 logP =
logmev(V,Gi,availability,choice)
163 def cnlmu(V,availability,nests,choice,bmu) :
170 for i,a
in m[1].items():
171 biosumdict.append(Elem({0:0,1:a**(m[0]/bmu) * exp(m[0] * (V[i]))},availability[i] != 0))
172 biosum = bioMultSum(biosumdict)
173 for i,a
in m[1].items():
174 Gidict[i].append(Elem({0:0,1:bmu * (biosum**((bmu/m[0])-1.0)) * (a**(m[0]/bmu)) * exp((m[0]-1.0)*(V[i]))},availability[i] != 0))
176 Gi[k] = bioMultSum(Gidict[k])
177 P =
mev(V,Gi,availability,choice)
220 def logcnlmu(V,availability,nests,choice,bmu) :
227 for i,a
in m[1].items():
228 biosumlist.append(Elem({0:0,1:a**(m[0]/bmu) * exp(m[0] * (V[i]))},availability[i] != 0))
229 biosum = bioMultSum(biosumlist)
230 for i,a
in m[1].items():
231 Gidict[i].append(Elem({0:0,1:bmu * (biosum**((bmu/m[0])-1.0)) * (a**(m[0]/bmu)) * exp((m[0]-1.0)*(V[i]))},availability[i] != 0))
233 Gi[k] = bioMultSum(Gidict[k])
234 logP =
logmev(V,Gi,availability,choice)
def logmev(V, Gi, av, choice)
Log of the choice probability for a MEV model.
def cnlmu(V, availability, nests, choice, bmu)
Implements the cross-nested logit model as a MEV model with the homogeneity parameters is explicitly ...
def cnl_avail(V, availability, nests, choice)
Implements the cross-nested logit model as a MEV model.
def logcnl_avail(V, availability, nests, choice)
Implements the log of the cross-nested logit model as a MEV model.
def logcnlmu(V, availability, nests, choice, bmu)
Implements the log of the cross-nested logit model as a MEV model with the homogeneity parameters is ...