Skip to content

Commit

Permalink
Modernization fixes for calc_euler_error_func
Browse files Browse the repository at this point in the history
It looks like this method lacks tests and was never updated for changes in HARK.distribution. This commit fixes some notation so that the method works again.
  • Loading branch information
mnwhite committed Sep 9, 2024
1 parent 1a34e73 commit a5d229c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions HARK/ConsumptionSaving/ConsIndShockModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2303,7 +2303,7 @@ def make_euler_error_func(self, mMax=100, approx_inc_dstn=True):
tail_bound=[0.05, 0.95],
)
TranShkDstn = add_discrete_outcome_constant_mean(
TranShkDstn, self.UnempPrb, self.IncUnemp
TranShkDstn, p=self.UnempPrb, x=self.IncUnemp
)
PermShkDstn = MeanOneLogNormal(sigma=self.PermShkStd[0]).discretize(
N=200,
Expand Down Expand Up @@ -2331,12 +2331,12 @@ def make_euler_error_func(self, mMax=100, approx_inc_dstn=True):
aNowGrid = mNowGrid - cNowGrid

# Tile the grids for fast computation
ShkCount = IncShkDstn[0].size
ShkCount = IncShkDstn.pmv.size
aCount = aNowGrid.size
aNowGrid_tiled = np.tile(aNowGrid, (ShkCount, 1))
PermShkVals_tiled = (np.tile(IncShkDstn[1], (aCount, 1))).transpose()
TranShkVals_tiled = (np.tile(IncShkDstn[2], (aCount, 1))).transpose()
ShkPrbs_tiled = (np.tile(IncShkDstn[0], (aCount, 1))).transpose()
PermShkVals_tiled = (np.tile(IncShkDstn.atoms[0], (aCount, 1))).transpose()
TranShkVals_tiled = (np.tile(IncShkDstn.atoms[1], (aCount, 1))).transpose()
ShkPrbs_tiled = (np.tile(IncShkDstn.pmv, (aCount, 1))).transpose()

# Calculate marginal value next period for each gridpoint and each shock
mNextArray = (
Expand Down

0 comments on commit a5d229c

Please sign in to comment.