From 0fe2a8251fd55845ca55fa217ff634e954da8588 Mon Sep 17 00:00:00 2001 From: rakow Date: Thu, 11 Jul 2024 00:02:53 +0200 Subject: [PATCH] add more variables --- .../python/choicemodels/estimate_biogeme_plan_choice.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/python/choicemodels/estimate_biogeme_plan_choice.py b/src/main/python/choicemodels/estimate_biogeme_plan_choice.py index fe12ca72..9423a616 100644 --- a/src/main/python/choicemodels/estimate_biogeme_plan_choice.py +++ b/src/main/python/choicemodels/estimate_biogeme_plan_choice.py @@ -20,6 +20,8 @@ default="../../../../plan-choices-bestK_9-tt-only.csv") parser.add_argument("--mxl-modes", help="Modes to use mixed logit for", nargs="+", type=set, default=["pt", "bike", "ride"]) parser.add_argument("--est-performing", help="Estimate the beta for performing", action="store_true") + parser.add_argument("--est-exp-income", help="Estimate exponent for income", action="store_true") + parser.add_argument("--est-util-money", help="Estimate utility of money", action="store_true") args = parser.parse_args() @@ -47,7 +49,9 @@ SD = {} # Factor on marginal utility of money - F_UTIl_MONEY = Beta('UTIL_MONEY', 1, 0, 1.5, ESTIMATE) + EXP_INCOME = Beta('EXP_INCOME', 1, 0, 1.5, ESTIMATE if args.est_exp_income else FIXED) + + UTIL_MONEY = Beta('UTIL_MONEY', 1, 0, 2, ESTIMATE if args.est_util_money else FIXED) BETA_PERFORMING = Beta('BETA_PERFORMING', 6.88, 0, 10, ESTIMATE if args.est_performing else FIXED) @@ -72,7 +76,7 @@ AV = {} for i in range(1, ds.k + 1): - u = v[f"plan_{i}_price"] * (ds.global_income / v["income"]) ** F_UTIl_MONEY + u = v[f"plan_{i}_price"] * UTIL_MONEY * (ds.global_income / v["income"]) ** EXP_INCOME u -= v[f"plan_{i}_pt_n_switches"] for mode in ds.modes: