Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 28 Dec 2010 19:01:32 +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/28/t12935629031xadvmw884orzz1.htm/, Retrieved Sun, 05 May 2024 05:11:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=116493, Retrieved Sun, 05 May 2024 05:11:33 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact76
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [Univariate Data Series] [Airline data] [2007-10-18 09:58:47] [42daae401fd3def69a25014f2252b4c2]
F RMPD  [Cross Correlation Function] [Q7 - zonder trans...] [2008-12-01 20:04:13] [299afd6311e4c20059ea2f05c8dd029d]
F RM D    [Variance Reduction Matrix] [Q8] [2008-12-01 20:20:44] [299afd6311e4c20059ea2f05c8dd029d]
F    D      [Variance Reduction Matrix] [Q8 - 2] [2008-12-01 20:25:07] [299afd6311e4c20059ea2f05c8dd029d]
F RM D        [Standard Deviation-Mean Plot] [Deel 2: Step 1] [2008-12-08 20:09:35] [299afd6311e4c20059ea2f05c8dd029d]
F RM D          [ARIMA Backward Selection] [Deel 2: Step 5] [2008-12-08 20:35:27] [299afd6311e4c20059ea2f05c8dd029d]
F RMP             [ARIMA Forecasting] [Uitvoer vanuit Be...] [2008-12-14 15:56:40] [299afd6311e4c20059ea2f05c8dd029d]
- RMPD                [ARIMA Forecasting] [Arima Forecasting] [2010-12-28 19:01:32] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
-697.3
-143.8
-137.4
-26.9
559.2
630.2
1070.9
-820.8
993.3
741.7
603.6
-145.8
-35.1
395.1
523.1
462.3
183.4
791.5
344.8
-217
406.7
228.6
-580.1
-1550.4
-1447.5
-40.1
-1033.5
-925.6
-347.8
-447.7
-102.6
-2062.2
-929.7
-720.7
-1541.8
-1432.3
-1216.2
-212.8
-378.2
76.9
-101.3
220.4
495.6
-1035.2
61.8
-734.8
-6.9
-1061.1
-854.6
-186.5
244
-992.6
-335.2
316.8
477.6
-572.1




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 3 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116493&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116493&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116493&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 time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







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[44])
32-2062.2-------
33-929.7-------
34-720.7-------
35-1541.8-------
36-1432.3-------
37-1216.2-------
38-212.8-------
39-378.2-------
4076.9-------
41-101.3-------
42220.4-------
43495.6-------
44-1035.2-------
4561.8-150.1501-982.2689681.96880.30880.98150.96680.9815
46-734.8-179.1691-1107.5249749.18680.12040.30550.87350.9646
47-6.9-843.7588-1843.4354155.91790.05040.41540.91440.6463
48-1061.1-1341.0395-2395.0603-287.01860.30130.00660.56740.2848
49-854.6-1215.6873-2311.8367-119.5380.25930.39110.50040.3735
50-186.5-151.0087-1280.1959978.17850.47540.8890.54270.9376
51244-739.7749-1895.0823415.53260.04760.1740.26980.6919
52-992.6-547.7388-1723.8199628.34220.22920.09350.14890.7917
53-335.2-271.6607-1464.3363921.01480.45840.88190.38980.8952
54316.8-232.7766-1438.7529973.19970.18590.56610.23070.9039
55477.639.0417-1177.62311255.70640.23990.32730.2310.9582
56-572.1-1465.6022-2690.8735-240.33090.07659e-040.24560.2456

