Segmentations and alternative specific specification

We consider 4 specifications for the constants:

  • Not segmented

  • Segmented by GA (yearly subscription to public transport)

  • Segmented by luggage

  • Segmented both by GA and luggage

We consider 6 specifications for the time coefficients:

  • Generic and not segmented

  • Generic and segmented with first class

  • Generic and segmented with trip purpose

  • Alternative specific and not segmented

  • Alternative specific and segmented with first class

  • Alternative specific and segmented with trip purpose

We consider 2 specifications for the cost coefficients:

  • Generic

  • Alternative specific

We obtain a total of 48 specifications. See Bierlaire and Ortelli (2023).

author:

Michel Bierlaire, EPFL

date:

Thu Jul 13 16:18:10 2023

import numpy as np
import biogeme.biogeme as bio
from biogeme import models
from biogeme.expressions import Beta
from biogeme.catalog import segmentation_catalogs, generic_alt_specific_catalogs
from biogeme.results import compile_estimation_results, pareto_optimal

See Data preparation for Swissmetro.

from swissmetro_data import (
    database,
    CHOICE,
    SM_AV,
    CAR_AV_SP,
    TRAIN_AV_SP,
    TRAIN_TT_SCALED,
    TRAIN_COST_SCALED,
    SM_TT_SCALED,
    SM_COST_SCALED,
    CAR_TT_SCALED,
    CAR_CO_SCALED,
)

Definition of the segmentations.

segmentation_ga = database.generate_segmentation(
    variable='GA', mapping={0: 'noGA', 1: 'GA'}
)

segmentation_luggage = database.generate_segmentation(
    variable='LUGGAGE', mapping={0: 'no_lugg', 1: 'one_lugg', 3: 'several_lugg'}
)

segmentation_first = database.generate_segmentation(
    variable='FIRST', mapping={0: '2nd_class', 1: '1st_class'}
)

We consider two trip purposes: ‘commuters’ and anything else. We need to define a binary variable first.

database.data['COMMUTERS'] = np.where(database.data['PURPOSE'] == 1, 1, 0)

segmentation_purpose = database.generate_segmentation(
    variable='COMMUTERS', mapping={0: 'non_commuters', 1: 'commuters'}
)

Parameters to be estimated.

ASC_CAR = Beta('ASC_CAR', 0, None, None, 0)
ASC_TRAIN = Beta('ASC_TRAIN', 0, None, None, 0)
B_TIME = Beta('B_TIME', 0, None, None, 0)
B_COST = Beta('B_COST', 0, None, None, 0)

Catalogs for the alternative specific constants.

ASC_TRAIN_catalog, ASC_CAR_catalog = segmentation_catalogs(
    generic_name='ASC',
    beta_parameters=[ASC_TRAIN, ASC_CAR],
    potential_segmentations=(
        segmentation_ga,
        segmentation_luggage,
    ),
    maximum_number=2,
)

Catalog for the travel time coefficient. Note that the function returns a list of catalogs. Here, the list contains only one of them. This is why there is a comma after “B_TIME_catalog”.

(B_TIME_catalog_dict,) = generic_alt_specific_catalogs(
    generic_name='B_TIME',
    beta_parameters=[B_TIME],
    alternatives=['TRAIN', 'SM', 'CAR'],
    potential_segmentations=(
        segmentation_first,
        segmentation_purpose,
    ),
    maximum_number=1,
)

Catalog for the travel cost coefficient.

(B_COST_catalog_dict,) = generic_alt_specific_catalogs(
    generic_name='B_COST', beta_parameters=[B_COST], alternatives=['TRAIN', 'SM', 'CAR']
)

Definition of the utility functions.

V1 = (
    ASC_TRAIN_catalog
    + B_TIME_catalog_dict['TRAIN'] * TRAIN_TT_SCALED
    + B_COST_catalog_dict['TRAIN'] * TRAIN_COST_SCALED
)
V2 = (
    B_TIME_catalog_dict['SM'] * SM_TT_SCALED
    + B_COST_catalog_dict['SM'] * SM_COST_SCALED
)
V3 = (
    ASC_CAR_catalog
    + B_TIME_catalog_dict['CAR'] * CAR_TT_SCALED
    + B_COST_catalog_dict['CAR'] * CAR_CO_SCALED
)

Associate utility functions with the numbering of alternatives.

