ConsNewKeynesianModel#
This file has a slightly modified and extended version of ConsIndShock that is meant to be used in heterogeneous agents new Keynesian (HANK) models. The micro- economic model is identical, but additional primitive parameters have been added to the specification of the income process. These parameters would have no inde- pendent meaning in a “micro only” setting, but with dynamic equilibrium elements (as in HANK models), they can have meaning.
- class HARK.ConsumptionSaving.ConsNewKeynesianModel.NewKeynesianConsumerType(solution_terminal=None, pseudo_terminal=True, tolerance=1e-06, verbose=1, quiet=False, seed=0, construct=True, use_defaults=True, **kwds)#
Bases:
IndShockConsumerType
A slight extension of IndShockConsumerType that permits individual labor supply, the wage rate, and the labor income tax rate to enter the income shock process.
- default_ = {'params': {'AgentCount': 10000, 'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'LivPrb': [0.98], 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFac': [1.0], 'PermGroFacAgg': 1.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'Rfree': [1.03], 'T_age': None, 'T_cycle': 1, 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005, 'aXtraCount': 100, 'aXtraExtra': None, 'aXtraMax': 50, 'aXtraMin': 0.001, 'aXtraNestFac': 3, 'constructors': {'IncShkDstn': <function construct_HANK_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'kNrmInitDstn': <function make_lognormal_kNrm_init_dstn>, 'pLvlInitDstn': <function make_lognormal_pLvl_init_dstn>, 'solution_terminal': <function make_basic_CRRA_solution_terminal>}, 'cycles': 0, 'kLogInitMean': 0.0, 'kLogInitStd': 1.0, 'kNrmInitCount': 15, 'labor': [1.0], 'mCount': 200, 'mFac': 3, 'mMax': 50, 'mMin': 0.001, 'neutral_measure': False, 'pLogInitMean': 0.0, 'pLogInitStd': 0.0, 'pLvlInitCount': 15, 'tax_rate': [0.0], 'vFuncBool': False, 'wage': [1.0]}, 'solver': <function solve_one_period_ConsIndShock>}#
- define_distribution_grid(dist_mGrid=None, dist_pGrid=None, m_density=0, num_pointsM=None, timestonest=None, num_pointsP=55, max_p_fac=30.0)#
Defines the grid on which the distribution is defined. Stores the grid of market resources and permanent income as attributes of self. Grid for normalized market resources and permanent income may be prespecified as dist_mGrid and dist_pGrid, respectively. If not then default grid is computed based off given parameters.
- Parameters:
dist_mGrid (np.array) – Prespecified grid for distribution over normalized market resources
dist_pGrid (np.array) – Prespecified grid for distribution over permanent income.
m_density (float) – Density of normalized market resources grid. Default value is mdensity = 0. Only affects grid of market resources if dist_mGrid=None.
num_pointsM (float) – Number of gridpoints for market resources grid.
num_pointsP (float) – Number of gridpoints for permanent income. This grid will be exponentiated by the function make_grid_exp_mult.
max_p_fac (float) – Factor that scales the maximum value of permanent income grid. Larger values increases the maximum value of permanent income grid.
- Return type:
None
- calc_transition_matrix(shk_dstn=None)#
Calculates how the distribution of agents across market resources transitions from one period to the next. If finite horizon problem, then calculates a list of transition matrices, consumption and asset policy grids for each period of the problem. The transition matrix/matrices and consumption and asset policy grid(s) are stored as attributes of self.
- Parameters:
shk_dstn (list) – list of income shock distributions. Each Income Shock Distribution should be a DiscreteDistribution Object (see Distribution.py)
- Return type:
None
- calc_ergodic_dist(transition_matrix=None)#
Calculates the ergodic distribution across normalized market resources and permanent income as the eigenvector associated with the eigenvalue 1. The distribution is stored as attributes of self both as a vector and as a reshaped array with the ij’th element representing the probability of being at the i’th point on the mGrid and the j’th point on the pGrid.
- Parameters:
transition_matrix (List) – list with one transition matrix whose ergordic distribution is to be solved
- Return type:
None
- compute_steady_state()#
- calc_jacobian(shk_param, T)#
Calculates the Jacobians of aggregate consumption and aggregate assets. Parameters that can be shocked are LivPrb, PermShkStd,TranShkStd, DiscFac, UnempPrb, Rfree, IncUnemp, and DiscFac.
Parameters:#
- shk_param: string
name of variable to be shocked
- T: int
dimension of Jacobian Matrix. Jacobian Matrix is a TxT square Matrix
- returns:
CJAC (numpy.array) – TxT Jacobian Matrix of Aggregate Consumption with respect to shk_param
AJAC (numpy.array) – TxT Jacobian Matrix of Aggregate Assets with respect to shk_param