QuantEcon / lecture-source-py

Source files for "Lectures in Quantitative Economics" -- Python version
BSD 3-Clause "New" or "Revised" License
192 stars 77 forks source link

Arellano code rewrite #935

Closed cc7768 closed 4 years ago

cc7768 commented 4 years ago

@jstac @mmcky

The code has been rewritten to better reflect the updated numba styles that QE has been encouraging.

I went ahead and added the exercises as well. It would be helpful if someone worked through and double checked that the code works etc...

Cheers.

jstac commented 4 years ago

Thanks @cc7768 !

I haven't checked carefully yet but it looks very nice.

Did you see #849? Does this PR address it?

cc7768 commented 4 years ago

@jstac Yes -- This addresses #849 and I also found a bug in the simulation code (we weren't imposing the output restrictions associated with being in default)

jstac commented 4 years ago

fixes #849

jstac commented 4 years ago

Hi @cc7768, two small things.

One is that, if you look at the method bellman_default, the variable nB is used but never allocated. So something isn't quite right there.

I see it appearing as a global variable below...

Second, the final code block fails for me, with message

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-13-824b44fede2f> in <module>
----> 1 xx, yy = ae.Bgrid, ae.ygrid
      2 zz = ae.default_prob
      3 
      4 # Create figure
      5 fig, ax = plt.subplots(figsize=(10, 6.5))

AttributeError: 'Arellano_Economy' object has no attribute 'Bgrid'
mmcky commented 4 years ago

hey @jstac this is now checked against anaconda=2019.10 (latest) and showing pass for the files.

jstac commented 4 years ago

Thanks @cc7768, great job. So happy to have this in the new style. It's been one of the most popular lectures.