V = {1: V1, 2: V2, 3: V3}

Associate the availability conditions with the alternatives.

av = {1: TRAIN_AV_SP, 2: SM_AV, 3: CAR_AV_SP}

Definition of the model. This is the contribution of each observation to the log likelihood function.

logprob = models.loglogit(V, av, CHOICE)

Create the Biogeme object.

the_biogeme = bio.BIOGEME(database, logprob)
the_biogeme.modelName = 'b05alt_spec_segmentation'
the_biogeme.generate_html = False
the_biogeme.generate_pickle = False

Estimate the parameters.

dict_of_results = the_biogeme.estimate_catalog()

Number of estimated models.

print(f'A total of {len(dict_of_results)} models have been estimated')
A total of 48 models have been estimated

All estimation results

compiled_results, specs = compile_estimation_results(
    dict_of_results, use_short_names=True
)
compiled_results
Model_000000 Model_000001 Model_000002 Model_000003 Model_000004 Model_000005 Model_000006 Model_000007 Model_000008 Model_000009 Model_000010 Model_000011 Model_000012 Model_000013 Model_000014 Model_000015 Model_000016 Model_000017 Model_000018 Model_000019 Model_000020 Model_000021 Model_000022 Model_000023 Model_000024 Model_000025 Model_000026 Model_000027 Model_000028 Model_000029 Model_000030 Model_000031 Model_000032 Model_000033 Model_000034 Model_000035 Model_000036 Model_000037 Model_000038 Model_000039 Model_000040 Model_000041 Model_000042 Model_000043 Model_000044 Model_000045 Model_000046 Model_000047
Number of estimated parameters 6 8 14 9 13 8 15 11 13 10 4 7 13 11 11 5 15 10 5 9 13 9 17 10 7 8 6 9 17 7 8 13 7 10 6 11 12 9 11 15 12 11 13 15 9 11 12 11
Sample size 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768 6768
Final log likelihood -5312.894223 -5013.830192 -4986.71867 -5011.211361 -5117.991547 -5075.704346 -4970.741164 -4928.268572 -4935.433409 -5022.276564 -5331.252007 -5048.818199 -4924.149131 -5042.929071 -5008.156443 -5234.708233 -4939.052885 -5011.135042 -5331.250708 -5240.921463 -4986.698765 -5160.079285 -4865.971435 -5045.571884 -5080.952424 -5241.011928 -5050.677696 -4945.30006 -4912.396818 -5031.333906 -5047.955187 -5136.058347 -4976.118642 -5226.651348 -5083.499937 -4952.546476 -4989.598481 -5204.910152 -4962.315058 -4899.835708 -5020.14451 -4995.5015 -4890.815071 -4920.638996 -5206.882927 -4957.612234 -5038.915413 -5020.027091
Akaike Information Criterion 10637.788446 10043.660383 10001.43734 10040.422722 10261.983094 10167.408692 9971.482329 9878.537145 9896.866819 10064.553128 10670.504014 10111.636399 9874.298263 10107.858141 10038.312885 10479.416466 9908.10577 10042.270084 10672.501415 10499.842927 9999.397531 10338.158569 9765.94287 10111.143768 10175.904849 10498.023855 10113.355392 9908.60012 9858.793636 10076.667813 10111.910373 10298.116695 9966.237283 10473.302695 10178.999875 9927.092951 10003.196963 10427.820304 9946.630115 9829.671416 10064.28902 10013.003 9807.630143 9871.277992 10431.765855 9937.224469 10101.830826 10062.054183
Bayesian Information Criterion 10678.708211 10098.22007 10096.916793 10101.80237 10350.642586 10221.968379 10073.781742 9953.556715 9985.526311 10132.752737 10697.783857 10159.376125 9962.957754 10182.877711 10113.332455 10513.51627 10010.405183 10110.469693 10706.60122 10561.222575 10088.057022 10399.538218 9881.882206 10179.343377 10223.644575 10552.583543 10154.275157 9969.979768 9974.732971 10124.407539 10166.47006 10386.776186 10013.97701 10541.502304 10219.91964 10002.112521 10085.036493 10489.199952 10021.649685 9931.97083 10146.128551 10088.02257 9896.289635 9973.577405 10493.145503 10012.244039 10183.670357 10137.073753
ASC_CAR (t-test) -0.271 (-2.29) -0.464 (-5.75) -0.423 (-3.67) -0.452 (-5.6) -0.364 (-2.75) -0.367 (-3.32) -0.579 (-5.03) -0.383 (-2.95) -0.602 (-5.23) -0.293 (-3.93) -0.155 (-2.66) -0.246 (-3.77) -0.67 (-7.27) -0.463 (-5.33) -0.556 (-5.04) -0.187 (-3.23) -0.488 (-3.9) -0.388 (-3.42) -0.155 (-2.53) -0.237 (-3.13) -0.489 (-5.53) -0.24 (-3.36) -0.446 (-3.68) -0.475 (-5.51) -0.415 (-5.38) -0.238 (-3.26) -0.249 (-3.97) -0.662 (-7.79) -0.615 (-5.2) -0.576 (-7.15) -0.332 (-2.72) -0.455 (-3.77) -0.281 (-4.53) -0.342 (-2.82) -0.427 (-5.55) -0.298 (-4.12) -0.502 (-5.71) -0.313 (-2.47) -0.475 (-3.86) -0.395 (-2.94) -0.365 (-2.94) -0.603 (-6.73) -0.434 (-3.72) -0.423 (-3.5) -0.407 (-3.48) -0.405 (-3.52) -0.407 (-3.59) -0.29 (-3.77)
ASC_TRAIN (t-test) -0.202 (-1.82) -0.655 (-5.1) -1.22 (-7.89) -0.633 (-4.58) -0.999 (-7.28) -0.0754 (-0.712) -0.747 (-5.69) -0.965 (-7.29) -0.88 (-6.42) -1.75 (-15.1) -0.701 (-8.49) -1.28 (-13) -1.36 (-8.42) -0.459 (-3.2) -0.121 (-1.15) -0.814 (-9.45) -1.57 (-11.2) -0.743 (-5.53) -0.701 (-7.69) -1.54 (-12.8) -1.11 (-6.79) -1.58 (-13.8) -1.07 (-6.72) -0.483 (-3.66) 0.213 (1.97) -1.54 (-13.5) -1.28 (-14) -0.938 (-6.76) -1.32 (-8.47) 0.0242 (0.236) -1.09 (-8.35) -1.12 (-8.51) -1.37 (-14.7) -1.08 (-8.08) 0.189 (2.06) -1.79 (-15.4) -1.13 (-7.25) -0.128 (-1.13) -1.14 (-9.1) -1.45 (-9.88) -1.57 (-11) -0.615 (-4.49) -0.593 (-4.28) -0.561 (-4.08) -0.337 (-3.07) 0.0774 (0.705) -0.708 (-5.4) -1.74 (-14.6)
B_COST (t-test) -1.07 (-16) -1.09 (-15.8) -1.13 (-15) -1.1 (-14.8) -1.08 (-15.9) -1.1 (-14.9) -1.23 (-16.6) -1.22 (-14.3) -1.08 (-16) -1.09 (-15.8) -1.22 (-16.3) -1.09 (-15.7) -1.1 (-14.8) -1.1 (-14.9) -1.17 (-15.3) -1.26 (-15.3) -1.08 (-15.8) -1.25 (-15.3) -1.09 (-16.1) -1.22 (-14.3) -1.12 (-15) -1.1 (-14.8) -1.17 (-15.5) -1.1 (-14.8)
B_TIME_CAR (t-test) -1.12 (-10.3) -1.3 (-7.92) -1.4 (-16.9) -1.29 (-7.92) -0.614 (-2.98) -1.4 (-16.8) -0.623 (-3) -0.617 (-3) -0.401 (-2.53) -1.3 (-7.95) -1.55 (-11.3) -0.618 (-2.98) -1.12 (-10.1) -0.403 (-2.55) -1.11 (-10.1) -1.42 (-17.1) -0.41 (-2.55) -1.39 (-16.7) -1.11 (-10.1) -1.55 (-11.4) -1.54 (-11.3) -0.416 (-2.57) -1.54 (-11.4) -1.29 (-7.88)
B_TIME_SM (t-test) -1.17 (-6.42) -1.11 (-6.13) -1.79 (-16.5) -1.11 (-6.25) -0.36 (-2.02) -1.8 (-16.6) -0.375 (-1.99) -0.37 (-2.02) -0.41 (-2.1) -1.12 (-6.21) -1.73 (-15.3) -0.365 (-2) -1.18 (-6.46) -0.411 (-2.09) -1.15 (-6.35) -1.81 (-16.6) -0.419 (-2.09) -1.78 (-16.4) -1.17 (-6.39) -1.74 (-15.4) -1.73 (-15.3) -0.426 (-2.04) -1.74 (-15.5) -1.1 (-6.16)
B_TIME_TRAIN (t-test) -1.57 (-14.4) -1.05 (-8.59) -1.81 (-20.2) -0.889 (-7.51) -0.469 (-3.75) -1.61 (-17.3) -0.568 (-4.49) -0.444 (-3.6) -0.682 (-5.35) -1.06 (-8.66) -1.34 (-12.7) -0.565 (-4.48) -1.31 (-11.5) -0.848 (-6.65) -1.51 (-13.6) -1.87 (-21.2) -0.689 (-5.39) -1.58 (-17) -1.29 (-11.2) -1.35 (-12.8) -1.18 (-11.4) -0.853 (-6.66) -1.16 (-11.4) -0.912 (-7.57)
ASC_CAR_GA (t-test) -0.218 (-1.13) -0.211 (-1.07) -0.218 (-1.12) -0.217 (-1.14) -0.0613 (-0.306) -0.291 (-1.49) -0.298 (-1.55) -0.0449 (-0.227) -0.136 (-0.676) -0.223 (-1.14) -0.203 (-1.04) -0.145 (-0.739) -0.301 (-1.56) -0.0761 (-0.389) -0.0233 (-0.115) -0.272 (-1.41) -0.231 (-1.19) -0.206 (-1.05) -0.204 (-1.04) -0.166 (-0.84) -0.193 (-0.996) -0.264 (-1.35) -0.173 (-0.891) -0.287 (-1.48)
ASC_TRAIN_GA (t-test) 1.34 (9.64) 1.19 (8.41) 1.35 (9.62) 2.05 (21.8) 1.45 (9.92) 1.78 (19.4) 1.99 (22.6) 1.4 (10.3) 1.74 (18.5) 1.32 (9.09) 1.22 (8.85) 1.26 (8.67) 1.97 (22.3) 1.52 (11.1) 1.31 (9.12) 1.95 (21.5) 1.91 (21.5) 1.75 (19.1) 1.21 (8.85) 1.89 (20.7) 1.87 (19.2) 1.76 (18.7) 1.38 (9.3) 1.8 (19.6)
B_COST_CAR (t-test) -0.887 (-7.6) -0.756 (-4.97) -0.893 (-7.75) -0.786 (-5.27) -0.762 (-4.93) -0.767 (-4.98) -0.843 (-7.16) -0.93 (-8.06) -0.78 (-5.11) -0.764 (-5.06) -0.891 (-7.69) -0.836 (-5.28) -0.924 (-7.89) -0.945 (-8.28) -0.848 (-7.25) -0.756 (-4.86) -0.898 (-7.77) -0.939 (-8.1) -0.885 (-7.53) -0.881 (-7.54) -0.845 (-5.37) -0.849 (-5.39) -0.862 (-5.52) -0.771 (-5.12)
B_COST_SM (t-test) -1.11 (-14.8) -1.14 (-13.8) -1.1 (-14.9) -1.12 (-14.2) -1.28 (-14.1) -1.31 (-13.9) -1.29 (-16) -1.09 (-15.5) -1.28 (-14.3) -1.14 (-13.8) -1.11 (-14.9) -1.15 (-14) -1.1 (-15.3) -1.08 (-15.6) -1.3 (-16.1) -1.31 (-14) -1.23 (-16.4) -1.09 (-15.5) -1.11 (-14.8) -1.23 (-16.2) -1.15 (-14.1) -1.14 (-14.3) -1.13 (-14.5) -1.13 (-14.1)
B_COST_TRAIN (t-test) -1.93 (-10.7) -1.96 (-9.57) -1.94 (-10.8) -3.08 (-16) -3 (-14.3) -1.98 (-8.84) -1.78 (-10.1) -2.74 (-16.3) -3.19 (-15) -2.02 (-9.74) -1.88 (-10.5) -2.03 (-9.61) -2.73 (-16.3) -2.94 (-17.4) -1.83 (-10.3) -1.96 (-8.86) -2.91 (-16.6) -2.93 (-17.4) -1.87 (-10.5) -2.73 (-15.7) -2.09 (-9.76) -2.97 (-14.8) -3.18 (-15.9) -2.87 (-14.9)
B_TIME (t-test) -1.18 (-9.63) -1.15 (-11.5) -1.17 (-11.2) -1.28 (-12.3) -1.16 (-13.6) -0.692 (-4.53) -1.09 (-11.1) -0.647 (-4.69) -1.28 (-15.1) -1.24 (-14.6) -1.14 (-11.4) -0.656 (-4.64) -1.12 (-9.29) -1.08 (-11.1) -1.24 (-11.9) -1.18 (-11.3) -0.69 (-4.56) -0.686 (-4.58) -0.621 (-4.46) -1.12 (-9.3) -0.622 (-4.42) -1.18 (-9.58) -0.697 (-4.58) -1.14 (-13.5)
ASC_CAR_one_lugg (t-test) 0.0684 (1.03) 0.0672 (1.02) 0.0266 (0.4) 0.0744 (1.13) 0.0193 (0.291) 0.0592 (0.918) 0.0286 (0.427) 0.104 (1.57) 0.0633 (0.967) 0.0616 (0.923) 0.0264 (0.394) 0.0582 (0.9) 0.103 (1.56) 0.0208 (0.309) 0.063 (0.953) 0.102 (1.56) 0.0324 (0.486) 0.0626 (0.954) 0.0293 (0.44) 0.0715 (1.08) 0.0295 (0.453) 0.026 (0.394) 0.0619 (0.941) 0.0749 (1.14)
ASC_CAR_several_lugg (t-test) -0.247 (-1.02) -0.25 (-1.06) -0.445 (-1.8) -0.252 (-1.06) -0.403 (-1.66) -0.261 (-1.11) -0.397 (-1.65) -0.252 (-1.07) -0.241 (-1.01) -0.432 (-1.83) -0.299 (-1.23) -0.249 (-1.06) -0.25 (-1.06) -0.429 (-1.73) -0.376 (-1.58) -0.218 (-0.928) -0.437 (-1.82) -0.23 (-0.966) -0.285 (-1.2) -0.236 (-0.999) -0.393 (-1.63) -0.319 (-1.31) -0.274 (-1.14) -0.261 (-1.1)
ASC_TRAIN_one_lugg (t-test) 0.666 (6.68) 1.14 (12) 0.784 (7.79) 0.712 (7.23) 0.607 (6.05) 0.807 (8.08) 0.639 (6.36) 1.15 (12.3) 0.67 (6.72) 1.05 (11.1) 0.674 (6.7) 0.807 (8.06) 1.15 (12.3) 0.632 (6.31) 1.04 (10.7) 1.14 (12) 0.635 (6.4) 0.666 (6.67) 0.716 (7.18) 0.708 (7.16) 0.772 (7.72) 0.797 (7.87) 0.793 (7.87) 0.717 (7.3)
ASC_TRAIN_several_lugg (t-test) 0.503 (2.23) 0.888 (3.85) 0.515 (2.32) 0.593 (2.67) 0.386 (1.78) 0.565 (2.48) 0.435 (2.01) 0.976 (4.43) 0.49 (2.19) 0.799 (3.74) 0.495 (2.3) 0.581 (2.54) 0.978 (4.47) 0.408 (1.85) 0.744 (3.33) 0.913 (3.97) 0.431 (2) 0.504 (2.23) 0.595 (2.81) 0.591 (2.65) 0.505 (2.28) 0.547 (2.47) 0.573 (2.55) 0.584 (2.65)
B_TIME_commuters (t-test) -0.218 (-0.963) -0.183 (-0.799) -0.217 (-0.984) -0.00469 (-0.0222) -0.0396 (-0.184) -0.23 (-1.01) -0.212 (-0.97) -0.202 (-0.874)
B_TIME_CAR_commuters (t-test) 0.692 (3.56) 0.699 (3.61) 0.682 (3.48) 0.71 (3.65) 0.687 (3.54) 0.692 (3.54) 0.678 (3.46) 0.686 (3.51)
B_TIME_SM_commuters (t-test) 1.67 (8.64) 1.66 (8.62) 1.6 (8.06) 1.7 (8.78) 1.64 (8.53) 1.62 (8.15) 1.61 (8.07) 1.61 (8.14)
B_TIME_TRAIN_commuters (t-test) 0.365 (2.79) 0.178 (1.3) 0.116 (0.848) 0.412 (3.14) 0.155 (1.14) 0.13 (0.956) 0.175 (1.33) 0.184 (1.4)
B_TIME_CAR_1st_class (t-test) -1.2 (-8.01) -1.2 (-7.73) -1.19 (-7.86) -1.14 (-7.27) -1.21 (-7.89) -1.13 (-7.2) -1.14 (-7.12) -1.13 (-6.98)
B_TIME_SM_1st_class (t-test) -1.42 (-6.36) -1.41 (-6.11) -1.42 (-6.24) -1.44 (-6.28) -1.42 (-6.25) -1.41 (-6.13) -1.43 (-6.12) -1.4 (-5.85)
B_TIME_TRAIN_1st_class (t-test) -0.843 (-6.52) -1.02 (-7.66) -0.859 (-6.6) -1.12 (-8.57) -0.998 (-7.53) -1.17 (-8.95) -1.16 (-8.72) -1.25 (-9.3)
B_TIME_1st_class (t-test) -0.91 (-8.39) -1.02 (-9.87) -0.943 (-8.88) -0.925 (-8.62) -0.795 (-7.45) -0.914 (-8.6) -0.891 (-8.26) -0.784 (-7.25)


