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, **kwds)#

Bases: IndShockConsumerType

A class for representing representative agents with inelastic labor supply.

time_inv_ = ['CRRA', 'DiscFac', 'CapShare', 'DeprFac', 'aXtraGrid']#
default_ = {'params': {'AgentCount': 1, 'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CapShare': 0.36, 'CubicBool': False, 'DeprFac': 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

class HARK.ConsumptionSaving.ConsRepAgentModel.RepAgentMarkovConsumerType(solution_terminal=None, pseudo_terminal=True, tolerance=1e-06, verbose=1, quiet=False, seed=0, construct=True, **kwds)#

Bases: RepAgentConsumerType

A class for representing representative agents with inelastic labor supply and a discrete Markov state.

time_inv_ = ['CRRA', 'DiscFac', 'CapShare', 'DeprFac', 'aXtraGrid', 'MrkvArray']#
default_ = {'params': {'AgentCount': 1, 'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CapShare': 0.36, 'CubicBool': False, 'DeprFac': 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:

  1. The target is a single distribution object

  2. The target is a list of distribution objects (probably time-varying)

  3. 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.