Skip to content

Commit

Permalink
Resolve vFunc bug by suppressing extrapolation limit
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mnwhite committed Mar 13, 2024
1 parent 00861e6 commit c6f8fc1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions HARK/ConsumptionSaving/ConsMarkovModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -473,10 +473,14 @@ def calc_vPPnext(S, a, R):
vNvrsP_now = np.insert(

Check warning on line 473 in HARK/ConsumptionSaving/ConsMarkovModel.py

View check run for this annotation

Codecov / codecov/patch

HARK/ConsumptionSaving/ConsMarkovModel.py#L469-L473

Added lines #L469 - L473 were not covered by tests
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(

Check warning on line 477 in HARK/ConsumptionSaving/ConsMarkovModel.py

View check run for this annotation

Codecov / codecov/patch

HARK/ConsumptionSaving/ConsMarkovModel.py#L477

Added line #L477 was not covered by tests
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)

Check warning on line 486 in HARK/ConsumptionSaving/ConsMarkovModel.py

View check run for this annotation

Codecov / codecov/patch

HARK/ConsumptionSaving/ConsMarkovModel.py#L486

Added line #L486 was not covered by tests
Expand Down

0 comments on commit c6f8fc1

Please sign in to comment.