From c6f8fc19ea710ec873f12e661147039ea213970b Mon Sep 17 00:00:00 2001 From: "Matthew N. White" Date: Tue, 12 Mar 2024 22:41:58 -0400 Subject: [PATCH] Resolve vFunc bug by suppressing extrapolation limit The math for the limiting linear function for the pseudo-inverse value function must not be correct, as that's what was causing the vFunc jump. It's been commented out for now. Need to look at whether the cFunc extrapolation code is correct for ConsMarkovModel. --- HARK/ConsumptionSaving/ConsMarkovModel.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/HARK/ConsumptionSaving/ConsMarkovModel.py b/HARK/ConsumptionSaving/ConsMarkovModel.py index 51dac2a13..5023e9ea2 100644 --- a/HARK/ConsumptionSaving/ConsMarkovModel.py +++ b/HARK/ConsumptionSaving/ConsMarkovModel.py @@ -14,7 +14,7 @@ IndShockConsumerType, PerfForesightConsumerType, ) -from HARK.distribution import MarkovProcess, Uniform, calc_expectation, expected +from HARK.distribution import MarkovProcess, Uniform, expected from HARK.interpolation import ( CubicInterp, LinearInterp, @@ -473,10 +473,14 @@ def calc_vPPnext(S, a, R): vNvrsP_now = np.insert( vNvrsP_now, 0, MPCmaxEff[i] ** (-CRRA / (1.0 - CRRA)) ) - MPCminNvrs = MPCminNow[i] ** (-CRRA / (1.0 - CRRA)) + # MPCminNvrs = MPCminNow[i] ** (-CRRA / (1.0 - CRRA)) vNvrsFuncNow = CubicInterp( - mNrm_temp, vNvrs_now, vNvrsP_now, MPCminNvrs * hNrmNow_i, MPCminNvrs - ) + mNrm_temp, + vNvrs_now, + vNvrsP_now, + ) # MPCminNvrs * hNrmNow_i, MPCminNvrs) + # The bounding function for the pseudo-inverse value function is incorrect. + # TODO: Resolve this strange issue; extrapolation is suppressed for now. # "Recurve" the decurved value function and add it to the list vFuncNow = ValueFuncCRRA(vNvrsFuncNow, CRRA)