\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[44]) \tabularnewline
32 & -2062.2 & - & - & - & - & - & - & - \tabularnewline
33 & -929.7 & - & - & - & - & - & - & - \tabularnewline
34 & -720.7 & - & - & - & - & - & - & - \tabularnewline
35 & -1541.8 & - & - & - & - & - & - & - \tabularnewline
36 & -1432.3 & - & - & - & - & - & - & - \tabularnewline
37 & -1216.2 & - & - & - & - & - & - & - \tabularnewline
38 & -212.8 & - & - & - & - & - & - & - \tabularnewline
39 & -378.2 & - & - & - & - & - & - & - \tabularnewline
40 & 76.9 & - & - & - & - & - & - & - \tabularnewline
41 & -101.3 & - & - & - & - & - & - & - \tabularnewline
42 & 220.4 & - & - & - & - & - & - & - \tabularnewline
43 & 495.6 & - & - & - & - & - & - & - \tabularnewline
44 & -1035.2 & - & - & - & - & - & - & - \tabularnewline
45 & 61.8 & -150.1501 & -982.2689 & 681.9688 & 0.3088 & 0.9815 & 0.9668 & 0.9815 \tabularnewline
46 & -734.8 & -179.1691 & -1107.5249 & 749.1868 & 0.1204 & 0.3055 & 0.8735 & 0.9646 \tabularnewline
47 & -6.9 & -843.7588 & -1843.4354 & 155.9179 & 0.0504 & 0.4154 & 0.9144 & 0.6463 \tabularnewline
48 & -1061.1 & -1341.0395 & -2395.0603 & -287.0186 & 0.3013 & 0.0066 & 0.5674 & 0.2848 \tabularnewline
49 & -854.6 & -1215.6873 & -2311.8367 & -119.538 & 0.2593 & 0.3911 & 0.5004 & 0.3735 \tabularnewline
50 & -186.5 & -151.0087 & -1280.1959 & 978.1785 & 0.4754 & 0.889 & 0.5427 & 0.9376 \tabularnewline
51 & 244 & -739.7749 & -1895.0823 & 415.5326 & 0.0476 & 0.174 & 0.2698 & 0.6919 \tabularnewline
52 & -992.6 & -547.7388 & -1723.8199 & 628.3422 & 0.2292 & 0.0935 & 0.1489 & 0.7917 \tabularnewline
53 & -335.2 & -271.6607 & -1464.3363 & 921.0148 & 0.4584 & 0.8819 & 0.3898 & 0.8952 \tabularnewline
54 & 316.8 & -232.7766 & -1438.7529 & 973.1997 & 0.1859 & 0.5661 & 0.2307 & 0.9039 \tabularnewline
55 & 477.6 & 39.0417 & -1177.6231 & 1255.7064 & 0.2399 & 0.3273 & 0.231 & 0.9582 \tabularnewline
56 & -572.1 & -1465.6022 & -2690.8735 & -240.3309 & 0.0765 & 9e-04 & 0.2456 & 0.2456 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116493&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[44])[/C][/ROW]
[ROW][C]32[/C][C]-2062.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]-929.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]-720.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]-1541.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]-1432.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]-1216.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]-212.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]-378.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]76.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]-101.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]220.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]495.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]-1035.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]61.8[/C][C]-150.1501[/C][C]-982.2689[/C][C]681.9688[/C][C]0.3088[/C][C]0.9815[/C][C]0.9668[/C][C]0.9815[/C][/ROW]
[ROW][C]46[/C][C]-734.8[/C][C]-179.1691[/C][C]-1107.5249[/C][C]749.1868[/C][C]0.1204[/C][C]0.3055[/C][C]0.8735[/C][C]0.9646[/C][/ROW]
[ROW][C]47[/C][C]-6.9[/C][C]-843.7588[/C][C]-1843.4354[/C][C]155.9179[/C][C]0.0504[/C][C]0.4154[/C][C]0.9144[/C][C]0.6463[/C][/ROW]
[ROW][C]48[/C][C]-1061.1[/C][C]-1341.0395[/C][C]-2395.0603[/C][C]-287.0186[/C][C]0.3013[/C][C]0.0066[/C][C]0.5674[/C][C]0.2848[/C][/ROW]
[ROW][C]49[/C][C]-854.6[/C][C]-1215.6873[/C][C]-2311.8367[/C][C]-119.538[/C][C]0.2593[/C][C]0.3911[/C][C]0.5004[/C][C]0.3735[/C][/ROW]
[ROW][C]50[/C][C]-186.5[/C][C]-151.0087[/C][C]-1280.1959[/C][C]978.1785[/C][C]0.4754[/C][C]0.889[/C][C]0.5427[/C][C]0.9376[/C][/ROW]
[ROW][C]51[/C][C]244[/C][C]-739.7749[/C][C]-1895.0823[/C][C]415.5326[/C][C]0.0476[/C][C]0.174[/C][C]0.2698[/C][C]0.6919[/C][/ROW]
[ROW][C]52[/C][C]-992.6[/C][C]-547.7388[/C][C]-1723.8199[/C][C]628.3422[/C][C]0.2292[/C][C]0.0935[/C][C]0.1489[/C][C]0.7917[/C][/ROW]
[ROW][C]53[/C][C]-335.2[/C][C]-271.6607[/C][C]-1464.3363[/C][C]921.0148[/C][C]0.4584[/C][C]0.8819[/C][C]0.3898[/C][C]0.8952[/C][/ROW]
[ROW][C]54[/C][C]316.8[/C][C]-232.7766[/C][C]-1438.7529[/C][C]973.1997[/C][C]0.1859[/C][C]0.5661[/C][C]0.2307[/C][C]0.9039[/C][/ROW]
[ROW][C]55[/C][C]477.6[/C][C]39.0417[/C][C]-1177.6231[/C][C]1255.7064[/C][C]0.2399[/C][C]0.3273[/C][C]0.231[/C][C]0.9582[/C][/ROW]
[ROW][C]56[/C][C]-572.1[/C][C]-1465.6022[/C][C]-2690.8735[/C][C]-240.3309[/C][C]0.0765[/C][C]9e-04[/C][C]0.2456[/C][C]0.2456[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116493&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116493&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[44])
32-2062.2-------
33-929.7-------
34-720.7-------
35-1541.8-------
36-1432.3-------
37-1216.2-------
38-212.8-------
39-378.2-------
4076.9-------
41-101.3-------
42220.4-------
43495.6-------
44-1035.2-------
4561.8-150.1501-982.2689681.96880.30880.98150.96680.9815
46-734.8-179.1691-1107.5249749.18680.12040.30550.87350.9646
47-6.9-843.7588-1843.4354155.91790.05040.41540.91440.6463
48-1061.1-1341.0395-2395.0603-287.01860.30130.00660.56740.2848
49-854.6-1215.6873-2311.8367-119.5380.25930.39110.50040.3735
50-186.5-151.0087-1280.1959978.17850.47540.8890.54270.9376
51244-739.7749-1895.0823415.53260.04760.1740.26980.6919
52-992.6-547.7388-1723.8199628.34220.22920.09350.14890.7917
53-335.2-271.6607-1464.3363921.01480.45840.88190.38980.8952
54316.8-232.7766-1438.7529973.19970.18590.56610.23070.9039
55477.639.0417-1177.62311255.70640.23990.32730.2310.9582
56-572.1-1465.6022-2690.8735-240.33090.07659e-040.24560.2456







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
45-2.8275-1.41160.117644922.82983743.569261.1847
46-2.64363.10120.2584308725.736225727.1447160.3968
47-0.6045-0.99180.0827700332.594758361.0496241.5803
48-0.401-0.20870.017478366.10276530.508680.8116
49-0.46-0.2970.0248130384.067410865.3389104.2369
50-3.81510.2350.01961259.632104.969310.2455
51-0.7968-1.32980.1108967812.993880651.0828283.9913
52-1.09550.81220.0677197901.45816491.7882128.4204
53-2.240.23390.01954037.2396336.436618.3422
54-2.6433-2.3610.1967302034.436125169.5363158.6491
5515.899611.23310.9361192333.409516027.7841126.6009
56-0.4265-0.60960.0508798346.235466528.853257.9319

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
45 & -2.8275 & -1.4116 & 0.1176 & 44922.8298 & 3743.5692 & 61.1847 \tabularnewline
46 & -2.6436 & 3.1012 & 0.2584 & 308725.7362 & 25727.1447 & 160.3968 \tabularnewline
47 & -0.6045 & -0.9918 & 0.0827 & 700332.5947 & 58361.0496 & 241.5803 \tabularnewline
48 & -0.401 & -0.2087 & 0.0174 & 78366.1027 & 6530.5086 & 80.8116 \tabularnewline
49 & -0.46 & -0.297 & 0.0248 & 130384.0674 & 10865.3389 & 104.2369 \tabularnewline
50 & -3.8151 & 0.235 & 0.0196 & 1259.632 & 104.9693 & 10.2455 \tabularnewline
51 & -0.7968 & -1.3298 & 0.1108 & 967812.9938 & 80651.0828 & 283.9913 \tabularnewline
52 & -1.0955 & 0.8122 & 0.0677 & 197901.458 & 16491.7882 & 128.4204 \tabularnewline
53 & -2.24 & 0.2339 & 0.0195 & 4037.2396 & 336.4366 & 18.3422 \tabularnewline
54 & -2.6433 & -2.361 & 0.1967 & 302034.4361 & 25169.5363 & 158.6491 \tabularnewline
55 & 15.8996 & 11.2331 & 0.9361 & 192333.4095 & 16027.7841 & 126.6009 \tabularnewline
56 & -0.4265 & -0.6096 & 0.0508 & 798346.2354 & 66528.853 & 257.9319 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116493&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]45[/C][C]-2.8275[/C][C]-1.4116[/C][C]0.1176[/C][C]44922.8298[/C][C]3743.5692[/C][C]61.1847[/C][/ROW]
[ROW][C]46[/C][C]-2.6436[/C][C]3.1012[/C][C]0.2584[/C][C]308725.7362[/C][C]25727.1447[/C][C]160.3968[/C][/ROW]
[ROW][C]47[/C][C]-0.6045[/C][C]-0.9918[/C][C]0.0827[/C][C]700332.5947[/C][C]58361.0496[/C][C]241.5803[/C][/ROW]
[ROW][C]48[/C][C]-0.401[/C][C]-0.2087[/C][C]0.0174[/C][C]78366.1027[/C][C]6530.5086[/C][C]80.8116[/C][/ROW]
[ROW][C]49[/C][C]-0.46[/C][C]-0.297[/C][C]0.0248[/C][C]130384.0674[/C][C]10865.3389[/C][C]104.2369[/C][/ROW]
[ROW][C]50[/C][C]-3.8151[/C][C]0.235[/C][C]0.0196[/C][C]1259.632[/C][C]104.9693[/C][C]10.2455[/C][/ROW]
[ROW][C]51[/C][C]-0.7968[/C][C]-1.3298[/C][C]0.1108[/C][C]967812.9938[/C][C]80651.0828[/C][C]283.9913[/C][/ROW]
[ROW][C]52[/C][C]-1.0955[/C][C]0.8122[/C][C]0.0677[/C][C]197901.458[/C][C]16491.7882[/C][C]128.4204[/C][/ROW]
[ROW][C]53[/C][C]-2.24[/C][C]0.2339[/C][C]0.0195[/C][C]4037.2396[/C][C]336.4366[/C][C]18.3422[/C][/ROW]
[ROW][C]54[/C][C]-2.6433[/C][C]-2.361[/C][C]0.1967[/C][C]302034.4361[/C][C]25169.5363[/C][C]158.6491[/C][/ROW]
[ROW][C]55[/C][C]15.8996[/C][C]11.2331[/C][C]0.9361[/C][C]192333.4095[/C][C]16027.7841[/C][C]126.6009[/C][/ROW]
[ROW][C]56[/C][C]-0.4265[/C][C]-0.6096[/C][C]0.0508[/C][C]798346.2354[/C][C]66528.853[/C][C]257.9319[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116493&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116493&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
45-2.8275-1.41160.117644922.82983743.569261.1847
46-2.64363.10120.2584308725.736225727.1447160.3968
47-0.6045-0.99180.0827700332.594758361.0496241.5803
48-0.401-0.20870.017478366.10276530.508680.8116
49-0.46-0.2970.0248130384.067410865.3389104.2369
50-3.81510.2350.01961259.632104.969310.2455
51-0.7968-1.32980.1108967812.993880651.0828283.9913
52-1.09550.81220.0677197901.45816491.7882128.4204
53-2.240.23390.01954037.2396336.436618.3422
54-2.6433-2.3610.1967302034.436125169.5363158.6491
5515.899611.23310.9361192333.409516027.7841126.6009
56-0.4265-0.60960.0508798346.235466528.853257.9319



Parameters (Session):
par1 = FALSE ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 2 ; 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
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.mape <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')