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 computationSat, 16 Dec 2017 15:21:21 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2017/Dec/16/t1513434967c7o1caxthg5efgd.htm/, Retrieved Wed, 15 May 2024 23:14:20 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=309896, Retrieved Wed, 15 May 2024 23:14:20 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact60
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecasting] [2017-12-16 14:21:21] [dd1b1eac6490c5f5f771b5814b2d0001] [Current]
Feedback Forum

Post a new message
Dataseries X:
563
601
768
717
581
797
731
586
710
621
677
635
590
632
744
571
473
754
548
590
514
590
652
489
546
569
620
499
631
483
503
578
582
587
718
567
766
671
667
668
761
661
809
577
646
816
686
618
835
832
813
791
891
797
883
682
675
840
677
715
700
681
596
829
621
524
721
537
630
608
558
616
552
538
712
513
433
543
479
363
456
427
438
552
426
504
515
411
437
421
400
372
333
332
515
346
444
336
340
296
373
325
289
315
271
331
291




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309896&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=309896&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309896&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







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[95])
83438-------
84552-------
85426-------
86504-------
87515-------
88411-------
89437-------
90421-------
91400-------
92372-------
93333-------
94332-------
95515-------
96346384.2242232.5474535.90090.31070.04550.01510.0455
97444370.0627218.0433522.08210.17020.62180.23540.0308
98336453.6141298.0727609.15550.06920.54820.26270.2196
99340415.1913238.32592.06260.20240.80990.13440.1344
100296377.4442194.3186560.56980.19170.65570.35970.0705
101373411.6265224.1014599.15160.34320.88660.39540.14
102325397.5762199.5925595.55990.23620.59610.40830.1225
103289383.6475178.39588.9050.18310.71230.4380.1049
104315386.0423175.3399596.74480.25440.81670.5520.1151
105271374.8536156.847592.86020.17520.70480.64660.1038
106331370.2143145.4511594.97740.36620.80650.63050.1034
107291420.8344190.3311651.33780.13480.77750.21170.2117

