ConsRepAgentModel#
This module contains models for solving representative agent macroeconomic models. This stands in contrast to all other model modules in HARK, which (unsurprisingly) take a heterogeneous agents approach. In RA models, all attributes are either time invariant or exist on a short cycle; models must be infinite horizon.
- class HARK.ConsumptionSaving.ConsRepAgentModel.RepAgentConsumerType(solution_terminal=None, pseudo_terminal=True, tolerance=1e-06, verbose=1, quiet=False, seed=0, construct=True, use_defaults=True, **kwds)#
Bases:
IndShockConsumerTypeA class for representing representative agents with inelastic labor supply.
- time_inv_ = ['CRRA', 'DiscFac', 'CapShare', 'DeprRte', 'aXtraGrid']#
- default_ = {'params': {'AgentCount': 1, 'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CapShare': 0.36, 'CubicBool': False, 'DeprRte': 0.05, 'DiscFac': 0.96, 'IncUnemp': 0.0, 'IncUnempRet': 0.0, 'LivPrb': [1.0], 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFac': [1.01], '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.0, 'UnempPrbRet': 0.005, 'aXtraCount': 48, 'aXtraExtra': None, 'aXtraMax': 20, 'aXtraMin': 0.001, 'aXtraNestFac': 3, 'constructors': {'IncShkDstn': <function construct_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': -12.0, 'kLogInitStd': 0.0, 'kNrmInitCount': 15, 'neutral_measure': False, 'pLogInitMean': 0.0, 'pLogInitStd': 0.0, 'pLvlInitCount': 15, 'pseudo_terminal': False, 'vFuncBool': False}, 'solver': <function solve_ConsRepAgent>}#
- pre_solve()#
Method that is run automatically just before solution by backward iteration. Solves the (trivial) terminal period and does a quick check on the borrowing constraint and MaxKinks attribute (only relevant in constrained, infinite horizon problems).
- get_states()#
TODO: replace with call to transition
Calculates updated values of normalized market resources and permanent income level. Uses pLvlNow, aNrmNow, PermShkNow, TranShkNow.
- Parameters:
None
- Return type:
None
- check_conditions(verbose=None)#
This method checks whether the instance’s type satisfies various conditions. When combinations of these conditions are satisfied, the solution to the problem exhibits different characteristics. (For an exposition of the conditions, see https://econ-ark.github.io/BufferStockTheory/)
- Parameters:
verbose (boolean) – Specifies different levels of verbosity of feedback. When False, it only reports whether the instance’s type fails to satisfy a particular condition. When True, it reports all results, i.e. the factor values for all conditions.
- Return type:
None
- calc_limiting_values()#
Compute various scalar values that are relevant to characterizing the solution to an infinite horizon problem. This method should only be called when T_cycle=1 and cycles=0, otherwise the values generated are meaningless. This method adds the following values to this instance in the dictionary attribute called bilt.
APFac : Absolute Patience Factor GPFacRaw : Growth Patience Factor GPFacMod : Risk-Modified Growth Patience Factor GPFacLiv : Mortality-Adjusted Growth Patience Factor GPFacLivMod : Modigliani Mortality-Adjusted Growth Patience Factor GPFacSdl : Szeidl Growth Patience Factor FHWFac : Finite Human Wealth Factor RPFac : Return Patience Factor WRPFac : Weak Return Patience Factor PFVAFac : Perfect Foresight Value of Autarky Factor VAFac : Value of Autarky Factor cNrmPDV : Present Discounted Value of Autarky Consumption MPCmin : Limiting minimum MPC as market resources go to infinity MPCmax : Limiting maximum MPC as market resources approach minimum level hNrm : Human wealth divided by permanent income. ELogPermShk : Expected log permanent income shock WorstPrb : Probability of worst income shock realization Delta_mNrm_ZeroFunc : Linear locus where expected change in market resource ratio is zero BalGroFunc : Linear consumption function where the level of market resources grows at the same rate as permanent income
- Return type:
None
- class HARK.ConsumptionSaving.ConsRepAgentModel.RepAgentMarkovConsumerType(solution_terminal=None, pseudo_terminal=True, tolerance=1e-06, verbose=1, quiet=False, seed=0, construct=True, use_defaults=True, **kwds)#
Bases:
RepAgentConsumerTypeA class for representing representative agents with inelastic labor supply and a discrete Markov state.
- time_inv_ = ['CRRA', 'DiscFac', 'CapShare', 'DeprRte', 'aXtraGrid', 'MrkvArray']#
- default_ = {'params': {'AgentCount': 1, 'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CapShare': 0.36, 'CubicBool': False, 'DeprRte': 0.05, 'DiscFac': 0.96, 'IncUnemp': 0.0, 'IncUnempRet': 0.0, 'LivPrb': [1.0], 'Mrkv': 0, 'Mrkv_p11': 0.99, 'Mrkv_p22': 0.99, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFac': [[0.97, 1.03]], '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.0, 'UnempPrbRet': 0.005, 'aXtraCount': 48, 'aXtraExtra': None, 'aXtraMax': 20, 'aXtraMin': 0.001, 'aXtraNestFac': 3, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'MrkvArray': <function make_simple_binary_rep_markov>, '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_repagent_markov_solution_terminal>}, 'cycles': 0, 'kLogInitMean': -12.0, 'kLogInitStd': 0.0, 'kNrmInitCount': 15, 'neutral_measure': False, 'pLogInitMean': 0.0, 'pLogInitStd': 0.0, 'pLvlInitCount': 15, 'pseudo_terminal': False, 'vFuncBool': False}, 'solver': <function solve_ConsRepAgentMarkov>}#
- pre_solve()#
Method that is run automatically just before solution by backward iteration. Solves the (trivial) terminal period and does a quick check on the borrowing constraint and MaxKinks attribute (only relevant in constrained, infinite horizon problems).
- initialize_sim()#
Prepares this AgentType for a new simulation. Resets the internal random number generator, makes initial states for all agents (using sim_birth), clears histories of tracked variables.
- Parameters:
None
- Return type:
None
- reset_rng()#
Reset the random number generator and all distributions for this type. Type-checking for lists is to handle the following three cases:
The target is a single distribution object
The target is a list of distribution objects (probably time-varying)
The target is a nested list of distributions, as in ConsMarkovModel.
- get_shocks()#
Draws a new Markov state and income shocks for the representative agent.
- get_controls()#
Calculates consumption for the representative agent using the consumption functions.