Glossary

for short_name, spec in specs.items():
    print(f'{short_name}\t{spec}')
Model_000000    ASC:no_seg;B_COST_gen_altspec:generic;B_TIME:no_seg;B_TIME_gen_altspec:altspec
Model_000001    ASC:GA;B_COST_gen_altspec:altspec;B_TIME:no_seg;B_TIME_gen_altspec:generic
Model_000002    ASC:GA-LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:no_seg;B_TIME_gen_altspec:altspec
Model_000003    ASC:GA;B_COST_gen_altspec:altspec;B_TIME:COMMUTERS;B_TIME_gen_altspec:generic
Model_000004    ASC:LUGGAGE;B_COST_gen_altspec:generic;B_TIME:COMMUTERS;B_TIME_gen_altspec:altspec
Model_000005    ASC:no_seg;B_COST_gen_altspec:altspec;B_TIME:no_seg;B_TIME_gen_altspec:altspec
Model_000006    ASC:LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:FIRST;B_TIME_gen_altspec:altspec
Model_000007    ASC:GA;B_COST_gen_altspec:generic;B_TIME:COMMUTERS;B_TIME_gen_altspec:altspec
Model_000008    ASC:GA;B_COST_gen_altspec:altspec;B_TIME:FIRST;B_TIME_gen_altspec:altspec
Model_000009    ASC:GA-LUGGAGE;B_COST_gen_altspec:generic;B_TIME:no_seg;B_TIME_gen_altspec:generic
Model_000010    ASC:no_seg;B_COST_gen_altspec:generic;B_TIME:no_seg;B_TIME_gen_altspec:generic
Model_000011    ASC:GA;B_COST_gen_altspec:generic;B_TIME:COMMUTERS;B_TIME_gen_altspec:generic
Model_000012    ASC:GA-LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:FIRST;B_TIME_gen_altspec:generic
Model_000013    ASC:LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:COMMUTERS;B_TIME_gen_altspec:generic
Model_000014    ASC:no_seg;B_COST_gen_altspec:altspec;B_TIME:FIRST;B_TIME_gen_altspec:altspec
Model_000015    ASC:no_seg;B_COST_gen_altspec:generic;B_TIME:FIRST;B_TIME_gen_altspec:generic
Model_000016    ASC:GA-LUGGAGE;B_COST_gen_altspec:generic;B_TIME:FIRST;B_TIME_gen_altspec:altspec
Model_000017    ASC:GA;B_COST_gen_altspec:altspec;B_TIME:no_seg;B_TIME_gen_altspec:altspec
Model_000018    ASC:no_seg;B_COST_gen_altspec:generic;B_TIME:COMMUTERS;B_TIME_gen_altspec:generic
Model_000019    ASC:LUGGAGE;B_COST_gen_altspec:generic;B_TIME:COMMUTERS;B_TIME_gen_altspec:generic
Model_000020    ASC:GA-LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:COMMUTERS;B_TIME_gen_altspec:generic
Model_000021    ASC:LUGGAGE;B_COST_gen_altspec:generic;B_TIME:FIRST;B_TIME_gen_altspec:generic
Model_000022    ASC:GA-LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:COMMUTERS;B_TIME_gen_altspec:altspec
Model_000023    ASC:LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:no_seg;B_TIME_gen_altspec:generic
Model_000024    ASC:no_seg;B_COST_gen_altspec:altspec;B_TIME:COMMUTERS;B_TIME_gen_altspec:generic
Model_000025    ASC:LUGGAGE;B_COST_gen_altspec:generic;B_TIME:no_seg;B_TIME_gen_altspec:generic
Model_000026    ASC:GA;B_COST_gen_altspec:generic;B_TIME:no_seg;B_TIME_gen_altspec:generic
Model_000027    ASC:GA;B_COST_gen_altspec:altspec;B_TIME:FIRST;B_TIME_gen_altspec:generic
Model_000028    ASC:GA-LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:FIRST;B_TIME_gen_altspec:altspec
Model_000029    ASC:no_seg;B_COST_gen_altspec:altspec;B_TIME:FIRST;B_TIME_gen_altspec:generic
Model_000030    ASC:GA;B_COST_gen_altspec:generic;B_TIME:no_seg;B_TIME_gen_altspec:altspec
Model_000031    ASC:LUGGAGE;B_COST_gen_altspec:generic;B_TIME:FIRST;B_TIME_gen_altspec:altspec
Model_000032    ASC:GA;B_COST_gen_altspec:generic;B_TIME:FIRST;B_TIME_gen_altspec:generic
Model_000033    ASC:LUGGAGE;B_COST_gen_altspec:generic;B_TIME:no_seg;B_TIME_gen_altspec:altspec
Model_000034    ASC:no_seg;B_COST_gen_altspec:altspec;B_TIME:no_seg;B_TIME_gen_altspec:generic
Model_000035    ASC:GA-LUGGAGE;B_COST_gen_altspec:generic;B_TIME:FIRST;B_TIME_gen_altspec:generic
Model_000036    ASC:GA-LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:no_seg;B_TIME_gen_altspec:generic
Model_000037    ASC:no_seg;B_COST_gen_altspec:generic;B_TIME:COMMUTERS;B_TIME_gen_altspec:altspec
Model_000038    ASC:GA;B_COST_gen_altspec:generic;B_TIME:FIRST;B_TIME_gen_altspec:altspec
Model_000039    ASC:GA-LUGGAGE;B_COST_gen_altspec:generic;B_TIME:COMMUTERS;B_TIME_gen_altspec:altspec
Model_000040    ASC:GA-LUGGAGE;B_COST_gen_altspec:generic;B_TIME:no_seg;B_TIME_gen_altspec:altspec
Model_000041    ASC:LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:FIRST;B_TIME_gen_altspec:generic
Model_000042    ASC:GA;B_COST_gen_altspec:altspec;B_TIME:COMMUTERS;B_TIME_gen_altspec:altspec
Model_000043    ASC:LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:COMMUTERS;B_TIME_gen_altspec:altspec
Model_000044    ASC:no_seg;B_COST_gen_altspec:generic;B_TIME:FIRST;B_TIME_gen_altspec:altspec
Model_000045    ASC:no_seg;B_COST_gen_altspec:altspec;B_TIME:COMMUTERS;B_TIME_gen_altspec:altspec
Model_000046    ASC:LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:no_seg;B_TIME_gen_altspec:altspec
Model_000047    ASC:GA-LUGGAGE;B_COST_gen_altspec:generic;B_TIME:COMMUTERS;B_TIME_gen_altspec:generic

