# HARK.ConsumptionSaving.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(time_flow=True, **kwds)

A class for representing representative agents with inelastic labor supply.

getStates()

Calculates updated values of normalized market resources and permanent income level. Uses pLvlNow, aNrmNow, PermShkNow, TranShkNow.

Parameters: None – None
class HARK.ConsumptionSaving.ConsRepAgentModel.RepAgentMarkovConsumerType(time_flow=True, **kwds)

A class for representing representative agents with inelastic labor supply and a discrete MarkovState

getControls()

Calculates consumption for the representative agent using the consumption functions.

Parameters: None – None
getShocks()

Draws a new Markov state and income shocks for the representative agent.

Parameters: None – None
updateSolutionTerminal()

Update the terminal period solution. This method should be run when a new AgentType is created or when CRRA changes.

Parameters: None – None
HARK.ConsumptionSaving.ConsRepAgentModel.solveConsRepAgent(solution_next, DiscFac, CRRA, IncomeDstn, CapShare, DeprFac, PermGroFac, aXtraGrid)

Solve one period of the simple representative agent consumption-saving model.

Parameters: solution_next (ConsumerSolution) – Solution to the next period’s problem (i.e. previous iteration). DiscFac (float) – Intertemporal discount factor for future utility. CRRA (float) – Coefficient of relative risk aversion. IncomeDstn ([np.array]) – A list containing three arrays of floats, representing a discrete approximation to the income process between the period being solved and the one immediately following (in solution_next). Order: event probabilities, permanent shocks, transitory shocks. CapShare (float) – Capital’s share of income in Cobb-Douglas production function. DeprFac (float) – Depreciation rate of capital. PermGroFac (float) – Expected permanent income growth factor at the end of this period. aXtraGrid (np.array) – Array of “extra” end-of-period asset values– assets above the absolute minimum acceptable level. In this model, the minimum acceptable level is always zero. solution_now – Solution to this period’s problem (new iteration). ConsumerSolution
HARK.ConsumptionSaving.ConsRepAgentModel.solveConsRepAgentMarkov(solution_next, MrkvArray, DiscFac, CRRA, IncomeDstn, CapShare, DeprFac, PermGroFac, aXtraGrid)

Solve one period of the simple representative agent consumption-saving model. This version supports a discrete Markov process.

Parameters: solution_next (ConsumerSolution) – Solution to the next period’s problem (i.e. previous iteration). MrkvArray (np.array) – Markov transition array between this period and next period. DiscFac (float) – Intertemporal discount factor for future utility. CRRA (float) – Coefficient of relative risk aversion. IncomeDstn ([[np.array]]) – A list of lists containing three arrays of floats, representing a discrete approximation to the income process between the period being solved and the one immediately following (in solution_next). Order: event probabilities, permanent shocks, transitory shocks. CapShare (float) – Capital’s share of income in Cobb-Douglas production function. DeprFac (float) – Depreciation rate of capital. PermGroFac ([float]) – Expected permanent income growth factor for each state we could be in next period. aXtraGrid (np.array) – Array of “extra” end-of-period asset values– assets above the absolute minimum acceptable level. In this model, the minimum acceptable level is always zero. solution_now – Solution to this period’s problem (new iteration). ConsumerSolution