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, 16 Dec 2016 21:16:57 +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/2016/Dec/16/t148191942946erueuwwcpto3m.htm/, Retrieved Fri, 03 May 2024 03:46:16 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300538, Retrieved Fri, 03 May 2024 03:46:16 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact61
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-16 20:16:57] [85f5800284aab30c091766186b093bb4] [Current]
Feedback Forum

Post a new message
Dataseries X:
1819,6
1312,4
2584
1479,6
1742
2639,2
1706
1408
1951,6
1690,4
2288,4
2912
1460,8
1009,6
2410
1603,2
2115,2
2330
1690
1358
1806,8
1973,6
1402
1857,6
1974,4
1438
1923,2
1996,8
2238,8
2540,4
1704,4
1856
2214,8
1948
1802
1431,6
2857,6
1784
2770,8
2313,6
3707,6
4322,4
3297,6
2223,6
2136,4
2459,2
1650,4
2921,2
1979,6
1403,2
2374
2876,4
2500
3888
1508,8
1011,2
1590,8
2076,4
3736
2125,6
982,8
2034,8
2260
1726
2270,4
1951,6
2104,4
2972,8
2834,4
4227,6
3392,4
3069,2
3138,8
3570
4800,4
4769,2
5124,8
3476,8
2866,8
2549,2
2728
2448,8
3286,8
2830
3251,2
4188,8
2747,6
2269,2
2493,2
2147,6
2689,2
3557,2
2840
3979,6
2683,2
2852
3012,8
2950,8
3065,2
3942,4
4272
4564
5222,8
5164,4
3883,6
4103,2
5244
8071,6
5441,6
7496
10100,4
9616
5645,6
10490
5582
7579,2
4023,6
8146,4
8534,4
10113,6
8504,4
9782,4
13110
8192,8
8708,8
9528,8




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=300538&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=300538&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300538&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[114])
1107496-------
11110100.4-------
1129616-------
1135645.6-------
11410490-------
115558210795.12648682.516512907.736400.61140.74040.6114
1167579.210738.37517750.693513726.05670.01910.99960.76920.5647
1174023.610273.21076614.06313932.35854e-040.92550.99340.4538
1188146.410840.77126615.551415065.9910.10570.99920.56460.5646
1198534.410876.51926036.824515716.2140.17140.86560.9840.5622
12010113.610869.87045485.373416254.36730.39150.80240.88450.555
1218504.410815.37264936.344616694.40060.22050.59250.98820.5432
1229782.410881.86694546.795217216.93850.36690.7690.80130.5482
1231311010886.05514115.455917656.65420.25990.62530.7520.5456
1248192.810885.27613705.520418065.03180.23120.27180.58340.543
1258708.810878.89123312.070818445.71170.2870.75670.73070.5401
1269528.810886.68162951.654718821.70840.36870.70470.60750.539

