I have hourly snapshot of an event starting from 2012-05-15-0700 to 2013-05-17-1800. How can I create a Timeseries on this data and perform HoltWinters to it?
I tried the following
EventData<-ts(Eventmatrix$X20030,start=c(2012,5,15),frequency=8000)
HoltWinters(EventData)
But I got Error in decompose(ts(x[1L:wind], start = start(x), frequency = f), seasonal) : time series has no or less than 2 periods
What value should I put from Frequency?
xts
as suggested by @dickoa, you can also use themsts
function/object from theforecast
package, with the added benefit, that it allows you to specify multiple seasons/cycles. The package also includes a functionhw
which is convenient wrapper function forforecast(ets(...))
. – bonna