QuantEcon.jl
QuantEcon.jl copied to clipboard
Feature request: standard econ filters/smoothers
I don't think there are any packages in Julia that implement nice versions of the standard filters used in econ, like the HP filter. See, e.g., time series filters here:
http://statsmodels.sourceforge.net/stable/tsa.html#time-series-filters
This is another important filter, for seasonal adjustment:
https://www.census.gov/srd/www/x13as/x13down_unix.html
In Python and R there are wrappers:
https://github.com/christophsax/seasonal http://statsmodels.sourceforge.net/devel/_modules/statsmodels/tsa/x13.html
but not Julia, as far as I know.
Sébastian Villemot @sebastien-villemot wrote command to implement the hpfilter would likely be easy enough to just use his as base for the package. He likes free software so I imagine he would be happy enough for you to use it. http://www.econforge.org/posts/2014/juil./28/cef2014-julia/
Sure, feel free to reuse that code under a BSD or GPL license.
@sebastien-villemot Many thanks.
Anyone interested in this project please let me know.
I will work on some of the time series filters from statsmodels.
Sounds great.
Make sure to check the license on stats models before looking at their code.
Statsmodels seems to be licensed under Modified BSD (3-clause)
How about the seasonality filter with X-13ARIMA, did that suggestion go places, or does it exist in another package?
I am interested in the project. As this issue is still marked open, is anyone working on it?
@Shunsuke-Hori , you did some work with filters didn't you?
@jstac @andi3141 Yes
- HP filter: https://github.com/QuantEcon/QuantEcon.jl/blob/master/src/filter.jl#L12
- Hamilton filter: https://github.com/QuantEcon/QuantEcon.jl/blob/master/src/filter.jl#L44
- Kalman smoother: https://github.com/QuantEcon/QuantEcon.jl/blob/master/src/kalman.jl#L186
- Not mine, but there is a PR for Kalman filter in #235
- two more PRs (to be merged, I think): BK filter (#223) and regime-switching (#250)
@andi3141 , would you be willing to look at the existing filters in the library, linked to above, and then review those open PRs?
That might be a good way to get started.
@sglyon How does this sound to you? (Some of those PRs have already had input and could be ready to merge without further review.)
@jstac sure, no problem. Happy to help
Thanks @jstac that sounds good to me.
@andi3141 please take a look at the pull requests and leave a comment when you've finished reviewing. Then we can work towards getting them merged.
So I had a look at the HP, Hamilton, and BK filter, which all seem fine. I am currently looking at the Kalman filter. In the pull request 235, an example file kalman_tracking_2d_example.jl is added to the example folder. What is the purpose of these example files? Are those files supposed to run without any packages added prior? There is only one other example file in the library so far, so it is hard for me to judge.
@andi3141
Are those files supposed to run without any packages added prior?
I guess so, though I'm not the person who added them. Example codes are typically used to illustrate practical usage of a package. I don't think it's strictly necessary in this repository, but it won't hurt to have it (as long as it works).
If you could check the example file as well and leave a comment on #235, that would be great.