christophsax / tempdisagg

Methods for Temporal Disaggregation and Interpolation of Time Series
http://cran.r-project.org/web/packages/tempdisagg
36 stars 5 forks source link

How can I use the `td` command from the `tempdisagg` package to disaggregate monthly data into daily data frequency? #41

Closed erickwy closed 4 years ago

erickwy commented 4 years ago

I have a monthly frequency data which I am trying to disaggregate into a daily frequency data. So I use the td command from the tempdisagg package in R using the code below:

 dat=ts(data[,2])
 result=td(dat~1, conversion = "average", to = "day", method = "chow-lin-maxlog")

Then I get the following error message:

 Error in td(dat ~ 1, conversion = "average", to = "day", method = "chow-lin-maxlog") : 'to' argument: unknown character string

The data I use for dat is as follows:

enter image description here

 > dput(head(dat))
 c(82.47703009, 84.63094431, 70.00659987, 78.81135651, 74.749746,82.95638213)

So although this data dat is in monthly frequency, the start and end do not reflect this yet. In fact, the start date is 1/1997 and end date is 9/2019.

May I get help on disaggregating this monthly data dat into daily frequency data please?

christophsax commented 4 years ago

Do you use the CRAN version or the dev version? Daily disaggregation is only possible on dev, but a CRAN update is planned in the next few days.

erickwy commented 4 years ago

I use your package following this URL: http://journal.r-project.org/archive/2013-2/sax-steiner.pdf

erickwy commented 4 years ago

It is Repository CRAN Date/Publication 2016-07-10 11:00:16

erickwy commented 4 years ago

May I kindly ask how I can access the dev version? Also, how shall I know when CRAN version comes out please?

christophsax commented 4 years ago

Disaggregation to daily is only possible with the development version. For how to install, see the README.

The last example in ?td converts annual data to daily. Check that out.

erickwy commented 4 years ago

Thank you. Looking forward to seeing the CRAN version as well.

christophsax commented 4 years ago

It's now on CRAN. Blogged here on daily disaggregation:

https://www.cynkra.com/2020/02/09/tempdisagg/index.html