Skip to content

Commit

Permalink
Fixed old test.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxBlesch committed Oct 2, 2024
1 parent cc395b2 commit 3a8b0fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/dcegm/final_periods.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def solve_final_period_discrete(
)
# Choose which draw we take for policy and value function as those are not
# saved with respect to the draws
middle_of_draws = int(value.shape[2] + 1 / 2)
middle_of_draws = int((value.shape[2] - 1) / 2)
# Select solutions to store
value_final = value[:, :, middle_of_draws]

Expand Down
7 changes: 4 additions & 3 deletions 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 = 6
EXPERIENCE_GRID_POINTS = 5


PARAMS = {
Expand Down Expand Up @@ -129,6 +129,7 @@ def test_setup():
@pytest.mark.parametrize(
"period, experience, lagged_choice, choice",
[
(1, 0, 1, 0),
(1, 0, 1, 0),
(1, 1, 0, 0),
(2, 1, 0, 1),
Expand Down Expand Up @@ -220,5 +221,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 3a8b0fa

Please sign in to comment.