26: MTC Shared Ride - Motorized Nested Mode Choice

m = larch.example(17)

Model 26’s nesting structure groups motorized and shared ride alternatives. (pp. 182)

shared = m.graph.new_node(parameter='mu_shared', children=[2,3], name='Shared')
motorized = m.graph.new_node(parameter='mu_moto', children=[1,shared,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()
-3439.451...

>>> print(m.pfo()[['value','initvalue','nullvalue','minimum','maximum','holdfast']])
                                  value  initvalue  nullvalue  minimum  maximum  holdfast
Category   Parameter
CostbyInc  costbyincome         -0.0361        0.0        0.0     -inf      inf         0
TravelTime motorized_time       -0.0128        0.0        0.0     -inf      inf         0
           nonmotorized_time    -0.0465        0.0        0.0     -inf      inf         0
           motorized_ovtbydist  -0.1069        0.0        0.0     -inf      inf         0
Household  hhinc#4              -0.0038        0.0        0.0     -inf      inf         0
           hhinc#5              -0.0096        0.0        0.0     -inf      inf         0
           hhinc#6              -0.0067        0.0        0.0     -inf      inf         0
           vehbywrk_BIKE        -0.7444        0.0        0.0     -inf      inf         0
           vehbywrk_SR          -0.2185        0.0        0.0     -inf      inf         0
           vehbywrk_TRANSIT     -0.6800        0.0        0.0     -inf      inf         0
           vehbywrk_WALK        -0.7791        0.0        0.0     -inf      inf         0
Zonal      wkcbd_BIKE            0.4804        0.0        0.0     -inf      inf         0
           wkcbd_SR2            -4.8331        0.0        0.0     -inf      inf         0
           wkcbd_SR3            16.7595        0.0        0.0     -inf      inf         0
           wkcbd_TRANSIT         0.8845        0.0        0.0     -inf      inf         0
           wkcbd_WALK            0.1168        0.0        0.0     -inf      inf         0
           wkempden_BIKE         0.0015        0.0        0.0     -inf      inf         0
           wkempden_SR2         -0.0063        0.0        0.0     -inf      inf         0
           wkempden_SR3          0.0130        0.0        0.0     -inf      inf         0
           wkempden_TRANSIT      0.0023        0.0        0.0     -inf      inf         0
           wkempden_WALK         0.0023        0.0        0.0     -inf      inf         0
ASCs       ASC_BIKE             -1.3349        0.0        0.0     -inf      inf         0
           ASC_SR2              -5.1111        0.0        0.0     -inf      inf         0
           ASC_SR3             -43.4788        0.0        0.0     -inf      inf         0
           ASC_TRANSIT          -0.4434        0.0        0.0     -inf      inf         0
           ASC_WALK              0.3911        0.0        0.0     -inf      inf         0
Other      mu_moto               0.6970        1.0        1.0    0.001      1.0         0
           mu_shared            23.1974        1.0        1.0    0.001      1.0         0