[R] Holt-Winters code in R or S?

John Aitchison jaitchis at lisp.com.au
Tue Feb 20 13:04:05 CET 2001

On 19 Feb 2001, at 16:31, M. Edward (Ed) Borasky wrote:

> Can someone point me to R (or S) code for Holt-Winters forecasting?

dunno if there is any specifically as such, and a lot of the ad-hoc 
forecasting procedures can be implemented as special cases of  AR/MA
approaches which are variously implemented in ts, tseries, dse etc .. but 
fwiw I just implemented ewma as a programming exercise and will do 
discounted least squares/Holt Winters  in the next day or so .. I am 
following the notation and procedure of Harvey "Forecasting, structural 
time series models and the Kalman filter".. anyone who wants this code, 
rudimentary as it is,,just email me.

I have an interest in the "BATS" approach (Bayesian Analysis of Time 
Series.. as in Harrison, West, Pole ) and somewhere I have some skeleton S 
code that I think I could probably port to R

I am also working through "Non-linear time series models in empirical 
finance" (Franses & van Dijk) and slowly implementing some bits and pieces 
.. I'd be glad to contribute these as and when.

I think this raises the issue , attention BR and the core development 
team, as to whether there is a role for a repository of "slop code" .. use 
at your own risk, probably not a lot of documentation,  not a full fledged 
package, perhaps slightly "disreputable", a sort of relaxed and 
comfortable approach and hey, why not?... if there is no right answer to 
an ill-specified question, then maybe it is sensible to admit some other 

For example, I have followed with interest the process of admitting 
factanal() into the fold. got varimax and promax rotations and caveats 
galore, as there should be. Personally,  I have always liked procedures 
along the lines of the 'iterative powered vector factor analysis'   
approach in Overall and Klett ~1972 and would be happy to implement such 
.. without having done it in R , I suspect that it is just a few tens of 
lines of code.

So, is there a role for //RLIB ?.. just R code, not interfaces to DLL's .. 
where people can easily upload simple R functions that can be used 
caveat emptor. 


John Aitchison
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list