srlanalytics / bdfm

Bayesian dynamic factor model estimation and predictive statistics including nowcasting and forecasting
MIT License
5 stars 6 forks source link

Any frequency example for Bayesian method #81

Open christophsax opened 5 years ago

christophsax commented 5 years ago

From issue #79

The Bayesian method should cover any frequency mix: monthly-quarterly, hours-half hours, even minutes-seconds, though with that many lags (60) it would probably be slow. The one caveat is that the package does not handle irregular frequencies properly. When given mixed frequency data, the package looks for patterns of missing observations, and interprets regular patterns as mixed frequency data. A frequency argument of 1 means the series is observed every period. A frequency argument of 2 means the series is observed every other period. 3 is every third period, and so on. With monthly data, more months have 31 days than anything else, so if the data mix is monthly-daily the package sets the frequency of monthly data to 31. This means we will be using too many days in months like September with 30 days --- observations for September would actually use factors for September as well as the last day of August. Not ideal, but much simpler than trying to change the frequency mix at every period.

I'll work on putting together an example with monthly-daily data.

christophsax commented 5 years ago

That's great, and should be better advertised.

We use weekly unemployment claims in econ_us. I always felt it was a bit like cheating that we aggregate it to monthly first. So we actually could include it as weekly data, along with the monthly and quarterly? Thant would be also a nice example, and perhaps less computationally intensive?

There would be the issue of seasonal adjustment, but I guess we can quickly do it with stl.