dcegm.likelihood

THIS MODULE IS NOT TESTED YET.

IT IS WORK IN PROGRESS.

Functions

create_individual_likelihood_function(...[, ...])

create_choice_prob_function(model_structure, ...)

create_choice_prob_func_unobserved_states(...[, ...])

create_partial_choice_prob_calculation(...)

calc_choice_prob_for_state_choices(value_solved, ...)

This function interpolates the policy and value function for all agents.

calc_choice_probs_for_states(value_solved, ...)

calculate_weights_for_each_state(params, weight_vars, ...)

Calculate the weights for each state.

Module Contents

dcegm.likelihood.create_individual_likelihood_function(income_shock_draws_unscaled, income_shock_weights, batch_info, model_structure, model_config, model_funcs, model_specs, observed_states: Dict[str, int], observed_choices, params_all, unobserved_state_specs=None, return_model_solution=False, use_probability_of_observed_states=True, slow_version=False)
dcegm.likelihood.create_choice_prob_function(model_structure, model_config, model_funcs, model_specs, observed_states, observed_choices, unobserved_state_specs, use_probability_of_observed_states, return_weight_func)
dcegm.likelihood.create_choice_prob_func_unobserved_states(model_structure, model_config, model_funcs, model_specs, observed_states: Dict[str, int], observed_choices, unobserved_state_specs, use_probability_of_observed_states=True, return_weight_func=False)
dcegm.likelihood.create_partial_choice_prob_calculation(observed_states, observed_choices, model_structure, model_config, model_funcs)
dcegm.likelihood.calc_choice_prob_for_state_choices(value_solved, endog_grid_solved, params, states, choices, state_choice_indexes, model_config, model_funcs)

This function interpolates the policy and value function for all agents.

It uses the states at the beginning of period to select the solved policy and value and then interpolates the wealth at the beginning of period on them.

dcegm.likelihood.calc_choice_probs_for_states(value_solved, endog_grid_solved, state_choice_indexes, params, states, model_config, model_funcs)
dcegm.likelihood.calculate_weights_for_each_state(params, weight_vars, model_specs, weight_func)

Calculate the weights for each state.

Parameters:
  • params (dict) – Parameters.

  • state_vec (dict) – State vector.

  • choice (int) – Choice.

  • options (dict) – Options.

  • weight_func (Callable) – Weight function.

Returns:

Weight.

Return type:

float