Skip to content

Commit

Permalink
Failing utilities with exp.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxBlesch committed Oct 3, 2024
1 parent 3a8b0fa commit b2322a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
3 changes: 2 additions & 1 deletion tests/test_discrete_versus_continuous_experience.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
N_DISCRETE_CHOICES = 2
MAX_WEALTH = 50
WEALTH_GRID_POINTS = 100
EXPERIENCE_GRID_POINTS = 5
EXPERIENCE_GRID_POINTS = 12


PARAMS = {
Expand Down Expand Up @@ -136,6 +136,7 @@ def test_setup():
(2, 1, 0, 0),
(3, 3, 1, 0),
(3, 2, 0, 0),
(3, 2, 1, 0),
(3, 1, 1, 0),
(3, 0, 1, 0),
(4, 4, 0, 0),
Expand Down
26 changes: 15 additions & 11 deletions tests/test_utility_second_continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
N_DISCRETE_CHOICES = 2
MAX_WEALTH = 50
WEALTH_GRID_POINTS = 100
EXPERIENCE_GRID_POINTS = 5
EXPERIENCE_GRID_POINTS = 13

PARAMS = {
"beta": 0.95,
Expand Down Expand Up @@ -293,14 +293,18 @@ def test_setup():
@pytest.mark.parametrize(
"period, experience, lagged_choice, choice",
[
# (1, 0, 1, 0),
# (1, 1, 0, 0),
# (2, 1, 0, 1),
# (4, 1, 0, 0),
# (3, 0, 1, 0),
# (3, 3, 1, 0),
(4, 4, 0, 0),
(4, 0, 1, 1),
# (2, 2, 0, 0),
# (3, 3, 0, 0),
# (3, 0, 1, 1),
(3, 2, 1, 0),
# (3, 2, 1, 1),
# (4, 4, 0, 0),
(4, 3, 0, 0),
(4, 3, 0, 1),
# (4, 2, 0, 0),
# (4, 1, 1, 1),
# (4, 0, 1, 1),
],
)
def test_replication_discrete_versus_continuous_experience(
Expand Down Expand Up @@ -353,7 +357,7 @@ def test_replication_discrete_versus_continuous_experience(
# Interpolate
# =================================================================================

for wealth_to_test in np.arange(50, 100, 5, dtype=float):
for wealth_to_test in np.arange(1, 100, 5, dtype=float):

policy_cont_interp, value_cont_interp = (
interp2d_policy_and_value_on_wealth_and_regular_grid(
Expand All @@ -379,5 +383,5 @@ def test_replication_discrete_versus_continuous_experience(
params=PARAMS,
)

aaae(value_cont_interp, value_disc_interp, decimal=1e-6)
aaae(policy_cont_interp, policy_disc_interp, decimal=1e-6)
aaae(value_cont_interp, value_disc_interp, decimal=4)
aaae(policy_cont_interp, policy_disc_interp, decimal=4)

0 comments on commit b2322a1

Please sign in to comment.