29: MTC Motorized - Shared Ride - Private Auto Nested Mode Choice

m = larch.example(17)

Model 29’s nesting structure groups motorized, private auto, and shared ride alternatives. (pp. 182)

shared = m.graph.new_node(parameter='mu_shared', children=[2,3], name='Shared')
private_auto = m.graph.new_node(parameter='mu_private', children=[1,shared], name='Private_Auto')
motorized = m.graph.new_node(parameter='mu_moto', children=[private_auto,4], name='Motorized')
m.ordering = (
        ("CostbyInc","costbyincome",),
        ("TravelTime",".*time.*",".*dist.*", ),
        ("Household","hhinc.*","vehbywrk.*",),
        ("Zonal","wkcbd.*","wkempden.*",),
        ("ASCs","ASC.*",),
)
>>> m.load_data()
>>> m.maximize_loglike()
┣ ...Optimization terminated successfully...
>>> m.loglike()
-3425.158...

>>> print(m.pfo()[['value','initvalue','nullvalue','minimum','maximum','holdfast']])
                                 value  initvalue  nullvalue  minimum  maximum  holdfast
Category   Parameter
CostbyInc  costbyincome        -0.0316        0.0        0.0     -inf      inf         0
TravelTime motorized_time      -0.0111        0.0        0.0     -inf      inf         0
           nonmotorized_time   -0.0470        0.0        0.0     -inf      inf         0
           motorized_ovtbydist -0.1003        0.0        0.0     -inf      inf         0
Household  hhinc#4             -0.0022        0.0        0.0     -inf      inf         0
           hhinc#5             -0.0092        0.0        0.0     -inf      inf         0
           hhinc#6             -0.0062        0.0        0.0     -inf      inf         0
           vehbywrk_BIKE       -0.6888        0.0        0.0     -inf      inf         0
           vehbywrk_SR         -0.3234        0.0        0.0     -inf      inf         0
           vehbywrk_TRANSIT    -0.4567        0.0        0.0     -inf      inf         0
           vehbywrk_WALK       -0.7065        0.0        0.0     -inf      inf         0
Zonal      wkcbd_BIKE           0.5077        0.0        0.0     -inf      inf         0
           wkcbd_SR2            0.4164        0.0        0.0     -inf      inf         0
           wkcbd_SR3            0.5777        0.0        0.0     -inf      inf         0
           wkcbd_TRANSIT        0.7369        0.0        0.0     -inf      inf         0
           wkcbd_WALK           0.1504        0.0        0.0     -inf      inf         0
           wkempden_BIKE        0.0015        0.0        0.0     -inf      inf         0
           wkempden_SR2         0.0019        0.0        0.0     -inf      inf         0
           wkempden_SR3         0.0020        0.0        0.0     -inf      inf         0
           wkempden_TRANSIT     0.0020        0.0        0.0     -inf      inf         0
           wkempden_WALK        0.0022        0.0        0.0     -inf      inf         0
ASCs       ASC_BIKE            -1.3768        0.0        0.0     -inf      inf         0
           ASC_SR2             -1.5116        0.0        0.0     -inf      inf         0
           ASC_SR3             -1.8612        0.0        0.0     -inf      inf         0
           ASC_TRANSIT         -0.3967        0.0        0.0     -inf      inf         0
           ASC_WALK             0.3401        0.0        0.0     -inf      inf         0
Other      mu_moto              0.5327        1.0        1.0    0.001      1.0         0
           mu_private           0.9282        1.0        1.0    0.001      1.0         0
           mu_shared            0.2169        1.0        1.0    0.001      1.0         0