QuantEcon.py icon indicating copy to clipboard operation
QuantEcon.py copied to clipboard

update discrete rv code

Open jstac opened this issue 7 years ago • 2 comments

Now that #397 is merged, I propose that we remove the DiscreteRV class

https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/discrete_rv.py

Not a good idea to have two sets of code for doing the same thing.

The lectures will all need to be updated accordingly, but this is a good thing, since it encourages our transition to exploiting jit compilation more thoroughly.

CC @oyamad @mmcky

jstac avatar Mar 12 '18 19:03 jstac

My only concern is seeding of the random number generator.

One has to set a seed within a jit function, so

np.random.seed(0)
qe.random.draw(cdf, 10)

does not work.

I am fine with removing DiscreteRV (I never used it in my code), but just pointing out these are not exactly the same; one is for general use and the other for use within a jit function.

oyamad avatar Mar 13 '18 01:03 oyamad

@oyamad I've looked through the lectures and that won't be an issue.

@mmcky If you agree with deleting then let's coordinate with the changes in the lectures. I'll open a suitable issue there.

jstac avatar Mar 13 '18 05:03 jstac