Conversation
|
Hello @QBatista! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2020-04-19 07:54:49 UTC |
|
Thanks @QBatista. This is looking good --- I like the class design. I'm in favor of pulling out the plotting code and embedding it in the lectures, even if this means we end up with similar plotting code in a few different lectures. |
|
@QBatista is this still be worked on? Can we close this PR? |
|
@mmcky Tom would like to move forward with this to (i) support his book with LPH and (ii) support some QuantEcon lectures such as https://python-advanced.quantecon.org/additive_functionals.html#Simulation that currently define an |
91e57a9 to
b2614b3
Compare
|
@mmcky This is ready for review. It contains basic features for supporting the additive and multiplicative functionals lecture. Once the PR is merged and a new version of |
|
Well written and tested. I think this is niche but still valuable. Would it be OK if we ping you in the future if we get PRs on this @QBatista ? I double there will be many. |
|
@jstac Yes, of course. |
|
One minor comment on class naming: According to PEP8:
See also #489 (comment). |
|
@oyamad Thank you for pointing this out! I kept the original name from the class in the lecture because |
|
+1 for following PEP8. I suspect the corresponding lectures would need to be edited though, since they use the existing class name. |
|
Closing this PR as |
Adds an
AMF_LSS_VARclass to support the lectures on additive and multiplicative functionals.Class design
I've deconstructed
construct_ssfrom the class in the lecture into 6 functions for two reasons: (i) to be able to test the construction of each matrix separately and (ii) to satisfy the single responsibility principle.The functions
additive_decompandmultiplicative_decompwere recomputing the additive and multiplicative decomposition every time they were called. I've made them attributes of the class that are computed only once (when the class is initialized).I haven't added setter methods for the attributes because ensuring that new values are valid inputs and updating the related variables is delicate.
I agree with @oyamad that the plotting code should be separated from the class because the purpose of the class is to use the first-order VAR representation of an additive functional to build the LSS representation. Adding visualization methods would give another distinct responsibility to the class. That being said, there are different options for testing the plotting code if you want to include it in the class. One option is to write an image comparison test. Another option is to run numerical tests against the data returned by the plotting functions.
TODO
Add
loglikelihood_pathAdd helper function to compute first order stacked VAR representation from pth order representation
Add helper function to apply the Blanchard and Quah method