\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[114]) \tabularnewline
110 & 7496 & - & - & - & - & - & - & - \tabularnewline
111 & 10100.4 & - & - & - & - & - & - & - \tabularnewline
112 & 9616 & - & - & - & - & - & - & - \tabularnewline
113 & 5645.6 & - & - & - & - & - & - & - \tabularnewline
114 & 10490 & - & - & - & - & - & - & - \tabularnewline
115 & 5582 & 10795.1264 & 8682.5165 & 12907.7364 & 0 & 0.6114 & 0.7404 & 0.6114 \tabularnewline
116 & 7579.2 & 10738.3751 & 7750.6935 & 13726.0567 & 0.0191 & 0.9996 & 0.7692 & 0.5647 \tabularnewline
117 & 4023.6 & 10273.2107 & 6614.063 & 13932.3585 & 4e-04 & 0.9255 & 0.9934 & 0.4538 \tabularnewline
118 & 8146.4 & 10840.7712 & 6615.5514 & 15065.991 & 0.1057 & 0.9992 & 0.5646 & 0.5646 \tabularnewline
119 & 8534.4 & 10876.5192 & 6036.8245 & 15716.214 & 0.1714 & 0.8656 & 0.984 & 0.5622 \tabularnewline
120 & 10113.6 & 10869.8704 & 5485.3734 & 16254.3673 & 0.3915 & 0.8024 & 0.8845 & 0.555 \tabularnewline
121 & 8504.4 & 10815.3726 & 4936.3446 & 16694.4006 & 0.2205 & 0.5925 & 0.9882 & 0.5432 \tabularnewline
122 & 9782.4 & 10881.8669 & 4546.7952 & 17216.9385 & 0.3669 & 0.769 & 0.8013 & 0.5482 \tabularnewline
123 & 13110 & 10886.0551 & 4115.4559 & 17656.6542 & 0.2599 & 0.6253 & 0.752 & 0.5456 \tabularnewline
124 & 8192.8 & 10885.2761 & 3705.5204 & 18065.0318 & 0.2312 & 0.2718 & 0.5834 & 0.543 \tabularnewline
125 & 8708.8 & 10878.8912 & 3312.0708 & 18445.7117 & 0.287 & 0.7567 & 0.7307 & 0.5401 \tabularnewline
126 & 9528.8 & 10886.6816 & 2951.6547 & 18821.7084 & 0.3687 & 0.7047 & 0.6075 & 0.539 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300538&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[114])[/C][/ROW]
[ROW][C]110[/C][C]7496[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]10100.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]9616[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]5645.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]10490[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]5582[/C][C]10795.1264[/C][C]8682.5165[/C][C]12907.7364[/C][C]0[/C][C]0.6114[/C][C]0.7404[/C][C]0.6114[/C][/ROW]
[ROW][C]116[/C][C]7579.2[/C][C]10738.3751[/C][C]7750.6935[/C][C]13726.0567[/C][C]0.0191[/C][C]0.9996[/C][C]0.7692[/C][C]0.5647[/C][/ROW]
[ROW][C]117[/C][C]4023.6[/C][C]10273.2107[/C][C]6614.063[/C][C]13932.3585[/C][C]4e-04[/C][C]0.9255[/C][C]0.9934[/C][C]0.4538[/C][/ROW]
[ROW][C]118[/C][C]8146.4[/C][C]10840.7712[/C][C]6615.5514[/C][C]15065.991[/C][C]0.1057[/C][C]0.9992[/C][C]0.5646[/C][C]0.5646[/C][/ROW]
[ROW][C]119[/C][C]8534.4[/C][C]10876.5192[/C][C]6036.8245[/C][C]15716.214[/C][C]0.1714[/C][C]0.8656[/C][C]0.984[/C][C]0.5622[/C][/ROW]
[ROW][C]120[/C][C]10113.6[/C][C]10869.8704[/C][C]5485.3734[/C][C]16254.3673[/C][C]0.3915[/C][C]0.8024[/C][C]0.8845[/C][C]0.555[/C][/ROW]
[ROW][C]121[/C][C]8504.4[/C][C]10815.3726[/C][C]4936.3446[/C][C]16694.4006[/C][C]0.2205[/C][C]0.5925[/C][C]0.9882[/C][C]0.5432[/C][/ROW]
[ROW][C]122[/C][C]9782.4[/C][C]10881.8669[/C][C]4546.7952[/C][C]17216.9385[/C][C]0.3669[/C][C]0.769[/C][C]0.8013[/C][C]0.5482[/C][/ROW]
[ROW][C]123[/C][C]13110[/C][C]10886.0551[/C][C]4115.4559[/C][C]17656.6542[/C][C]0.2599[/C][C]0.6253[/C][C]0.752[/C][C]0.5456[/C][/ROW]
[ROW][C]124[/C][C]8192.8[/C][C]10885.2761[/C][C]3705.5204[/C][C]18065.0318[/C][C]0.2312[/C][C]0.2718[/C][C]0.5834[/C][C]0.543[/C][/ROW]
[ROW][C]125[/C][C]8708.8[/C][C]10878.8912[/C][C]3312.0708[/C][C]18445.7117[/C][C]0.287[/C][C]0.7567[/C][C]0.7307[/C][C]0.5401[/C][/ROW]
[ROW][C]126[/C][C]9528.8[/C][C]10886.6816[/C][C]2951.6547[/C][C]18821.7084[/C][C]0.3687[/C][C]0.7047[/C][C]0.6075[/C][C]0.539[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300538&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300538&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[114])
1107496-------
11110100.4-------
1129616-------
1135645.6-------
11410490-------
115558210795.12648682.516512907.736400.61140.74040.6114
1167579.210738.37517750.693513726.05670.01910.99960.76920.5647
1174023.610273.21076614.06313932.35854e-040.92550.99340.4538
1188146.410840.77126615.551415065.9910.10570.99920.56460.5646
1198534.410876.51926036.824515716.2140.17140.86560.9840.5622
12010113.610869.87045485.373416254.36730.39150.80240.88450.555
1218504.410815.37264936.344616694.40060.22050.59250.98820.5432
1229782.410881.86694546.795217216.93850.36690.7690.80130.5482
1231311010886.05514115.455917656.65420.25990.62530.7520.5456
1248192.810885.27613705.520418065.03180.23120.27180.58340.543
1258708.810878.89123312.070818445.71170.2870.75670.73070.5401
1269528.810886.68162951.654718821.70840.36870.70470.60750.539







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.0998-0.93390.93390.636627176687.238800-2.37842.3784
1160.142-0.41680.67540.49089980387.152618578537.19574310.2827-1.44131.9098
1170.1817-1.55320.9680.618639057634.360225404902.91725040.3277-2.85122.2236
1180.1989-0.33070.80870.53497259636.238720868586.24764568.2148-1.22921.975
1190.227-0.27440.70180.47625485522.503917791973.49884218.0533-1.06851.7937
1200.2527-0.07480.59730.4088571944.84914921968.72383862.8964-0.3451.5523
1210.2773-0.27170.55080.38465340594.384513553200.96113681.4672-1.05431.4812
1220.297-0.11240.4960.34981208827.435312010154.27033465.5669-0.50161.3587
1230.31730.16960.45970.33164945931.117311225240.58673350.4091.01461.3205
1240.3365-0.32860.44660.32667249427.471110827659.27513290.5409-1.22841.3113
1250.3549-0.24920.42870.31714709295.969610271444.42923204.9094-0.99011.2821
1260.3719-0.14250.40480.30171843842.37429569144.25793093.4033-0.61951.2269

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
115 & 0.0998 & -0.9339 & 0.9339 & 0.6366 & 27176687.2388 & 0 & 0 & -2.3784 & 2.3784 \tabularnewline
116 & 0.142 & -0.4168 & 0.6754 & 0.4908 & 9980387.1526 & 18578537.1957 & 4310.2827 & -1.4413 & 1.9098 \tabularnewline
117 & 0.1817 & -1.5532 & 0.968 & 0.6186 & 39057634.3602 & 25404902.9172 & 5040.3277 & -2.8512 & 2.2236 \tabularnewline
118 & 0.1989 & -0.3307 & 0.8087 & 0.5349 & 7259636.2387 & 20868586.2476 & 4568.2148 & -1.2292 & 1.975 \tabularnewline
119 & 0.227 & -0.2744 & 0.7018 & 0.4762 & 5485522.5039 & 17791973.4988 & 4218.0533 & -1.0685 & 1.7937 \tabularnewline
120 & 0.2527 & -0.0748 & 0.5973 & 0.4088 & 571944.849 & 14921968.7238 & 3862.8964 & -0.345 & 1.5523 \tabularnewline
121 & 0.2773 & -0.2717 & 0.5508 & 0.3846 & 5340594.3845 & 13553200.9611 & 3681.4672 & -1.0543 & 1.4812 \tabularnewline
122 & 0.297 & -0.1124 & 0.496 & 0.3498 & 1208827.4353 & 12010154.2703 & 3465.5669 & -0.5016 & 1.3587 \tabularnewline
123 & 0.3173 & 0.1696 & 0.4597 & 0.3316 & 4945931.1173 & 11225240.5867 & 3350.409 & 1.0146 & 1.3205 \tabularnewline
124 & 0.3365 & -0.3286 & 0.4466 & 0.3266 & 7249427.4711 & 10827659.2751 & 3290.5409 & -1.2284 & 1.3113 \tabularnewline
125 & 0.3549 & -0.2492 & 0.4287 & 0.3171 & 4709295.9696 & 10271444.4292 & 3204.9094 & -0.9901 & 1.2821 \tabularnewline
126 & 0.3719 & -0.1425 & 0.4048 & 0.3017 & 1843842.3742 & 9569144.2579 & 3093.4033 & -0.6195 & 1.2269 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300538&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]115[/C][C]0.0998[/C][C]-0.9339[/C][C]0.9339[/C][C]0.6366[/C][C]27176687.2388[/C][C]0[/C][C]0[/C][C]-2.3784[/C][C]2.3784[/C][/ROW]
[ROW][C]116[/C][C]0.142[/C][C]-0.4168[/C][C]0.6754[/C][C]0.4908[/C][C]9980387.1526[/C][C]18578537.1957[/C][C]4310.2827[/C][C]-1.4413[/C][C]1.9098[/C][/ROW]
[ROW][C]117[/C][C]0.1817[/C][C]-1.5532[/C][C]0.968[/C][C]0.6186[/C][C]39057634.3602[/C][C]25404902.9172[/C][C]5040.3277[/C][C]-2.8512[/C][C]2.2236[/C][/ROW]
[ROW][C]118[/C][C]0.1989[/C][C]-0.3307[/C][C]0.8087[/C][C]0.5349[/C][C]7259636.2387[/C][C]20868586.2476[/C][C]4568.2148[/C][C]-1.2292[/C][C]1.975[/C][/ROW]
[ROW][C]119[/C][C]0.227[/C][C]-0.2744[/C][C]0.7018[/C][C]0.4762[/C][C]5485522.5039[/C][C]17791973.4988[/C][C]4218.0533[/C][C]-1.0685[/C][C]1.7937[/C][/ROW]
[ROW][C]120[/C][C]0.2527[/C][C]-0.0748[/C][C]0.5973[/C][C]0.4088[/C][C]571944.849[/C][C]14921968.7238[/C][C]3862.8964[/C][C]-0.345[/C][C]1.5523[/C][/ROW]
[ROW][C]121[/C][C]0.2773[/C][C]-0.2717[/C][C]0.5508[/C][C]0.3846[/C][C]5340594.3845[/C][C]13553200.9611[/C][C]3681.4672[/C][C]-1.0543[/C][C]1.4812[/C][/ROW]
[ROW][C]122[/C][C]0.297[/C][C]-0.1124[/C][C]0.496[/C][C]0.3498[/C][C]1208827.4353[/C][C]12010154.2703[/C][C]3465.5669[/C][C]-0.5016[/C][C]1.3587[/C][/ROW]
[ROW][C]123[/C][C]0.3173[/C][C]0.1696[/C][C]0.4597[/C][C]0.3316[/C][C]4945931.1173[/C][C]11225240.5867[/C][C]3350.409[/C][C]1.0146[/C][C]1.3205[/C][/ROW]
[ROW][C]124[/C][C]0.3365[/C][C]-0.3286[/C][C]0.4466[/C][C]0.3266[/C][C]7249427.4711[/C][C]10827659.2751[/C][C]3290.5409[/C][C]-1.2284[/C][C]1.3113[/C][/ROW]
[ROW][C]125[/C][C]0.3549[/C][C]-0.2492[/C][C]0.4287[/C][C]0.3171[/C][C]4709295.9696[/C][C]10271444.4292[/C][C]3204.9094[/C][C]-0.9901[/C][C]1.2821[/C][/ROW]
[ROW][C]126[/C][C]0.3719[/C][C]-0.1425[/C][C]0.4048[/C][C]0.3017[/C][C]1843842.3742[/C][C]9569144.2579[/C][C]3093.4033[/C][C]-0.6195[/C][C]1.2269[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300538&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300538&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
1150.0998-0.93390.93390.636627176687.238800-2.37842.3784
1160.142-0.41680.67540.49089980387.152618578537.19574310.2827-1.44131.9098
1170.1817-1.55320.9680.618639057634.360225404902.91725040.3277-2.85122.2236
1180.1989-0.33070.80870.53497259636.238720868586.24764568.2148-1.22921.975
1190.227-0.27440.70180.47625485522.503917791973.49884218.0533-1.06851.7937
1200.2527-0.07480.59730.4088571944.84914921968.72383862.8964-0.3451.5523
1210.2773-0.27170.55080.38465340594.384513553200.96113681.4672-1.05431.4812
1220.297-0.11240.4960.34981208827.435312010154.27033465.5669-0.50161.3587
1230.31730.16960.45970.33164945931.117311225240.58673350.4091.01461.3205
1240.3365-0.32860.44660.32667249427.471110827659.27513290.5409-1.22841.3113
1250.3549-0.24920.42870.31714709295.969610271444.42923204.9094-0.99011.2821
1260.3719-0.14250.40480.30171843842.37429569144.25793093.4033-0.61951.2269



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 4 ; par6 = 0 ; par7 = 0 ; par8 = 1 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 4 ; par6 = 0 ; 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')