dcegm.toy_models.cons_ret_model_dcegm_paper.utility_functions¶
Functions¶
Create dictionary with utility functions. |
|
|
Computes the agent's current utility based on a CRRA utility function. |
|
Computes marginal utility of CRRA utility function. |
|
Computes the inverse marginal utility of a CRRA utility function. |
Create dictionary with utility functions for the final period. |
|
|
|
|
Computes marginal utility of CRRA utility function. |
Module Contents¶
- dcegm.toy_models.cons_ret_model_dcegm_paper.utility_functions.create_utility_function_dict()¶
Create dictionary with utility functions.
- Returns:
Dictionary with utility functions.
- Return type:
utility_functions (dict)
- dcegm.toy_models.cons_ret_model_dcegm_paper.utility_functions.utility_crra(consumption: jax.numpy.array, choice: int, params: Dict[str, float]) jax.numpy.array¶
Computes the agent’s current utility based on a CRRA utility function.
- Parameters:
consumption (jnp.array) – Level of the agent’s consumption. Array of shape (i) (n_quad_stochastic * n_grid_wealth,) when called by
map_exog_to_endog_grid()andget_next_period_value(), or (ii) of shape (n_grid_wealth,) when called byget_current_period_value().choice (int) – Choice of the agent, e.g. 0 = “retirement”, 1 = “working”.
params (dict) – Dictionary containing model parameters. Relevant here is the CRRA coefficient theta.
- Returns:
- Agent’s utility . Array of shape
(n_quad_stochastic * n_grid_wealth,) or (n_grid_wealth,).
- Return type:
utility (jnp.array)
- dcegm.toy_models.cons_ret_model_dcegm_paper.utility_functions.marginal_utility_crra(consumption: jax.numpy.array, params: Dict[str, float]) jax.numpy.array¶
Computes marginal utility of CRRA utility function.
- Parameters:
consumption (jnp.array) – Level of the agent’s consumption. Array of shape (n_quad_stochastic * n_grid_wealth,).
params (dict) – Dictionary containing model parameters. Relevant here is the CRRA coefficient theta.
- Returns:
- Marginal utility of CRRA consumption
function. Array of shape (n_quad_stochastic * n_grid_wealth,).
- Return type:
marginal_utility (jnp.array)
- dcegm.toy_models.cons_ret_model_dcegm_paper.utility_functions.inverse_marginal_utility_crra(marginal_utility: jax.numpy.array, params: Dict[str, float]) jax.numpy.array¶
Computes the inverse marginal utility of a CRRA utility function.
- Parameters:
marginal_utility (jnp.array) – Level of marginal CRRA utility. Array of shape (n_grid_wealth,).
params (dict) – Dictionary containing model parameters.
- Returns:
- Inverse of the marginal utility of
a CRRA consumption function. Array of shape (n_grid_wealth,).
- Return type:
inverse_marginal_utility(jnp.array)
- dcegm.toy_models.cons_ret_model_dcegm_paper.utility_functions.create_final_period_utility_function_dict()¶
Create dictionary with utility functions for the final period.
- Returns:
- Dictionary with utility functions
for the final period.
- Return type:
utility_functions_final_period (dict)
- dcegm.toy_models.cons_ret_model_dcegm_paper.utility_functions.utility_final_consume_all(choice: int, wealth: jax.numpy.array, params: Dict[str, float])¶
- dcegm.toy_models.cons_ret_model_dcegm_paper.utility_functions.marginal_utility_final_consume_all(choice, wealth: jax.numpy.array, params: Dict[str, float], model_specs: Dict[str, Any]) jax.numpy.array¶
Computes marginal utility of CRRA utility function.
- Parameters:
consumption (jnp.array) – Level of the agent’s consumption. Array of shape (n_quad_stochastic * n_grid_wealth,).
params (dict) – Dictionary containing model parameters. Relevant here is the CRRA coefficient theta.
- Returns:
- Marginal utility of CRRA consumption
function. Array of shape (n_quad_stochastic * n_grid_wealth,).
- Return type:
marginal_utility (jnp.array)