[R] ts startdate
Gregor Gawron
gregor.gawron at rmf.ch
Fri Dec 6 15:40:03 CET 2002
Dear R-users,
I am facing a trivial problem when trying to parameterise the start date
of a time series object. I am working with monthly data (104) performing
n-steps-ahead (6) forecasts and using a fixed window size (36). At the
end of calculations I have a list that contains 69 forecasts.
I have no problems in fixing the window size by parametrization, e.g.
k<- control variable in a for loop
my.length<-36
past<-window(X,start=c(1980,k - my.length + 1),end=c(1980,k))
The integer defining the month number can be arbitrary set to: 6,16,46
etc and it always works. This, however, does not work when I try to
parameterise the start date of the result list
my.forecasts<-unlist(my.result.list)
my.forecast.results<-ts(my.forecasts,start=c(1980,my.length+6),frequency
=12)
The message I recive is:
Error in ts(my.frecasts, start = c(1980, my.length + 6), frequency = 12)
:
invalid start
It seems that it works only for month integer up to 12. Does someone
know how to overcome this problem?
Many thanks in advance.
I am using R 1.5.1 on Windows 2000
---
Gregor Gawron
More information about the R-help
mailing list