[Rd] HoltWinters fitted level parameter not bounded between 0 and 1 (PR#11469)

john.bodley at gmail.com john.bodley at gmail.com
Fri May 16 02:45:04 CEST 2008


Full_Name: John Bodley
Version: 2.5.1 (2007-06-27)
OS: Windows XP
Submission from: (NULL) (12.144.182.66)


I was fitting a number of time series in R using the stats::HoltWinters method
to define a single exponential smoothing model, i.e., beta = gamma = 0. 

I came across an example where the fitted value of alpha was not defined in the
[0, 1] interval which seems to violate the lower and upper bound constraints
used for the optim method. On my computer the following code returns a value of
48.87989.

R code:

x <- c(
0,
0.000843170320404722,
0,
0,
0,
0.0103773584905660,
0.00832466181061394,
0.0038560411311054,
0,
0,
0.00484966052376334,
0,
0,
0,
0.00274348422496571,
0,
0,
0,
0,
0,
0.0207064555420219,
0.0334975369458128,
0.0334975369458128,
0.00338983050847458,
0.00483675937122128,
0,
0,
0.00224971878515186,
0,
0,
0,
0.00135685210312076,
0,
0,
0,
0.0035377358490566,
0.0035377358490566,
0.00501002004008016,
0.0107632093933464,
0,
0,
0.0143329658213892,
0.0330459770114943,
0,
0,
0,
0,
0.0109890109890110,
0,
0.00118623962040332,
0.007380073800738,
0.00695410292072323,
0.0104895104895105,
0.00278551532033426,
0.00278551532033426
);

# Single exponential smoothing
m <- stats::HoltWinters(x, beta = 0, gamma = 0);
m$alpha



More information about the R-devel mailing list