\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[95]) \tabularnewline
83 & 438 & - & - & - & - & - & - & - \tabularnewline
84 & 552 & - & - & - & - & - & - & - \tabularnewline
85 & 426 & - & - & - & - & - & - & - \tabularnewline
86 & 504 & - & - & - & - & - & - & - \tabularnewline
87 & 515 & - & - & - & - & - & - & - \tabularnewline
88 & 411 & - & - & - & - & - & - & - \tabularnewline
89 & 437 & - & - & - & - & - & - & - \tabularnewline
90 & 421 & - & - & - & - & - & - & - \tabularnewline
91 & 400 & - & - & - & - & - & - & - \tabularnewline
92 & 372 & - & - & - & - & - & - & - \tabularnewline
93 & 333 & - & - & - & - & - & - & - \tabularnewline
94 & 332 & - & - & - & - & - & - & - \tabularnewline
95 & 515 & - & - & - & - & - & - & - \tabularnewline
96 & 346 & 384.2242 & 232.5474 & 535.9009 & 0.3107 & 0.0455 & 0.0151 & 0.0455 \tabularnewline
97 & 444 & 370.0627 & 218.0433 & 522.0821 & 0.1702 & 0.6218 & 0.2354 & 0.0308 \tabularnewline
98 & 336 & 453.6141 & 298.0727 & 609.1555 & 0.0692 & 0.5482 & 0.2627 & 0.2196 \tabularnewline
99 & 340 & 415.1913 & 238.32 & 592.0626 & 0.2024 & 0.8099 & 0.1344 & 0.1344 \tabularnewline
100 & 296 & 377.4442 & 194.3186 & 560.5698 & 0.1917 & 0.6557 & 0.3597 & 0.0705 \tabularnewline
101 & 373 & 411.6265 & 224.1014 & 599.1516 & 0.3432 & 0.8866 & 0.3954 & 0.14 \tabularnewline
102 & 325 & 397.5762 & 199.5925 & 595.5599 & 0.2362 & 0.5961 & 0.4083 & 0.1225 \tabularnewline
103 & 289 & 383.6475 & 178.39 & 588.905 & 0.1831 & 0.7123 & 0.438 & 0.1049 \tabularnewline
104 & 315 & 386.0423 & 175.3399 & 596.7448 & 0.2544 & 0.8167 & 0.552 & 0.1151 \tabularnewline
105 & 271 & 374.8536 & 156.847 & 592.8602 & 0.1752 & 0.7048 & 0.6466 & 0.1038 \tabularnewline
106 & 331 & 370.2143 & 145.4511 & 594.9774 & 0.3662 & 0.8065 & 0.6305 & 0.1034 \tabularnewline
107 & 291 & 420.8344 & 190.3311 & 651.3378 & 0.1348 & 0.7775 & 0.2117 & 0.2117 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309896&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[95])[/C][/ROW]
[ROW][C]83[/C][C]438[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]552[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]426[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]504[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]515[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]411[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]437[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]421[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]400[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]372[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]333[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]332[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]515[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]346[/C][C]384.2242[/C][C]232.5474[/C][C]535.9009[/C][C]0.3107[/C][C]0.0455[/C][C]0.0151[/C][C]0.0455[/C][/ROW]
[ROW][C]97[/C][C]444[/C][C]370.0627[/C][C]218.0433[/C][C]522.0821[/C][C]0.1702[/C][C]0.6218[/C][C]0.2354[/C][C]0.0308[/C][/ROW]
[ROW][C]98[/C][C]336[/C][C]453.6141[/C][C]298.0727[/C][C]609.1555[/C][C]0.0692[/C][C]0.5482[/C][C]0.2627[/C][C]0.2196[/C][/ROW]
[ROW][C]99[/C][C]340[/C][C]415.1913[/C][C]238.32[/C][C]592.0626[/C][C]0.2024[/C][C]0.8099[/C][C]0.1344[/C][C]0.1344[/C][/ROW]
[ROW][C]100[/C][C]296[/C][C]377.4442[/C][C]194.3186[/C][C]560.5698[/C][C]0.1917[/C][C]0.6557[/C][C]0.3597[/C][C]0.0705[/C][/ROW]
[ROW][C]101[/C][C]373[/C][C]411.6265[/C][C]224.1014[/C][C]599.1516[/C][C]0.3432[/C][C]0.8866[/C][C]0.3954[/C][C]0.14[/C][/ROW]
[ROW][C]102[/C][C]325[/C][C]397.5762[/C][C]199.5925[/C][C]595.5599[/C][C]0.2362[/C][C]0.5961[/C][C]0.4083[/C][C]0.1225[/C][/ROW]
[ROW][C]103[/C][C]289[/C][C]383.6475[/C][C]178.39[/C][C]588.905[/C][C]0.1831[/C][C]0.7123[/C][C]0.438[/C][C]0.1049[/C][/ROW]
[ROW][C]104[/C][C]315[/C][C]386.0423[/C][C]175.3399[/C][C]596.7448[/C][C]0.2544[/C][C]0.8167[/C][C]0.552[/C][C]0.1151[/C][/ROW]
[ROW][C]105[/C][C]271[/C][C]374.8536[/C][C]156.847[/C][C]592.8602[/C][C]0.1752[/C][C]0.7048[/C][C]0.6466[/C][C]0.1038[/C][/ROW]
[ROW][C]106[/C][C]331[/C][C]370.2143[/C][C]145.4511[/C][C]594.9774[/C][C]0.3662[/C][C]0.8065[/C][C]0.6305[/C][C]0.1034[/C][/ROW]
[ROW][C]107[/C][C]291[/C][C]420.8344[/C][C]190.3311[/C][C]651.3378[/C][C]0.1348[/C][C]0.7775[/C][C]0.2117[/C][C]0.2117[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309896&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309896&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[95])
83438-------
84552-------
85426-------
86504-------
87515-------
88411-------
89437-------
90421-------
91400-------
92372-------
93333-------
94332-------
95515-------
96346384.2242232.5474535.90090.31070.04550.01510.0455
97444370.0627218.0433522.08210.17020.62180.23540.0308
98336453.6141298.0727609.15550.06920.54820.26270.2196
99340415.1913238.32592.06260.20240.80990.13440.1344
100296377.4442194.3186560.56980.19170.65570.35970.0705
101373411.6265224.1014599.15160.34320.88660.39540.14
102325397.5762199.5925595.55990.23620.59610.40830.1225
103289383.6475178.39588.9050.18310.71230.4380.1049
104315386.0423175.3399596.74480.25440.81670.5520.1151
105271374.8536156.847592.86020.17520.70480.64660.1038
106331370.2143145.4511594.97740.36620.80650.63050.1034
107291420.8344190.3311651.33780.13480.77750.21170.2117







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
960.2014-0.11050.11050.10471461.086200-0.71870.7187
970.20960.16650.13850.14325466.72763463.906958.8551.39031.0545
980.1749-0.350.2090.194713833.07386920.295983.1883-2.21151.4402
990.2173-0.22120.2120.19585653.72776603.653881.2629-1.41391.4336
1000.2475-0.27510.22470.2056633.15776609.554681.2992-1.53141.4532
1010.2324-0.10360.20450.18731492.00465756.629675.8725-0.72631.332
1020.2541-0.22330.20720.18925267.30665686.726375.4104-1.36471.3367
1030.273-0.32750.22220.20088958.14656095.653878.0747-1.77971.3921
1040.2785-0.22550.22260.2015047.00995979.137977.3249-1.33581.3858
1050.2967-0.38320.23860.21310785.56726459.780880.3728-1.95281.4425
1060.3098-0.11850.22770.20381537.75786012.324277.5392-0.73741.3784
1070.2795-0.44620.24590.217216856.98016916.045583.1628-2.44131.467

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
96 & 0.2014 & -0.1105 & 0.1105 & 0.1047 & 1461.0862 & 0 & 0 & -0.7187 & 0.7187 \tabularnewline
97 & 0.2096 & 0.1665 & 0.1385 & 0.1432 & 5466.7276 & 3463.9069 & 58.855 & 1.3903 & 1.0545 \tabularnewline
98 & 0.1749 & -0.35 & 0.209 & 0.1947 & 13833.0738 & 6920.2959 & 83.1883 & -2.2115 & 1.4402 \tabularnewline
99 & 0.2173 & -0.2212 & 0.212 & 0.1958 & 5653.7277 & 6603.6538 & 81.2629 & -1.4139 & 1.4336 \tabularnewline
100 & 0.2475 & -0.2751 & 0.2247 & 0.205 & 6633.1577 & 6609.5546 & 81.2992 & -1.5314 & 1.4532 \tabularnewline
101 & 0.2324 & -0.1036 & 0.2045 & 0.1873 & 1492.0046 & 5756.6296 & 75.8725 & -0.7263 & 1.332 \tabularnewline
102 & 0.2541 & -0.2233 & 0.2072 & 0.1892 & 5267.3066 & 5686.7263 & 75.4104 & -1.3647 & 1.3367 \tabularnewline
103 & 0.273 & -0.3275 & 0.2222 & 0.2008 & 8958.1465 & 6095.6538 & 78.0747 & -1.7797 & 1.3921 \tabularnewline
104 & 0.2785 & -0.2255 & 0.2226 & 0.201 & 5047.0099 & 5979.1379 & 77.3249 & -1.3358 & 1.3858 \tabularnewline
105 & 0.2967 & -0.3832 & 0.2386 & 0.213 & 10785.5672 & 6459.7808 & 80.3728 & -1.9528 & 1.4425 \tabularnewline
106 & 0.3098 & -0.1185 & 0.2277 & 0.2038 & 1537.7578 & 6012.3242 & 77.5392 & -0.7374 & 1.3784 \tabularnewline
107 & 0.2795 & -0.4462 & 0.2459 & 0.2172 & 16856.9801 & 6916.0455 & 83.1628 & -2.4413 & 1.467 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309896&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]96[/C][C]0.2014[/C][C]-0.1105[/C][C]0.1105[/C][C]0.1047[/C][C]1461.0862[/C][C]0[/C][C]0[/C][C]-0.7187[/C][C]0.7187[/C][/ROW]
[ROW][C]97[/C][C]0.2096[/C][C]0.1665[/C][C]0.1385[/C][C]0.1432[/C][C]5466.7276[/C][C]3463.9069[/C][C]58.855[/C][C]1.3903[/C][C]1.0545[/C][/ROW]
[ROW][C]98[/C][C]0.1749[/C][C]-0.35[/C][C]0.209[/C][C]0.1947[/C][C]13833.0738[/C][C]6920.2959[/C][C]83.1883[/C][C]-2.2115[/C][C]1.4402[/C][/ROW]
[ROW][C]99[/C][C]0.2173[/C][C]-0.2212[/C][C]0.212[/C][C]0.1958[/C][C]5653.7277[/C][C]6603.6538[/C][C]81.2629[/C][C]-1.4139[/C][C]1.4336[/C][/ROW]
[ROW][C]100[/C][C]0.2475[/C][C]-0.2751[/C][C]0.2247[/C][C]0.205[/C][C]6633.1577[/C][C]6609.5546[/C][C]81.2992[/C][C]-1.5314[/C][C]1.4532[/C][/ROW]
[ROW][C]101[/C][C]0.2324[/C][C]-0.1036[/C][C]0.2045[/C][C]0.1873[/C][C]1492.0046[/C][C]5756.6296[/C][C]75.8725[/C][C]-0.7263[/C][C]1.332[/C][/ROW]
[ROW][C]102[/C][C]0.2541[/C][C]-0.2233[/C][C]0.2072[/C][C]0.1892[/C][C]5267.3066[/C][C]5686.7263[/C][C]75.4104[/C][C]-1.3647[/C][C]1.3367[/C][/ROW]
[ROW][C]103[/C][C]0.273[/C][C]-0.3275[/C][C]0.2222[/C][C]0.2008[/C][C]8958.1465[/C][C]6095.6538[/C][C]78.0747[/C][C]-1.7797[/C][C]1.3921[/C][/ROW]
[ROW][C]104[/C][C]0.2785[/C][C]-0.2255[/C][C]0.2226[/C][C]0.201[/C][C]5047.0099[/C][C]5979.1379[/C][C]77.3249[/C][C]-1.3358[/C][C]1.3858[/C][/ROW]
[ROW][C]105[/C][C]0.2967[/C][C]-0.3832[/C][C]0.2386[/C][C]0.213[/C][C]10785.5672[/C][C]6459.7808[/C][C]80.3728[/C][C]-1.9528[/C][C]1.4425[/C][/ROW]
[ROW][C]106[/C][C]0.3098[/C][C]-0.1185[/C][C]0.2277[/C][C]0.2038[/C][C]1537.7578[/C][C]6012.3242[/C][C]77.5392[/C][C]-0.7374[/C][C]1.3784[/C][/ROW]
[ROW][C]107[/C][C]0.2795[/C][C]-0.4462[/C][C]0.2459[/C][C]0.2172[/C][C]16856.9801[/C][C]6916.0455[/C][C]83.1628[/C][C]-2.4413[/C][C]1.467[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309896&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309896&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
960.2014-0.11050.11050.10471461.086200-0.71870.7187
970.20960.16650.13850.14325466.72763463.906958.8551.39031.0545
980.1749-0.350.2090.194713833.07386920.295983.1883-2.21151.4402
990.2173-0.22120.2120.19585653.72776603.653881.2629-1.41391.4336
1000.2475-0.27510.22470.2056633.15776609.554681.2992-1.53141.4532
1010.2324-0.10360.20450.18731492.00465756.629675.8725-0.72631.332
1020.2541-0.22330.20720.18925267.30665686.726375.4104-1.36471.3367
1030.273-0.32750.22220.20088958.14656095.653878.0747-1.77971.3921
1040.2785-0.22550.22260.2015047.00995979.137977.3249-1.33581.3858
1050.2967-0.38320.23860.21310785.56726459.780880.3728-1.95281.4425
1060.3098-0.11850.22770.20381537.75786012.324277.5392-0.73741.3784
1070.2795-0.44620.24590.217216856.98016916.045583.1628-2.44131.467



Parameters (Session):
par1 = FALSE ; par2 = 0.0 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 1 ; par9 = 1 ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 1 ; par9 = 0 ; 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*2
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,fx))
(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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')