Skip to content

Commit

Permalink
Merge pull request #715 from edmundcrawley/master
Browse files Browse the repository at this point in the history
Bug fix to drawDiscrete
  • Loading branch information
sbenthall authored Jun 17, 2020
2 parents a55d06f + 3f69148 commit d93e80c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion HARK/ConsumptionSaving/tests/test_ConsAggShockModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ def test_economy(self):

self.economy.AFunc = self.economy.dynamics.AFunc
self.assertAlmostEqual(self.economy.AFunc[0].slope,
1.0921217053006234)
1.0845554708377696)

6 changes: 3 additions & 3 deletions HARK/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,9 @@ def drawDiscrete(self, N,X=None,exact_match=False,seed=0):
bot = top
top = cutoffs[j]
event_list += (top-bot)*[events[j]]
# Randomly permute the event indices and store the corresponding results
event_draws = RNG.permutation(event_list)
draws = X[event_draws]
# Randomly permute the event indices and store the corresponding results
event_draws = RNG.permutation(event_list)
draws = X[event_draws]
else:
indices = self.draw_events(N, seed=seed)
if J > 1:
Expand Down

0 comments on commit d93e80c

Please sign in to comment.