Skip to content

Commit

Permalink
more 3d.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkofod committed Jan 17, 2019
1 parent 3f73ba4 commit 6271c50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions HARK/tests/test_discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def setUp(self):
self.Pref2D = np.array([[0.0, 0.0, 0.0], [1.0, 1.0, 1.0]])

self.Vs3D = np.array([[0.0, 1.0, 4.0], [1.0, 2.0, 0.0], [3.0, 0.0, 2.0]])
self.Vref3DFirst = 3.0+np.log((np.exp(0.0-3.0)+np.exp(1.0-3.0)+np.exp(3.0-3.0)))
maxV = self.Vs3D.max()
self.Vref3D = maxV + np.log(sum(np.exp(self.Vs3D-maxV),axis=0))
self.Pref3D = np.log(sum(np.exp(self.Vs3D-maxV),axis=0))

def test_noShock2DBoth(self):
# Test the value functions and policies of the 2D case
Expand All @@ -32,4 +34,4 @@ def test_noShock2DIndividual(self):
sigma = 0.0
V = interpolation.discreteLogSum(self.Vs3D, sigma)
P = interpolation.discreteProb(self.Vs3D, sigma)
self.assertTrue(V[0], self.Vref3DFirst)
self.assertTrue(V, self.Vref3D)

0 comments on commit 6271c50

Please sign in to comment.