dcegm.egm.aggregate_marginal_utility¶
Functions¶
Compute the aggregate marginal utilities and expected values. |
|
Module Contents¶
- dcegm.egm.aggregate_marginal_utility.aggregate_marg_utils_and_exp_values(value_state_choice_specific: jax.numpy.ndarray, marg_util_state_choice_specific: jax.numpy.ndarray, reshape_state_choice_vec_to_mat: jax.numpy.ndarray, taste_shock_scale, taste_shock_scale_is_scalar, income_shock_weights: jax.numpy.ndarray) Tuple[jax.numpy.ndarray, jax.numpy.ndarray]¶
Compute the aggregate marginal utilities and expected values.
- Parameters:
value_state_choice_specific (jnp.ndarray) – 3d array of shape (n_states * n_ choices, n_exog_savings, n_income_shocks) of the value function for all state-choice combinations and income shocks.
marg_util_state_choice_specific (jnp.ndarray) – 3d array of shape (n_states * n_choices, n_exog_savings, n_income_shocks) of the marginal utility of consumption for all states-choice combinations and income shocks.
reshape_state_choice_vec_to_mat (np.ndarray) – 2d array of shape (n_states_current, n_choices_current) that reshapes the current period vector of feasible state-choice combinations to a matrix of shape (n_choices, n_choices).
taste_shock_scale (float) – The taste shock scale.
income_shock_weights (jnp.ndarray) – 1d array of shape (n_stochastic_quad_points,) containing the weights of the income shock quadrature.
- Returns:
- marg_util (np.ndarray): 2d array of shape (n_states, n_exog_savings)
of the state-specific aggregate marginal utilities.
- expected_value (np.ndarray): 2d array of shape (n_states, n_exog_savings)
of the state-specific aggregate expected values.
- Return type:
tuple
- dcegm.egm.aggregate_marginal_utility.calculate_choice_probs_and_unsqueezed_logsum(choice_values_per_state: jax.numpy.ndarray, taste_shock_scale: jax.numpy.ndarray) Tuple[jax.numpy.ndarray, jax.numpy.ndarray, jax.numpy.ndarray]¶