Skip to content

Commit

Permalink
identity weight test
Browse files Browse the repository at this point in the history
  • Loading branch information
sidd3888 committed Feb 9, 2024
1 parent 6e57bbb commit 3e9d723
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/estimation/test_msm_weighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def expected_values():
cov_np = np.diag([1, 2, 3])
cov_pd = pd.DataFrame(cov_np)

test_cases = itertools.product([cov_np, cov_pd], ["diagonal", "optimal"])
test_cases = itertools.product([cov_np, cov_pd], ["diagonal", "optimal", "identity"])


@pytest.mark.parametrize("moments_cov, method", test_cases)
Expand All @@ -38,7 +38,11 @@ def test_get_weighting_matrix(moments_cov, method):
assert calculated.columns.equals(moments_cov.columns)
calculated = calculated.to_numpy()

expected = np.diag(1 / np.array([1, 2, 3]))
if method == "identity":
expected = np.identity(cov_np.shape[0])
else:
expected = np.diag(1 / np.array([1, 2, 3]))

aaae(calculated, expected)


Expand Down

0 comments on commit 3e9d723

Please sign in to comment.