Estimation results of the Pareto optimal models.

pareto_results = pareto_optimal(dict_of_results)
compiled_pareto_results, pareto_specs = compile_estimation_results(
    pareto_results, use_short_names=True
)
compiled_pareto_results
Model_000000 Model_000001 Model_000002 Model_000003 Model_000004 Model_000005 Model_000006 Model_000007
Number of estimated parameters 17 7 6 5 13 11 4 9
Sample size 6768 6768 6768 6768 6768 6768 6768 6768
Final log likelihood -4865.971435 -4976.118642 -5050.677696 -5234.708233 -4890.815071 -4928.268572 -5331.252007 -4945.30006
Akaike Information Criterion 9765.94287 9966.237283 10113.355392 10479.416466 9807.630143 9878.537145 10670.504014 9908.60012
Bayesian Information Criterion 9881.882206 10013.97701 10154.275157 10513.51627 9896.289635 9953.556715 10697.783857 9969.979768
ASC_CAR (t-test) -0.446 (-3.68) -0.281 (-4.53) -0.249 (-3.97) -0.187 (-3.23) -0.434 (-3.72) -0.383 (-2.95) -0.155 (-2.66) -0.662 (-7.79)
ASC_CAR_GA (t-test) -0.145 (-0.739) -0.231 (-1.19) -0.301 (-1.56) -0.173 (-0.891) -0.217 (-1.14) -0.0761 (-0.389)
ASC_CAR_one_lugg (t-test) 0.0264 (0.394)
ASC_CAR_several_lugg (t-test) -0.299 (-1.23)
ASC_TRAIN (t-test) -1.07 (-6.72) -1.37 (-14.7) -1.28 (-14) -0.814 (-9.45) -0.593 (-4.28) -0.965 (-7.29) -0.701 (-8.49) -0.938 (-6.76)
ASC_TRAIN_GA (t-test) 1.26 (8.67) 1.91 (21.5) 1.97 (22.3) 1.38 (9.3) 2.05 (21.8) 1.52 (11.1)
ASC_TRAIN_one_lugg (t-test) 0.674 (6.7)
ASC_TRAIN_several_lugg (t-test) 0.495 (2.3)
B_COST_CAR (t-test) -0.836 (-5.28) -0.845 (-5.37) -0.848 (-7.25)
B_COST_SM (t-test) -1.15 (-14) -1.15 (-14.1) -1.3 (-16.1)
B_COST_TRAIN (t-test) -2.03 (-9.61) -2.09 (-9.76) -1.83 (-10.3)
B_TIME_CAR (t-test) -1.55 (-11.3) -1.55 (-11.4) -1.4 (-16.8)
B_TIME_CAR_commuters (t-test) 0.682 (3.48) 0.692 (3.54) 0.699 (3.61)
B_TIME_SM (t-test) -1.73 (-15.3) -1.74 (-15.4) -1.8 (-16.6)
B_TIME_SM_commuters (t-test) 1.6 (8.06) 1.62 (8.15) 1.66 (8.62)
B_TIME_TRAIN (t-test) -1.34 (-12.7) -1.35 (-12.8) -1.61 (-17.3)
B_TIME_TRAIN_commuters (t-test) 0.116 (0.848) 0.13 (0.956) 0.178 (1.3)
B_COST (t-test) -1.26 (-15.3) -1.1 (-14.8) -1.23 (-16.6) -1.13 (-15) -1.08 (-15.9)
B_TIME (t-test) -0.621 (-4.46) -1.18 (-11.3) -0.647 (-4.69) -1.28 (-12.3) -0.69 (-4.56)
B_TIME_1st_class (t-test) -0.914 (-8.6) -1.02 (-9.87) -0.925 (-8.62)


