dcegm.pre_processing.model_structure.state_space¶
Functions for creating internal state space objects.
Functions¶
|
Create state space object and indexer. |
|
Create an indexer that includes the index of proxied invalid states. |
Module Contents¶
- dcegm.pre_processing.model_structure.state_space.create_state_space(model_config, sparsity_condition, debugging=False)¶
Create state space object and indexer.
We need to add the convention for the state space objects.
- Parameters:
options (dict) – Options dictionary.
- Returns:
state_vars (list): List of state variables.
- state_space (np.ndarray): 2d array of shape (n_states, n_state_variables + 1)
which serves as a collection of all possible states. By convention, the first column must contain the period and the last column the exogenous processes. Any other state variables are in between. E.g. if the two state variables are period and lagged choice and all choices are admissible in each period, the shape of the state space array is (n_periods * n_choices, 3).
- map_state_to_index (np.ndarray): Indexer array that maps states to indexes.
The shape of this object is quite complicated. For each state variable it has the number of possible states as rows, i.e. (n_poss_states_state_var_1, n_poss_states_state_var_2, ….).
- Return type:
Dict
- dcegm.pre_processing.model_structure.state_space.create_indexer_inclucing_proxies(map_state_to_index, list_of_states_proxied_from, list_of_states_proxied_to, discrete_state_names, invalid_index)¶
Create an indexer that includes the index of proxied invalid states.