dcegm.pre_processing.setup_model¶
Functions¶
|
Set up the model for dcegm. |
|
Set up the model and save. |
|
Load the model from file. |
|
Module Contents¶
- dcegm.pre_processing.setup_model.create_model_dict(model_config: Dict, model_specs: Dict, utility_functions: Dict[str, Callable], utility_functions_final_period: Dict[str, Callable], budget_constraint: Callable, state_space_functions: Dict[str, Callable] = None, stochastic_states_transitions: Dict[str, Callable] = None, shock_functions: Dict[str, Callable] = None, debug_info: str = None, use_stochastic_sparsity=False)¶
Set up the model for dcegm.
It consists of two steps. First it processes the user supplied functions to make them compatible with the interface the dcegm software expects. Second it creates the states and choice objects used by the dcegm software.
- Parameters:
options (Dict[str, int]) – Options dictionary.
state_space_functions (Dict[str, Callable]) – Dictionary of user supplied
of (functions for computation) –
next period endogenous states
next period exogenous states
next period discrete choices
utility_functions (Dict[str, Callable]) – Dictionary of three user-supplied functions for computation of: (i) utility (ii) inverse marginal utility (iii) next period marginal utility
utility_functions_final_period (Dict[str, Callable]) – Dictionary of two user-supplied functions for computation of: (i) utility (ii) next period marginal utility
budget_constraint (Callable) – User supplied budget constraint.
- dcegm.pre_processing.setup_model.create_model_dict_and_save(model_config: Dict, model_specs: Dict, utility_functions: Dict[str, Callable], utility_functions_final_period: Dict[str, Callable], budget_constraint: Callable, state_space_functions: Dict[str, Callable] = None, stochastic_states_transitions: Dict[str, Callable] = None, shock_functions: Dict[str, Callable] = None, path: str = 'model.pkl', debug_info=None, use_stochastic_sparsity=False)¶
Set up the model and save.
Model creation is time-consuming. This function creates the model and saves it to file. This way the model can be loaded from file in the future, which is much faster than recreating the model from scratch.
- dcegm.pre_processing.setup_model.load_model_dict(model_config: Dict, model_specs: Dict, utility_functions: Dict[str, Callable], utility_functions_final_period: Dict[str, Callable], budget_constraint: Callable, state_space_functions: Dict[str, Callable] = None, stochastic_states_transitions: Dict[str, Callable] = None, shock_functions: Dict[str, Callable] = None, path: str = 'model.pkl', use_stochastic_sparsity=False)¶
Load the model from file.
- dcegm.pre_processing.setup_model.process_debug_string(debug_output, state_space_functions, model_specs, model_config)¶