Glossary.

for short_name, spec in pareto_specs.items():
    print(f'{short_name}\t{spec}')
Model_000000    ASC:GA-LUGGAGE;B_COST_gen_altspec:altspec;B_TIME:COMMUTERS;B_TIME_gen_altspec:altspec
Model_000001    ASC:GA;B_COST_gen_altspec:generic;B_TIME:FIRST;B_TIME_gen_altspec:generic
Model_000002    ASC:GA;B_COST_gen_altspec:generic;B_TIME:no_seg;B_TIME_gen_altspec:generic
Model_000003    ASC:no_seg;B_COST_gen_altspec:generic;B_TIME:FIRST;B_TIME_gen_altspec:generic
Model_000004    ASC:GA;B_COST_gen_altspec:altspec;B_TIME:COMMUTERS;B_TIME_gen_altspec:altspec
Model_000005    ASC:GA;B_COST_gen_altspec:generic;B_TIME:COMMUTERS;B_TIME_gen_altspec:altspec
Model_000006    ASC:no_seg;B_COST_gen_altspec:generic;B_TIME:no_seg;B_TIME_gen_altspec:generic
Model_000007    ASC:GA;B_COST_gen_altspec:altspec;B_TIME:FIRST;B_TIME_gen_altspec:generic

Total running time of the script: (0 minutes 12.526 seconds)

Gallery generated by Sphinx-Gallery