[R] problem with HoltWinters

David Meyer david.meyer at ci.tuwien.ac.at
Wed Sep 3 18:54:20 CEST 2003


HoltWinters() by default fits a seasonal model, and therefore needs 
three complete cycles for the starting values. But your third cycle is 
incomplete, so in short, you haven't got enough data to fit a seasonal 
model, unless you provide all starting values using l.start, b.start, 
and s.start. I will change the code to give a better error message in 
such cases.

Best,
David.

On 2003.09.03 18:32, Luis Miguel Almeida da Silva wrote:
> The data goes in attachment. I used ts to create data.ts
> 
> data.ts<-ts(data=data,start=c(2001,1),frequency=12)
> 
> 
> 	-----Original Message-----
> 	From: David Meyer [mailto:david.meyer at ci.tuwien.ac.at]
> 	Sent: Wed 03/09/2003 17:21
> 	To: Luis Miguel Almeida da Silva
> 	Cc: r-help at stat.math.ethz.ch
> 	Subject: Re: [R] problem with HoltWinters
> 	 
> 	 
> 
> 	How did you construct `data.ts'? Can you send me the file?
> 	 
> 	best,
> 	David
> 	 
> 	On 2003.09.03 15:57, Luis Miguel Almeida da Silva wrote:
> 	> Dear helpers
> 	>
> 	> I'm having a problem with function HoltWinters from package
> ts. I have
> 	> a time series that I want to fit an Holt-Winters model and
> make
> 	> predictions for the next values. I've already built an
> object of class
> 	> ts to serve as input to HoltWinters. But then I get an
> error; I've
> 	> used HoltWinters a lot of times and this never hapened
> 	>
> 	> > data.HW<-HoltWinters(data.ts)
> 	> Error in model.frame(formula, rownames, variables, varnames,
> extras,
> 	> extranames,  :
> 	>         variable lengths differ
> 	>
> 	> This is the data
> 	>
> 	> > data.ts
> 	>          Jan     Feb     Mar     Apr     May     Jun     Jul
>     Aug
> 	>   Sep
> 	> 2001 1117001 1017287 1195142 1049729 1409147 1267002 1579907
> 1563127
> 	> 1195597
> 	> 2002 1228333 1062520 1080117 1171998 1383951 1141008 1604061
> 1446024
> 	> 1276017
> 	> 2003 1068221 1045052 1164273 1091765 1272330 1305676
> 	>
> 	>          Oct     Nov     Dec
> 	> 2001 1290688 1104137 1027022
> 	> 2002 1262232 1048522 1174157
> 	> 2003
> 	>
> 	> Do you know what is happening?
> 	>
> 	> Thank you
> 	> Luis
> 	>
> 	> ______________________________________________
> 	> R-help at stat.math.ethz.ch mailing list
> 	> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 	>
> 	>
> 	 
> 
> 
> 1117001
> 1017287
> 1195142
> 1049729
> 1409147
> 1267002
> 1579907
> 1563127
> 1195597
> 1290688
> 1104137
> 1027022
> 1228333
> 1062520
> 1080117
> 1171998
> 1383951
> 1141008
> 1604061
> 1446024
> 1276017
> 1262232
> 1048522
> 1174157
> 1068221
> 1045052
> 1164273
> 1091765
> 1272330
> 1305676
>




More information about the R-help mailing list