respy.exogenous_processes#

Utils for the inclusion of exogenous processes.

Module Contents#

Functions#

compute_transition_probabilities(states, transit_keys, ...)

Get transition probabilities by dense_key.

weight_continuation_values(complex_, options, ...)

Weight continuation values by their probability.

create_transit_choice_set(...)

Return max representation choice set of each dense choice core.

_get_maximal_choice_set(list_of_choice_sets)

_get_representation_cols(rep_choice_set, choice_set)

Return index of array cols.

create_transition_objects(dense_covariates, core_key, ...)

Create objects necessary for tranistion probabilities.

respy.exogenous_processes.compute_transition_probabilities(states, transit_keys, optim_paras, dense_key_to_dense_covariates)[source]#

Get transition probabilities by dense_key.

We calculate transition probabilities for one dense key in this function. Therefore we retrieve probabilities for individuals and combine them to get a full transition matrix.

Returns:
dfpandas.core.DataFrame

Rows represent states within a dense key and columns potential dense states in the next period.

respy.exogenous_processes.weight_continuation_values(complex_, options, continuation_values, transit_key_to_choice_set)[source]#

Weight continuation values by their probability.

We weight continuation values for a dense key according to the probablity that she could end up in of these. Exogenous processes only depend upon the state in this period and not the choice thus we can calculate the cont values symetrically across choices. Caution has to be exercised when choice sets are restricted. Another imortant point are states that can only be reached with a change of exogenous process.

Returns:
continuation_valuesnp.array

(n_states, n_choices) with the weighted continuation values.

respy.exogenous_processes.create_transit_choice_set(dense_key_to_transit_representation, dense_key_to_choice_set)[source]#

Return max representation choice set of each dense choice core.

respy.exogenous_processes._get_maximal_choice_set(list_of_choice_sets)[source]#
respy.exogenous_processes._get_representation_cols(rep_choice_set, choice_set)[source]#

Return index of array cols.

respy.exogenous_processes.create_transition_objects(dense_covariates, core_key, exogenous_grid, n_exog, dense_covariates_to_dense_index, core_key_and_dense_index_to_dense_key)[source]#

Create objects necessary for tranistion probabilities.