Bug 14694 - Exorbitant predictions returned for HoltWinters smoothing between 32-bit and 64-bit
Exorbitant predictions returned for HoltWinters smoothing between 32-bit and ...
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Accuracy
R 2.13.1 patched
x86_64/x64/amd64 (64-bit) Windows 64-bit
: P5 minor
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-03 19:30 UTC by Robinson
Modified: 2011-10-04 22:39 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robinson 2011-10-03 19:30:41 UTC
For these commands:

historical<-c(0.0148571,0.0120000,0.0120000,0.0125714,0.0157651,0.0111938,0.0056883,0.0107136,0.0101830,0.0085888,0.0135016,0.0106980,0.0096878,0.0204521,0.0161464,0.0075350,0.0134553,0.0113025,0.0118407,0.0096878,0.0150700,0.0080376,0.0133854,0.0019723,0.0273722,0.0196168,0.0260037)
library('stats')
historical <- ts(historical, frequency = 12)
fit <- HoltWinters(historical,seasonal='additive')
p <- predict(fit, 9 , prediction.interval=TRUE, level=0.95)
p

32-bit R 2.13.2 result:
                fit           upr           lwr
Apr 3 -9.971969e+19 -9.860034e+19 -1.008390e+20
May 3 -1.958241e+20 -1.430595e+20 -2.485887e+20
Jun 3 -2.919285e+20 -1.765973e+20 -4.072596e+20
Jul 3 -3.880328e+20 -1.969492e+20 -5.791165e+20
Aug 3 -4.841372e+20 -2.059658e+20 -7.623086e+20
Sep 3 -5.802416e+20 -2.049276e+20 -9.555556e+20
Oct 3 -6.763460e+20 -1.947684e+20 -1.157924e+21
Nov 3 -7.724504e+20 -1.762050e+20 -1.368696e+21
Dec 3 -8.685550e+20 -1.498092e+20 -1.587301e+21

64-bit R 2.13.2 result:
              fit        upr           lwr
Apr 3 0.009852806 0.02143719 -0.0017315747
May 3 0.016073941 0.02766756  0.0044803253
Jun 3 0.014227229 0.02584160  0.0026128612
Jul 3 0.014968370 0.02661954  0.0033172010
Aug 3 0.013061644 0.02477008  0.0013532041
Sep 3 0.018606678 0.03039710  0.0068162570
Oct 3 0.011769283 0.02367038 -0.0001318162
Nov 3 0.017344910 0.02938904  0.0053007833
Dec 3 0.006368770 0.01859152 -0.0058539759

This is running R 2.13.2 on Windows 7 64-bit.
Comment 1 Brian Ripley 2011-10-04 16:51:17 UTC
Take a look at 'fit'.
The return value from the optimization was not checked, and parameters
had jumped out of their bounds.
Comment 2 Robinson 2011-10-04 18:33:56 UTC
I do see that the parameters are out of their bounds in 32-bit version. In 64-bit version the parameters stay within the bounds and good forecast values are produced.

If I was checking the return values in the 64-bit version I'd never know that there was a problem?
Comment 3 Brian Ripley 2011-10-04 22:39:44 UTC
On Tue, 4 Oct 2011, r-bugs@r-project.org wrote:

> https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14694
>
> --- Comment #2 from Robinson <RSathaseevan@morneaushepell.com> 2011-10-04 13:33:56 EDT ---
> I do see that the parameters are out of their bounds in 32-bit version. In
> 64-bit version the parameters stay within the bounds and good forecast values
> are produced.
>
> If I was checking the return values in the 64-bit version I'd never know that
> there was a problem?


There was not a problem, was there?

The problem is numerical instability of the 32-bit Windows runtime 
(and lack of understanding of numerical optimization by the reporter).

>
> -- 
> Configure bugmail: https://bugs.r-project.org/bugzilla3/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are the assignee for the bug.
>
> _______________________________________________
> R-core list: https://stat.ethz.ch/mailman/listinfo/r-core
>


-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595