Skip to content

Commit

Permalink
calcExpectation -> calc_expectation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mv77 committed May 26, 2021
1 parent 7bad6f4 commit 54accc5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions HARK/tests/test_approxDstns.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ def setUp(self):

def test_means(self):

mu_2D = distribution.calcExpectation(self.dist2D_approx)
mu_2D = distribution.calc_expectation(self.dist2D_approx)
self.assertTrue(np.allclose(mu_2D, self.mu2, rtol=1e-5))

mu_3D = distribution.calcExpectation(self.dist3D_approx)
mu_3D = distribution.calc_expectation(self.dist3D_approx)
self.assertTrue(np.allclose(mu_3D, self.mu3, rtol=1e-5))

def test_VCOV(self):

vcov_fun = lambda X, mu: np.outer(X - mu, X - mu)

Sig_2D = distribution.calcExpectation(self.dist2D_approx, vcov_fun, self.mu2)[
Sig_2D = distribution.calc_expectation(self.dist2D_approx, vcov_fun, self.mu2)[
:, :, 0
]
self.assertTrue(np.allclose(Sig_2D, self.Sigma2, rtol=1e-5))

Sig_3D = distribution.calcExpectation(self.dist3D_approx, vcov_fun, self.mu3)[
Sig_3D = distribution.calc_expectation(self.dist3D_approx, vcov_fun, self.mu3)[
:, :, 0
]
self.assertTrue(np.allclose(Sig_3D, self.Sigma3, rtol=1e-5))

0 comments on commit 54accc5

Please sign in to comment.