Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 24 Dec 2010 10:40:24 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/24/t1293187085fiekg1ytu0tl9za.htm/, Retrieved Tue, 30 Apr 2024 05:59:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=114725, Retrieved Tue, 30 Apr 2024 05:59:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact115
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2008-12-08 19:22:39] [d2d412c7f4d35ffbf5ee5ee89db327d4]
- RMP   [ARIMA Forecasting] [] [2010-12-14 14:23:29] [abe7df3fc544bbb0ed435b4e9982bc91]
-   PD      [ARIMA Forecasting] [] [2010-12-24 10:40:24] [29eeba0e6ce2cd83aa315a4a7ff8c4aa] [Current]
Feedback Forum

Post a new message
Dataseries X:
377
370
358
357
349
348
369
381
368
361
351
351
358
354
347
345
343
340
362
370
373
371
354
357
363
364
363
358
357
357
380
378
376
380
379
384
392
394
392
396
392
396
419
421
420
418
410
418
426
428
430
424
423
427
441
449
452
462
455
461
461
463
462
456
455
456
472
472
471
465
459
465
468
467
463
460
462
461
476
476
471
453
443
442
444
438
427
424
416
406
431
434
418
412
404
409
412
406
398
397
385
390
413
413
401
397
397
409
419
424
428
430
424
433
456
459
446
441
439
454
460
457
451
444
437
443
471
469
454
444
436




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 2 seconds \tabularnewline
R Server & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114725&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114725&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114725&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk







Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[119])
107397-------
108409-------
109419-------
110424-------
111428-------
112430-------
113424-------
114433-------
115456-------
116459-------
117446-------
118441-------
119439-------
120454447.4579437.3129457.6030.10310.948910.9489
121460454.6415439.3176469.96540.24660.532710.9773
122457455.6726435.7441475.60110.44810.33520.99910.9495
123451454.3856430.0777478.69350.39240.41650.98330.8926
124444454.8247426.2489483.40050.22890.60350.95570.8611
125437449.6399416.8607482.4190.22490.6320.93740.7377
126443453.9395417.0001490.87880.28080.81560.86670.786
127471476.7377435.6718517.80360.39210.94630.83890.9642
128469479.7484434.5856524.91130.32040.64790.81610.9615
129454470.0784420.8473519.30960.2610.51710.83110.892
130444465.5122412.2418518.78260.21430.66410.81640.8353
131436462.3534405.0741519.63270.18360.7350.78790.7879

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast \tabularnewline
time & Y[t] & F[t] & 95% LB & 95% UB & p-value(H0: Y[t] = F[t]) & P(F[t]>Y[t-1]) & P(F[t]>Y[t-s]) & P(F[t]>Y[119]) \tabularnewline
107 & 397 & - & - & - & - & - & - & - \tabularnewline
108 & 409 & - & - & - & - & - & - & - \tabularnewline
109 & 419 & - & - & - & - & - & - & - \tabularnewline
110 & 424 & - & - & - & - & - & - & - \tabularnewline
111 & 428 & - & - & - & - & - & - & - \tabularnewline
112 & 430 & - & - & - & - & - & - & - \tabularnewline
113 & 424 & - & - & - & - & - & - & - \tabularnewline
114 & 433 & - & - & - & - & - & - & - \tabularnewline
115 & 456 & - & - & - & - & - & - & - \tabularnewline
116 & 459 & - & - & - & - & - & - & - \tabularnewline
117 & 446 & - & - & - & - & - & - & - \tabularnewline
118 & 441 & - & - & - & - & - & - & - \tabularnewline
119 & 439 & - & - & - & - & - & - & - \tabularnewline
120 & 454 & 447.4579 & 437.3129 & 457.603 & 0.1031 & 0.9489 & 1 & 0.9489 \tabularnewline
121 & 460 & 454.6415 & 439.3176 & 469.9654 & 0.2466 & 0.5327 & 1 & 0.9773 \tabularnewline
122 & 457 & 455.6726 & 435.7441 & 475.6011 & 0.4481 & 0.3352 & 0.9991 & 0.9495 \tabularnewline
123 & 451 & 454.3856 & 430.0777 & 478.6935 & 0.3924 & 0.4165 & 0.9833 & 0.8926 \tabularnewline
124 & 444 & 454.8247 & 426.2489 & 483.4005 & 0.2289 & 0.6035 & 0.9557 & 0.8611 \tabularnewline
125 & 437 & 449.6399 & 416.8607 & 482.419 & 0.2249 & 0.632 & 0.9374 & 0.7377 \tabularnewline
126 & 443 & 453.9395 & 417.0001 & 490.8788 & 0.2808 & 0.8156 & 0.8667 & 0.786 \tabularnewline
127 & 471 & 476.7377 & 435.6718 & 517.8036 & 0.3921 & 0.9463 & 0.8389 & 0.9642 \tabularnewline
128 & 469 & 479.7484 & 434.5856 & 524.9113 & 0.3204 & 0.6479 & 0.8161 & 0.9615 \tabularnewline
129 & 454 & 470.0784 & 420.8473 & 519.3096 & 0.261 & 0.5171 & 0.8311 & 0.892 \tabularnewline
130 & 444 & 465.5122 & 412.2418 & 518.7826 & 0.2143 & 0.6641 & 0.8164 & 0.8353 \tabularnewline
131 & 436 & 462.3534 & 405.0741 & 519.6327 & 0.1836 & 0.735 & 0.7879 & 0.7879 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114725&T=1

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast[/C][/ROW]
[ROW][C]time[/C][C]Y[t][/C][C]F[t][/C][C]95% LB[/C][C]95% UB[/C][C]p-value(H0: Y[t] = F[t])[/C][C]P(F[t]>Y[t-1])[/C][C]P(F[t]>Y[t-s])[/C][C]P(F[t]>Y[119])[/C][/ROW]
[ROW][C]107[/C][C]397[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]409[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]419[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]424[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]428[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]430[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]424[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]433[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]456[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]459[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]446[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]441[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]439[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]454[/C][C]447.4579[/C][C]437.3129[/C][C]457.603[/C][C]0.1031[/C][C]0.9489[/C][C]1[/C][C]0.9489[/C][/ROW]
[ROW][C]121[/C][C]460[/C][C]454.6415[/C][C]439.3176[/C][C]469.9654[/C][C]0.2466[/C][C]0.5327[/C][C]1[/C][C]0.9773[/C][/ROW]
[ROW][C]122[/C][C]457[/C][C]455.6726[/C][C]435.7441[/C][C]475.6011[/C][C]0.4481[/C][C]0.3352[/C][C]0.9991[/C][C]0.9495[/C][/ROW]
[ROW][C]123[/C][C]451[/C][C]454.3856[/C][C]430.0777[/C][C]478.6935[/C][C]0.3924[/C][C]0.4165[/C][C]0.9833[/C][C]0.8926[/C][/ROW]
[ROW][C]124[/C][C]444[/C][C]454.8247[/C][C]426.2489[/C][C]483.4005[/C][C]0.2289[/C][C]0.6035[/C][C]0.9557[/C][C]0.8611[/C][/ROW]
[ROW][C]125[/C][C]437[/C][C]449.6399[/C][C]416.8607[/C][C]482.419[/C][C]0.2249[/C][C]0.632[/C][C]0.9374[/C][C]0.7377[/C][/ROW]
[ROW][C]126[/C][C]443[/C][C]453.9395[/C][C]417.0001[/C][C]490.8788[/C][C]0.2808[/C][C]0.8156[/C][C]0.8667[/C][C]0.786[/C][/ROW]
[ROW][C]127[/C][C]471[/C][C]476.7377[/C][C]435.6718[/C][C]517.8036[/C][C]0.3921[/C][C]0.9463[/C][C]0.8389[/C][C]0.9642[/C][/ROW]
[ROW][C]128[/C][C]469[/C][C]479.7484[/C][C]434.5856[/C][C]524.9113[/C][C]0.3204[/C][C]0.6479[/C][C]0.8161[/C][C]0.9615[/C][/ROW]
[ROW][C]129[/C][C]454[/C][C]470.0784[/C][C]420.8473[/C][C]519.3096[/C][C]0.261[/C][C]0.5171[/C][C]0.8311[/C][C]0.892[/C][/ROW]
[ROW][C]130[/C][C]444[/C][C]465.5122[/C][C]412.2418[/C][C]518.7826[/C][C]0.2143[/C][C]0.6641[/C][C]0.8164[/C][C]0.8353[/C][/ROW]
[ROW][C]131[/C][C]436[/C][C]462.3534[/C][C]405.0741[/C][C]519.6327[/C][C]0.1836[/C][C]0.735[/C][C]0.7879[/C][C]0.7879[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114725&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114725&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[119])
107397-------
108409-------
109419-------
110424-------
111428-------
112430-------
113424-------
114433-------
115456-------
116459-------
117446-------
118441-------
119439-------
120454447.4579437.3129457.6030.10310.948910.9489
121460454.6415439.3176469.96540.24660.532710.9773
122457455.6726435.7441475.60110.44810.33520.99910.9495
123451454.3856430.0777478.69350.39240.41650.98330.8926
124444454.8247426.2489483.40050.22890.60350.95570.8611
125437449.6399416.8607482.4190.22490.6320.93740.7377
126443453.9395417.0001490.87880.28080.81560.86670.786
127471476.7377435.6718517.80360.39210.94630.83890.9642
128469479.7484434.5856524.91130.32040.64790.81610.9615
129454470.0784420.8473519.30960.2610.51710.83110.892
130444465.5122412.2418518.78260.21430.66410.81640.8353
131436462.3534405.0741519.63270.18360.7350.78790.7879







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1200.01160.0146042.798400
1210.01720.01180.013228.713835.75615.9796
1220.02230.00290.00981.762124.42484.9421
1230.0273-0.00750.009211.462221.18414.6026
1240.0321-0.02380.0121117.174340.38226.3547
1250.0372-0.02810.0148159.766360.27957.764
1260.0415-0.02410.0161119.671768.76418.2924
1270.0439-0.0120.015632.921664.28388.0177
1280.048-0.02240.0164115.528969.97778.3653
1290.0534-0.03420.0181258.515788.83159.425
1300.0584-0.04620.0207462.7753122.826411.0827
1310.0632-0.0570.0237694.5036170.466213.0563

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
120 & 0.0116 & 0.0146 & 0 & 42.7984 & 0 & 0 \tabularnewline
121 & 0.0172 & 0.0118 & 0.0132 & 28.7138 & 35.7561 & 5.9796 \tabularnewline
122 & 0.0223 & 0.0029 & 0.0098 & 1.7621 & 24.4248 & 4.9421 \tabularnewline
123 & 0.0273 & -0.0075 & 0.0092 & 11.4622 & 21.1841 & 4.6026 \tabularnewline
124 & 0.0321 & -0.0238 & 0.0121 & 117.1743 & 40.3822 & 6.3547 \tabularnewline
125 & 0.0372 & -0.0281 & 0.0148 & 159.7663 & 60.2795 & 7.764 \tabularnewline
126 & 0.0415 & -0.0241 & 0.0161 & 119.6717 & 68.7641 & 8.2924 \tabularnewline
127 & 0.0439 & -0.012 & 0.0156 & 32.9216 & 64.2838 & 8.0177 \tabularnewline
128 & 0.048 & -0.0224 & 0.0164 & 115.5289 & 69.9777 & 8.3653 \tabularnewline
129 & 0.0534 & -0.0342 & 0.0181 & 258.5157 & 88.8315 & 9.425 \tabularnewline
130 & 0.0584 & -0.0462 & 0.0207 & 462.7753 & 122.8264 & 11.0827 \tabularnewline
131 & 0.0632 & -0.057 & 0.0237 & 694.5036 & 170.4662 & 13.0563 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114725&T=2

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast Performance[/C][/ROW]
[ROW][C]time[/C][C]% S.E.[/C][C]PE[/C][C]MAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]120[/C][C]0.0116[/C][C]0.0146[/C][C]0[/C][C]42.7984[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]121[/C][C]0.0172[/C][C]0.0118[/C][C]0.0132[/C][C]28.7138[/C][C]35.7561[/C][C]5.9796[/C][/ROW]
[ROW][C]122[/C][C]0.0223[/C][C]0.0029[/C][C]0.0098[/C][C]1.7621[/C][C]24.4248[/C][C]4.9421[/C][/ROW]
[ROW][C]123[/C][C]0.0273[/C][C]-0.0075[/C][C]0.0092[/C][C]11.4622[/C][C]21.1841[/C][C]4.6026[/C][/ROW]
[ROW][C]124[/C][C]0.0321[/C][C]-0.0238[/C][C]0.0121[/C][C]117.1743[/C][C]40.3822[/C][C]6.3547[/C][/ROW]
[ROW][C]125[/C][C]0.0372[/C][C]-0.0281[/C][C]0.0148[/C][C]159.7663[/C][C]60.2795[/C][C]7.764[/C][/ROW]
[ROW][C]126[/C][C]0.0415[/C][C]-0.0241[/C][C]0.0161[/C][C]119.6717[/C][C]68.7641[/C][C]8.2924[/C][/ROW]
[ROW][C]127[/C][C]0.0439[/C][C]-0.012[/C][C]0.0156[/C][C]32.9216[/C][C]64.2838[/C][C]8.0177[/C][/ROW]
[ROW][C]128[/C][C]0.048[/C][C]-0.0224[/C][C]0.0164[/C][C]115.5289[/C][C]69.9777[/C][C]8.3653[/C][/ROW]
[ROW][C]129[/C][C]0.0534[/C][C]-0.0342[/C][C]0.0181[/C][C]258.5157[/C][C]88.8315[/C][C]9.425[/C][/ROW]
[ROW][C]130[/C][C]0.0584[/C][C]-0.0462[/C][C]0.0207[/C][C]462.7753[/C][C]122.8264[/C][C]11.0827[/C][/ROW]
[ROW][C]131[/C][C]0.0632[/C][C]-0.057[/C][C]0.0237[/C][C]694.5036[/C][C]170.4662[/C][C]13.0563[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114725&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114725&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1200.01160.0146042.798400
1210.01720.01180.013228.713835.75615.9796
1220.02230.00290.00981.762124.42484.9421
1230.0273-0.00750.009211.462221.18414.6026
1240.0321-0.02380.0121117.174340.38226.3547
1250.0372-0.02810.0148159.766360.27957.764
1260.0415-0.02410.0161119.671768.76418.2924
1270.0439-0.0120.015632.921664.28388.0177
1280.048-0.02240.0164115.528969.97778.3653
1290.0534-0.03420.0181258.515788.83159.425
1300.0584-0.04620.0207462.7753122.826411.0827
1310.0632-0.0570.0237694.5036170.466213.0563



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par1 <- as.numeric(par1) #cut off periods
par2 <- as.numeric(par2) #lambda
par3 <- as.numeric(par3) #degree of non-seasonal differencing
par4 <- as.numeric(par4) #degree of seasonal differencing
par5 <- as.numeric(par5) #seasonal period
par6 <- as.numeric(par6) #p
par7 <- as.numeric(par7) #q
par8 <- as.numeric(par8) #P
par9 <- as.numeric(par9) #Q
if (par10 == 'TRUE') par10 <- TRUE
if (par10 == 'FALSE') par10 <- FALSE
if (par2 == 0) x <- log(x)
if (par2 != 0) x <- x^par2
lx <- length(x)
first <- lx - 2*par1
nx <- lx - par1
nx1 <- nx + 1
fx <- lx - nx
if (fx < 1) {
fx <- par5
nx1 <- lx + fx - 1
first <- lx - 2*fx
}
first <- 1
if (fx < 3) fx <- round(lx/10,0)
(arima.out <- arima(x[1:nx], order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5), include.mean=par10, method='ML'))
(forecast <- predict(arima.out,par1))
(lb <- forecast$pred - 1.96 * forecast$se)
(ub <- forecast$pred + 1.96 * forecast$se)
if (par2 == 0) {
x <- exp(x)
forecast$pred <- exp(forecast$pred)
lb <- exp(lb)
ub <- exp(ub)
}
if (par2 != 0) {
x <- x^(1/par2)
forecast$pred <- forecast$pred^(1/par2)
lb <- lb^(1/par2)
ub <- ub^(1/par2)
}
if (par2 < 0) {
olb <- lb
lb <- ub
ub <- olb
}
(actandfor <- c(x[1:nx], forecast$pred))
(perc.se <- (ub-forecast$pred)/1.96/forecast$pred)
bitmap(file='test1.png')
opar <- par(mar=c(4,4,2,2),las=1)
ylim <- c( min(x[first:nx],lb), max(x[first:nx],ub))
plot(x,ylim=ylim,type='n',xlim=c(first,lx))
usr <- par('usr')
rect(usr[1],usr[3],nx+1,usr[4],border=NA,col='lemonchiffon')
rect(nx1,usr[3],usr[2],usr[4],border=NA,col='lavender')
abline(h= (-3:3)*2 , col ='gray', lty =3)
polygon( c(nx1:lx,lx:nx1), c(lb,rev(ub)), col = 'orange', lty=2,border=NA)
lines(nx1:lx, lb , lty=2)
lines(nx1:lx, ub , lty=2)
lines(x, lwd=2)
lines(nx1:lx, forecast$pred , lwd=2 , col ='white')
box()
par(opar)
dev.off()
prob.dec <- array(NA, dim=fx)
prob.sdec <- array(NA, dim=fx)
prob.ldec <- array(NA, dim=fx)
prob.pval <- array(NA, dim=fx)
perf.pe <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.mse1 <- array(0, dim=fx)
perf.rmse <- array(0, dim=fx)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / forecast$pred[i]
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
prob.dec[i] = pnorm((x[nx+i-1] - forecast$pred[i]) / locSD)
prob.sdec[i] = pnorm((x[nx+i-par5] - forecast$pred[i]) / locSD)
prob.ldec[i] = pnorm((x[nx] - forecast$pred[i]) / locSD)
prob.pval[i] = pnorm(abs(x[nx+i] - forecast$pred[i]) / locSD)
}
perf.mape[1] = abs(perf.pe[1])
perf.mse[1] = abs(perf.se[1])
for (i in 2:fx) {
perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i])
perf.mape1[i] = perf.mape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
}
perf.rmse = sqrt(perf.mse1)
bitmap(file='test2.png')
plot(forecast$pred, pch=19, type='b',main='ARIMA Extrapolation Forecast', ylab='Forecast and 95% CI', xlab='time',ylim=c(min(lb),max(ub)))
dum <- forecast$pred
dum[1:par1] <- x[(nx+1):lx]
lines(dum, lty=1)
lines(ub,lty=3)
lines(lb,lty=3)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast',9,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'Y[t]',1,header=TRUE)
a<-table.element(a,'F[t]',1,header=TRUE)
a<-table.element(a,'95% LB',1,header=TRUE)
a<-table.element(a,'95% UB',1,header=TRUE)
a<-table.element(a,'p-value
(H0: Y[t] = F[t])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-1])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-s])',1,header=TRUE)
mylab <- paste('P(F[t]>Y[',nx,sep='')
mylab <- paste(mylab,'])',sep='')
a<-table.element(a,mylab,1,header=TRUE)
a<-table.row.end(a)
for (i in (nx-par5):nx) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.row.end(a)
}
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(x[nx+i],4))
a<-table.element(a,round(forecast$pred[i],4))
a<-table.element(a,round(lb[i],4))
a<-table.element(a,round(ub[i],4))
a<-table.element(a,round((1-prob.pval[i]),4))
a<-table.element(a,round((1-prob.dec[i]),4))
a<-table.element(a,round((1-prob.sdec[i]),4))
a<-table.element(a,round((1-prob.ldec[i]),4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast Performance',7,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'% S.E.',1,header=TRUE)
a<-table.element(a,'PE',1,header=TRUE)
a<-table.element(a,'MAPE',1,header=TRUE)
a<-table.element(a,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',1,header=TRUE)
a<-table.row.end(a)
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(perc.se[i],4))
a<-table.element(a,round(perf.pe[i],4))
a<-table.element(a,round(perf.mape1[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')