respy
respy copied to clipboard
Negative choice set eliminates option(s) completely under some cirumstances and induces missing data columns
- respy version used, if any: 2.0.0
- Python version, if any: any
- Operating System: any
Describe the bug
The bug concerns the negative choice sets. The observed behavior is the following: restricting work choices based on minimum experience requirements in other choice alternatives sometimes eliminates the choice for which the negative choice set is specified. Not sure whether I am just not specifying things correctly, but some parts seem weird to me:
Behavior
In the example models kw_94_*
setting options["negative_choice_set"] = {'b': ['exp_edu < 12']}
seems to partially eliminate option b. The option is never chosen and more importantly, the simulated dataset then only contains columns Experience_B
, Shock_Reward_B
, Meas_Error_Wage_B
.
The following columns will be missing: Nonpecuniary_Reward_B
, Wage_B
, Flow_Utility_B
, Value_Function_B
, Continuation_Value_B
.
Some additional info:
- In the above example,
edu
is also never chosen, but it is not missing data columns. - This occurs for all
kw_94_*
example data sets and for both working options whenexp_edu < 12
is set as the negative choice condition. - It also sometimes occurs when the negative choice set is based on the experience in another occupation (for instance for
kw_94_one
optiona
whenoptions["negative_choice_set"] = {'a': ['exp_b < 2']}
) but not always (e.g. for the same modeloptions["negative_choice_set"] = {'b': ['exp_a < 2']}
does not create the issue forb
). - Eliminating a choice using a covariate like
options["negative_choice_set"] = {'b': ['at_least_twelve_exp_edu == False']}
also creates the issue. - Eliminating the option using periods for example like
options["negative_choice_set"] = {'b': ['period < 2']}
does not eliminate the data columns in any case I tested. - For the home option, the issue doesn't arise.
- Also tested this for
kw_97_basic
- same issues.
To reproduce
Steps to reproduce the behavior:
import respy as rp
params, options, df = rp.get_example_model("kw_94_one")
options["negative_choice_set"] = {'b': ['exp_edu < 12']}
simulate = rp.get_simulate_func(params, options)
data = simulate(params)
Then check out data columns and choice patterns.
@mo2561057 and @SofiaBadini tagging you, since I briefly discussed this with both of you :) Let me know if you have any ideas or additional input on this!