From a48bc88bdeb3ea0b1d0db8094c98550b2ae9651b Mon Sep 17 00:00:00 2001 From: Mateo Velasquez-Giraldo Date: Mon, 8 Feb 2021 17:50:31 -0500 Subject: [PATCH 1/6] Replace init_lifecycle --- HARK/ConsumptionSaving/ConsIndShockModel.py | 62 ++++++++++++++------- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/HARK/ConsumptionSaving/ConsIndShockModel.py b/HARK/ConsumptionSaving/ConsIndShockModel.py index a69abce5e..c7a6f5583 100644 --- a/HARK/ConsumptionSaving/ConsIndShockModel.py +++ b/HARK/ConsumptionSaving/ConsIndShockModel.py @@ -49,6 +49,9 @@ from HARK import _log from HARK import set_verbosity_level +from HARK.Calibration.Income.IncomeTools import ParseIncomeSpec, ParseTimeParams, Cagetti_income +from HARK.datasets.SCF.WealthIncomeDist.SCFDistTools import income_wealth_dists_from_scf +from HARK.datasets.life_tables.us_ssa.SSATools import parse_ssa_life_table __all__ = [ "ConsumerSolution", @@ -2825,27 +2828,46 @@ def constructAssetsGrid(parameters): # Make a dictionary to specify a lifecycle consumer with a finite horizon + +# Main calibration characteristics +birth_age = 25 +death_age = 90 +adjust_infl_to = 1992 +# Use income estimates from Cagetti (2003) for High-school graduates +education = "HS" +income_calib = Cagetti_income[education] + +# Income specification +income_params = ParseIncomeSpec( + age_min=birth_age, + age_max=death_age, + adjust_infl_to=adjust_infl_to, + **income_calib, + SabelhausSong=True +) + +# Initial distribution of wealth and permanent income +dist_params = income_wealth_dists_from_scf( + base_year=adjust_infl_to, age=birth_age, education=education, wave=1995 +) + +# We need survival probabilities only up to death_age-1, because survival +# probability at death_age is 1. +liv_prb = parse_ssa_life_table( + female=False, cross_sec=True, year=2004, min_age=birth_age, max_age=death_age - 1 +) + +# Parameters related to the number of periods implied by the calibration +time_params = ParseTimeParams(age_birth=birth_age, age_death=death_age) + +# Update all the new parameters init_lifecycle = copy(init_idiosyncratic_shocks) -init_lifecycle["PermGroFac"] = [ - 1.01, - 1.01, - 1.01, - 1.01, - 1.01, - 1.02, - 1.02, - 1.02, - 1.02, - 1.02, -] -init_lifecycle["PermShkStd"] = [0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 0, 0, 0] -init_lifecycle["TranShkStd"] = [0.3, 0.2, 0.1, 0.3, 0.2, 0.1, 0.3, 0, 0, 0] -init_lifecycle["LivPrb"] = [0.99, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1] -init_lifecycle["T_cycle"] = 10 -init_lifecycle["T_retire"] = 7 -init_lifecycle[ - "T_age" -] = 11 # Make sure that old people die at terminal age and don't turn into newborns! +init_lifecycle.update(time_params) +init_lifecycle.update(dist_params) +# Note the income specification overrides the pLvlInitMean from the SCF. +init_lifecycle.update(income_params) +init_lifecycle.update({"LivPrb": liv_prb}) + # Make a dictionary to specify an infinite consumer with a four period cycle init_cyclical = copy(init_idiosyncratic_shocks) From 076478f70dc1050699f325ab02b507f319d33183 Mon Sep 17 00:00:00 2001 From: Mateo Velasquez-Giraldo Date: Fri, 12 Feb 2021 17:21:50 -0500 Subject: [PATCH 2/6] Update tests --- .../tests/test_IndShockConsumerType.py | 28 +++++++++---------- .../tests/test_IndShockConsumerTypeFast.py | 14 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/HARK/ConsumptionSaving/tests/test_IndShockConsumerType.py b/HARK/ConsumptionSaving/tests/test_IndShockConsumerType.py index 07c51efbe..3b95eaa8c 100644 --- a/HARK/ConsumptionSaving/tests/test_IndShockConsumerType.py +++ b/HARK/ConsumptionSaving/tests/test_IndShockConsumerType.py @@ -33,20 +33,20 @@ def test_ConsIndShockSolverBasic(self): LifecycleExample.solve() # test the solution_terminal - self.assertAlmostEqual(LifecycleExample.solution[10].cFunc(2).tolist(), 2) + self.assertAlmostEqual(LifecycleExample.solution[-1].cFunc(2).tolist(), 2) - self.assertAlmostEqual(LifecycleExample.solution[9].cFunc(1), 0.97769632) - self.assertAlmostEqual(LifecycleExample.solution[8].cFunc(1), 0.96624445) - self.assertAlmostEqual(LifecycleExample.solution[7].cFunc(1), 0.95691449) + self.assertAlmostEqual(LifecycleExample.solution[9].cFunc(1), 0.89066194) + self.assertAlmostEqual(LifecycleExample.solution[8].cFunc(1), 0.89144313) + self.assertAlmostEqual(LifecycleExample.solution[7].cFunc(1), 0.89210133) self.assertAlmostEqual( - LifecycleExample.solution[0].cFunc(1).tolist(), 0.87362789 + LifecycleExample.solution[0].cFunc(1).tolist(), 0.8928547282397321 ) self.assertAlmostEqual( - LifecycleExample.solution[1].cFunc(1).tolist(), 0.9081621 + LifecycleExample.solution[1].cFunc(1).tolist(), 0.8930303445748624 ) self.assertAlmostEqual( - LifecycleExample.solution[2].cFunc(1).tolist(), 0.9563899 + LifecycleExample.solution[2].cFunc(1).tolist(), 0.8933075371183773 ) solver = ConsIndShockSolverBasic( @@ -65,23 +65,23 @@ def test_ConsIndShockSolverBasic(self): solver.prepareToSolve() - self.assertAlmostEqual(solver.DiscFacEff, 0.9503999999999999) - self.assertAlmostEqual(solver.PermShkMinNext, 0.850430160026919) + self.assertAlmostEqual(solver.DiscFacEff, 0.9586233599999999) + self.assertAlmostEqual(solver.PermShkMinNext, 0.9037554719886154) self.assertAlmostEqual(solver.cFuncNowCnst(4).tolist(), 4.0) - self.assertAlmostEqual(solver.prepareToCalcEndOfPrdvP()[0], -0.2491750859108316) - self.assertAlmostEqual(solver.prepareToCalcEndOfPrdvP()[-1], 19.74982491408914) + self.assertAlmostEqual(solver.prepareToCalcEndOfPrdvP()[0], -0.2732742703949109) + self.assertAlmostEqual(solver.prepareToCalcEndOfPrdvP()[-1], 19.72572572960506) EndOfPrdvP = solver.calcEndOfPrdvP() - self.assertAlmostEqual(EndOfPrdvP[0], 6622.251864311334) - self.assertAlmostEqual(EndOfPrdvP[-1], 0.026301061207747087) + self.assertAlmostEqual(EndOfPrdvP[0], 6710.672670733023) + self.assertAlmostEqual(EndOfPrdvP[-1], 0.14122987153089447) solution = solver.makeBasicSolution( EndOfPrdvP, solver.aNrmNow, solver.makeLinearcFunc ) solver.addMPCandHumanWealth(solution) - self.assertAlmostEqual(solution.cFunc(4).tolist(), 1.7391265696400773) + self.assertAlmostEqual(solution.cFunc(4).tolist(), 1.484118342351686) def test_simulated_values(self): self.agent.initializeSim() diff --git a/HARK/ConsumptionSaving/tests/test_IndShockConsumerTypeFast.py b/HARK/ConsumptionSaving/tests/test_IndShockConsumerTypeFast.py index e90f7ba24..d9538a7ec 100644 --- a/HARK/ConsumptionSaving/tests/test_IndShockConsumerTypeFast.py +++ b/HARK/ConsumptionSaving/tests/test_IndShockConsumerTypeFast.py @@ -37,20 +37,20 @@ def test_ConsIndShockSolverBasic(self): LifecycleExample.solve() # test the solution_terminal - self.assertAlmostEqual(LifecycleExample.solution[10].cFunc(2).tolist(), 2) + self.assertAlmostEqual(LifecycleExample.solution[-1].cFunc(2).tolist(), 2) - self.assertAlmostEqual(LifecycleExample.solution[9].cFunc(1), 0.97769632) - self.assertAlmostEqual(LifecycleExample.solution[8].cFunc(1), 0.96624445) - self.assertAlmostEqual(LifecycleExample.solution[7].cFunc(1), 0.95691449) + self.assertAlmostEqual(LifecycleExample.solution[9].cFunc(1), 0.89066194) + self.assertAlmostEqual(LifecycleExample.solution[8].cFunc(1), 0.89144313) + self.assertAlmostEqual(LifecycleExample.solution[7].cFunc(1), 0.89210133) self.assertAlmostEqual( - LifecycleExample.solution[0].cFunc(1).tolist(), 0.87362789 + LifecycleExample.solution[0].cFunc(1).tolist(), 0.8928547282397321 ) self.assertAlmostEqual( - LifecycleExample.solution[1].cFunc(1).tolist(), 0.9081621 + LifecycleExample.solution[1].cFunc(1).tolist(), 0.8930303445748624 ) self.assertAlmostEqual( - LifecycleExample.solution[2].cFunc(1).tolist(), 0.9563899 + LifecycleExample.solution[2].cFunc(1).tolist(), 0.8933075371183773 ) def test_simulated_values(self): From e1c2ec4ed0c31f9c64f190007468202499193c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateo=20Vel=C3=A1squez-Giraldo?= Date: Sat, 13 Feb 2021 10:44:56 -0500 Subject: [PATCH 3/6] Update CHANGELOG.md --- Documentation/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/CHANGELOG.md b/Documentation/CHANGELOG.md index 17999c3f4..a7bd8c91e 100644 --- a/Documentation/CHANGELOG.md +++ b/Documentation/CHANGELOG.md @@ -30,6 +30,7 @@ interpolation for problems with CRRA utility. See [#888](https://github.com/econ * Adds a module with tools for parsing and using various income calibrations from the literature. It includes the option of using life-cycle profiles of income shock variances from [Sabelhaus and Song (2010)](https://www.sciencedirect.com/science/article/abs/pii/S0304393210000358). See [#921](https://github.com/econ-ark/HARK/pull/921), [#941](https://github.com/econ-ark/HARK/pull/941). * remove "Now" from model variable names [#936](https://github.com/econ-ark/HARK/pull/936) * Moves state MrkvNow to shocks['Mrkv'] in AggShockMarkov and KrusellSmith models [#935](https://github.com/econ-ark/HARK/pull/935) +* Replaces `ConsIndShock`'s `init_lifecycle` with an actual life-cycle calibration. #### Minor Changes From 82c8265ff6df39e6ac1f331940b3a192777abacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateo=20Vel=C3=A1squez-Giraldo?= Date: Sat, 13 Feb 2021 10:45:48 -0500 Subject: [PATCH 4/6] Update CHANGELOG.md --- Documentation/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/CHANGELOG.md b/Documentation/CHANGELOG.md index a7bd8c91e..a29c1fa66 100644 --- a/Documentation/CHANGELOG.md +++ b/Documentation/CHANGELOG.md @@ -30,7 +30,7 @@ interpolation for problems with CRRA utility. See [#888](https://github.com/econ * Adds a module with tools for parsing and using various income calibrations from the literature. It includes the option of using life-cycle profiles of income shock variances from [Sabelhaus and Song (2010)](https://www.sciencedirect.com/science/article/abs/pii/S0304393210000358). See [#921](https://github.com/econ-ark/HARK/pull/921), [#941](https://github.com/econ-ark/HARK/pull/941). * remove "Now" from model variable names [#936](https://github.com/econ-ark/HARK/pull/936) * Moves state MrkvNow to shocks['Mrkv'] in AggShockMarkov and KrusellSmith models [#935](https://github.com/econ-ark/HARK/pull/935) -* Replaces `ConsIndShock`'s `init_lifecycle` with an actual life-cycle calibration. +* Replaces `ConsIndShock`'s `init_lifecycle` with an actual life-cycle calibration [#951](https://github.com/econ-ark/HARK/pull/951). #### Minor Changes From 5aa2e4add1c512b21a813bf61689c7b646d3fb3a Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 17 Feb 2021 14:52:07 -0500 Subject: [PATCH 5/6] IncShkDstn documentation and warning messages, see #952 --- HARK/ConsumptionSaving/ConsAggShockModel.py | 26 ++++++------- .../ConsGenIncProcessModel.py | 11 +++--- HARK/ConsumptionSaving/ConsIndShockModel.py | 37 +++++++++---------- HARK/ConsumptionSaving/ConsMarkovModel.py | 26 +++++++------ HARK/ConsumptionSaving/ConsMedModel.py | 20 +++++----- HARK/ConsumptionSaving/ConsPortfolioModel.py | 4 +- HARK/ConsumptionSaving/ConsPrefShockModel.py | 12 +++--- HARK/ConsumptionSaving/ConsRepAgentModel.py | 14 +++---- 8 files changed, 74 insertions(+), 76 deletions(-) diff --git a/HARK/ConsumptionSaving/ConsAggShockModel.py b/HARK/ConsumptionSaving/ConsAggShockModel.py index cb0cc01c4..c88bad59d 100644 --- a/HARK/ConsumptionSaving/ConsAggShockModel.py +++ b/HARK/ConsumptionSaving/ConsAggShockModel.py @@ -1102,11 +1102,11 @@ def solveConsAggShock( ---------- solution_next : ConsumerSolution The solution to the succeeding one period problem. - IncShkDstn : [np.array] - A list containing five arrays of floats, representing a discrete + IncShkDstn : distribution.Distribution + A discrete approximation to the income process between the period being solved - and the one immediately following (in solution_next). Order: event - probabilities, idisyncratic permanent shocks, idiosyncratic transitory + and the one immediately following (in solution_next). Order: + idiosyncratic permanent shocks, idiosyncratic transitory shocks, aggregate permanent shocks, aggregate transitory shocks. LivPrb : float Survival probability; likelihood of being alive at the beginning of @@ -1292,11 +1292,11 @@ def solveConsAggShockNEW(solution_next, IncShkDstn, LivPrb, DiscFac, CRRA, PermG ---------- solution_next : ConsumerSolution The solution to the succeeding one period problem. - IncShkDstn : [np.array] - A list containing five arrays of floats, representing a discrete + IncShkDstn : distribution.Distribution + A discrete approximation to the income process between the period being solved - and the one immediately following (in solution_next). Order: event - probabilities, idisyncratic permanent shocks, idiosyncratic transitory + and the one immediately following (in solution_next). Order: + idiosyncratic permanent shocks, idiosyncratic transitory shocks, aggregate permanent shocks, aggregate transitory shocks. LivPrb : float Survival probability; likelihood of being alive at the beginning of @@ -1438,11 +1438,11 @@ def solveConsAggMarkov( ---------- solution_next : ConsumerSolution The solution to the succeeding one period problem. - IncShkDstn : [[np.array]] - A list of lists, each containing five 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, idisyncratic permanent shocks, idiosyncratic transitory + IncShkDstn : [distribution.Distribution] + A list of + discrete approximations to the income process between the period being + solved and the one immediately following (in solution_next). Order: + idisyncratic permanent shocks, idiosyncratic transitory shocks, aggregate permanent shocks, aggregate transitory shocks. LivPrb : float Survival probability; likelihood of being alive at the beginning of diff --git a/HARK/ConsumptionSaving/ConsGenIncProcessModel.py b/HARK/ConsumptionSaving/ConsGenIncProcessModel.py index 7a958ce06..2d041f213 100644 --- a/HARK/ConsumptionSaving/ConsGenIncProcessModel.py +++ b/HARK/ConsumptionSaving/ConsGenIncProcessModel.py @@ -119,8 +119,8 @@ class ConsGenIncProcessSolver(ConsIndShockSetup): ---------- solution_next : ConsumerSolution The solution to next period's one period problem. - IncShkDstn : [np.array] - A list containing three arrays of floats, representing a discrete + IncShkDstn : distribution.Distribution + A discrete approximation to the income process between the period being solved and the one immediately following (in solution_next). Order: event probabilities, persistent shocks, transitory shocks. @@ -199,11 +199,10 @@ def setAndUpdateValues(self, solution_next, IncShkDstn, LivPrb, DiscFac): ---------- solution_next : ConsumerSolution The solution to next period's one period problem. - IncShkDstn : [np.array] - A list containing three arrays of floats, representing a discrete + IncShkDstn : distribution.Distribution + A discrete approximation to the income process between the period being solved - and the one immediately following (in solution_next). Order: event - probabilities, persistent shocks, transitory shocks. + and the one immediately following (in solution_next). LivPrb : float Survival probability; likelihood of being alive at the beginning of the succeeding period. diff --git a/HARK/ConsumptionSaving/ConsIndShockModel.py b/HARK/ConsumptionSaving/ConsIndShockModel.py index c7a6f5583..c44246a6b 100644 --- a/HARK/ConsumptionSaving/ConsIndShockModel.py +++ b/HARK/ConsumptionSaving/ConsIndShockModel.py @@ -463,11 +463,10 @@ class ConsIndShockSetup(ConsPerfForesightSolver): ---------- solution_next : ConsumerSolution The solution to next period's one period problem. - IncShkDstn : [np.array] - A list containing three arrays of floats, representing a discrete + IncShkDstn : distribution.Distribution + 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. + and the one immediately following (in solution_next). LivPrb : float Survival probability; likelihood of being alive at the beginning of the succeeding period. @@ -1155,11 +1154,10 @@ class ConsKinkedRsolver(ConsIndShockSolver): ---------- solution_next : ConsumerSolution The solution to next period's one period problem. - IncShkDstn : [np.array] - A list containing three arrays of floats, representing a discrete + IncShkDstn : distribution.Distribution + 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. + and the one immediately following (in solution_next). LivPrb : float Survival probability; likelihood of being alive at the beginning of the succeeding period. @@ -2470,16 +2468,15 @@ def constructLognormalIncomeProcessUnemployment(self): Returns ------- - IncShkDstn : [[np.array]] - A list with T_cycle elements, each of which is a list of three arrays - representing a discrete approximation to the income process in a period. - Order: probabilities, permanent shocks, transitory shocks. - PermShkDstn : [[np.array]] - A list with T_cycle elements, each of which is a list of two arrays - representing a discrete approximation to the permanent income shocks. - TranShkDstn : [[np.array]] - A list with T_cycle elements, each of which is a list of two arrays - representing a discrete approximation to the transitory income shocks. + IncShkDstn : [distribution.Distribution] + A list with T_cycle elements, each of which is a + discrete approximation to the income process in a period. + PermShkDstn : [[distribution.Distributiony]] + A list with T_cycle elements, each of which + a discrete approximation to the permanent income shocks. + TranShkDstn : [[distribution.Distribution]] + A list with T_cycle elements, each of which + a discrete approximation to the transitory income shocks. """ # Unpack the parameters from the input PermShkStd = self.PermShkStd @@ -2735,7 +2732,7 @@ def applyFlatIncomeTax( Parameters ---------- - IncShkDstn : [income distributions] + IncShkDstn : [distribution.Distribution] The discrete approximation to the income distribution in each time period. tax_rate : float A flat income tax rate to be applied to all employed income. @@ -2748,7 +2745,7 @@ def applyFlatIncomeTax( Returns ------- - IncShkDstn_new : [income distributions] + IncShkDstn_new : [distribution.Distribution] The updated income distributions, after applying the tax. """ unemployed_indices = ( diff --git a/HARK/ConsumptionSaving/ConsMarkovModel.py b/HARK/ConsumptionSaving/ConsMarkovModel.py index 4408df460..aaeb312f6 100644 --- a/HARK/ConsumptionSaving/ConsMarkovModel.py +++ b/HARK/ConsumptionSaving/ConsMarkovModel.py @@ -86,12 +86,11 @@ def __init__( ---------- solution_next : ConsumerSolution The solution to next period's one period problem. - IncShkDstn_list : [[np.array]] + IncShkDstn_list : [distribution.Distribution] A length N list of income distributions in each succeeding Markov - state. Each income distribution contains three arrays of floats, - representing a discrete approximation to the income process at the - beginning of the succeeding period. Order: event probabilities, - permanent shocks, transitory shocks. + state. Each income distribution is a + discrete approximation to the income process at the + beginning of the succeeding period. LivPrb : np.array Survival probability; likelihood of being alive at the beginning of the succeeding period for each Markov state. @@ -761,12 +760,11 @@ def _solveConsMarkov( ---------- solution_next : ConsumerSolution The solution to next period's one period problem. - IncShkDstn_list : [[np.array]] + IncShkDstn_list : [distribution.Distribution] A length N list of income distributions in each succeeding Markov - state. Each income distribution contains three arrays of floats, - representing a discrete approximation to the income process at the - beginning of the succeeding period. Order: event probabilities, - permanent shocks, transitory shocks. + state. Each income distribution is + a discrete approximation to the income process at the + beginning of the succeeding period. LivPrb : float Survival probability; likelihood of being alive at the beginning of the succeeding period. @@ -906,7 +904,13 @@ def checkMarkovInputs(self): # conditional on a particular Markov state. # TODO: should this be a numpy array too? for IncShkDstn_t in self.IncShkDstn: - if not isinstance(IncShkDstn_t, list) or len(IncShkDstn_t) != StateCount: + if not isinstance(IncShkDstn_t, list): + raise ValueError( + "self.IncShkDstn is time varying and so must be a list" + + "of lists of Distributions, one per Markov State. Found " + + f"{self.IncShkDstn} instead" + ) + elif len(IncShkDstn_t) != StateCount: raise ValueError( "List in IncShkDstn is not the right length, it should be length equal to number of states" ) diff --git a/HARK/ConsumptionSaving/ConsMedModel.py b/HARK/ConsumptionSaving/ConsMedModel.py index c940c0652..b89a845d1 100644 --- a/HARK/ConsumptionSaving/ConsMedModel.py +++ b/HARK/ConsumptionSaving/ConsMedModel.py @@ -885,14 +885,13 @@ class ConsMedShockSolver(ConsGenIncProcessSolver): ---------- solution_next : ConsumerSolution The solution to next period's one period problem. - IncShkDstn : [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. - MedShkDstn : [np.array] + IncShkDstn : distribution.Distribution + A discrete + approximations to the income process between the period being solved + and the one immediately following (in solution_next). + MedShkDstn : distribution.Distribution Discrete distribution of the multiplicative utility shifter for med- - ical care. Order: probabilities, preference shocks. + ical care. LivPrb : float Survival probability; likelihood of being alive at the beginning of the succeeding period. @@ -977,11 +976,10 @@ def setAndUpdateValues(self, solution_next, IncShkDstn, LivPrb, DiscFac): ---------- solution_next : ConsumerSolution The solution to next period's one period problem. - IncShkDstn : [np.array] - A list containing three arrays of floats, representing a discrete + IncShkDstn : distribution.Distribution + 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. + and the one immediately following (in solution_next). LivPrb : float Survival probability; likelihood of being alive at the beginning of the succeeding period. diff --git a/HARK/ConsumptionSaving/ConsPortfolioModel.py b/HARK/ConsumptionSaving/ConsPortfolioModel.py index f2f2b75b6..78ed63695 100644 --- a/HARK/ConsumptionSaving/ConsPortfolioModel.py +++ b/HARK/ConsumptionSaving/ConsPortfolioModel.py @@ -536,8 +536,8 @@ def solveConsPortfolio( transitory income shocks, and risky returns. This is only used if the input IndepDstnBool is False, indicating that income and return distributions can't be assumed to be independent. - IncShkDstn : [np.array] - List with three arrays: discrete probabilities, permanent income shocks, + IncShkDstn : distribution.Distribution + Discrete distribution of permanent income shocks and transitory income shocks. This is only used if the input IndepDsntBool is True, indicating that income and return distributions are independent. RiskyDstn : [np.array] diff --git a/HARK/ConsumptionSaving/ConsPrefShockModel.py b/HARK/ConsumptionSaving/ConsPrefShockModel.py index 24f4d1c3d..90b71004b 100644 --- a/HARK/ConsumptionSaving/ConsPrefShockModel.py +++ b/HARK/ConsumptionSaving/ConsPrefShockModel.py @@ -301,8 +301,8 @@ class ConsPrefShockSolver(ConsIndShockSolver): ---------- solution_next : ConsumerSolution The solution to the succeeding one period problem. - IncShkDstn : [np.array] - A list containing three arrays of floats, representing a discrete + IncShkDstn : distribution.Distribution + 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. @@ -542,8 +542,8 @@ def solveConsPrefShock( ---------- solution_next : ConsumerSolution The solution to the succeeding one period problem. - IncShkDstn : [np.array] - A list containing three arrays of floats, representing a discrete + IncShkDstn : distribution.Distribution + 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. @@ -620,8 +620,8 @@ class ConsKinkyPrefSolver(ConsPrefShockSolver, ConsKinkedRsolver): ---------- solution_next : ConsumerSolution The solution to the succeeding one period problem. - IncShkDstn : [np.array] - A list containing three arrays of floats, representing a discrete + IncShkDstn : distribution.Distribution + 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. diff --git a/HARK/ConsumptionSaving/ConsRepAgentModel.py b/HARK/ConsumptionSaving/ConsRepAgentModel.py index 06a64539e..282de855e 100644 --- a/HARK/ConsumptionSaving/ConsRepAgentModel.py +++ b/HARK/ConsumptionSaving/ConsRepAgentModel.py @@ -35,11 +35,11 @@ def solveConsRepAgent( Intertemporal discount factor for future utility. CRRA : float Coefficient of relative risk aversion. - IncShkDstn : [np.array] - A list containing three arrays of floats, representing a discrete + IncShkDstn : distribution.Distribution + 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. + and the one immediately following (in solution_next). Order: + permanent shocks, transitory shocks. CapShare : float Capital's share of income in Cobb-Douglas production function. DeprFac : float @@ -135,9 +135,9 @@ def solveConsRepAgentMarkov( Intertemporal discount factor for future utility. CRRA : float Coefficient of relative risk aversion. - IncShkDstn : [[np.array]] - A list of lists containing three arrays of floats, representing a discrete - approximation to the income process between the period being solved + IncShkDstn : [distribution.Distribution] + A list of discrete + approximations 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 From 00b37abbf2ab56361b19921edc56e684b323dfdb Mon Sep 17 00:00:00 2001 From: Sebastian Benthall Date: Thu, 18 Feb 2021 13:59:44 -0500 Subject: [PATCH 6/6] update CHANGELOG for issue #952 / PR #955 --- Documentation/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/CHANGELOG.md b/Documentation/CHANGELOG.md index a29c1fa66..ece87eab6 100644 --- a/Documentation/CHANGELOG.md +++ b/Documentation/CHANGELOG.md @@ -40,6 +40,7 @@ interpolation for problems with CRRA utility. See [#888](https://github.com/econ * Rename IncomeDstn to IncShkDstn * AgentType simulate() method now returns history. [#916](https://github.com/econ-ark/HARK/pull/916) * Rename DiscreteDistribution.drawDiscrete() to draw() +* Update documentation and warnings around IncShkDstn [#955](https://github.com/econ-ark/HARK/pull/955) ### 0.10.8