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 computationThu, 01 Feb 2018 09:28:03 +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/2018/Feb/01/t1517473695tatuqrfubonj0fb.htm/, Retrieved Sun, 28 Apr 2024 22:37:56 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=313568, Retrieved Sun, 28 Apr 2024 22:37:56 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact41
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2018-02-01 08:28:03] [e3ae876b7ee0a8c2582bae547f35f1b8] [Current]
Feedback Forum

Post a new message
Dataseries X:
97.7
88.9
96.5
89.5
85.4
84.3
83.7
86.2
90.7
95.7
95.6
97
97.2
86.6
88.4
81.4
86.9
84.9
83.7
86.8
88.3
92.5
94.7
94.5
98.7
88.6
95.2
91.3
91.7
89.3
88.7
91.2
88.6
94.6
96
94.3
102
93.4
96.7
93.7
91.6
89.6
92.9
94.1
92
97.5
92.7
100.7
105.9
95.3
99.8
91.3
90.8
87.1
91.4
86.1
87.1
92.6
96.6
105.3
102.4
98.2
98.6
92.6
87.9
84.1
86.7
84.4
86
90.4
92.9
105.8
106
99.1
99.9
88.1
87.8
87.1
85.9
86.5
84.1
92.1
93.3
98.9
103
98.4
100.7
92.3
89
88.9
85.5
90.1
87
97.1
101.5
103
106.1
96.1
94.2
89.1
85.2
86.5
88
88.4
87.9
95.7
94.8
105.2
108.7
96.1
98.3
88.6
90.8
88.1
91.9
98.5
98.6
100.3
98.7
110.7
115.4
105.4
108
94.5
96.5
91
94.1
96.4
93.1
97.5
102.5
105.7
109.1
97.2
100.3
91.3
94.3
89.5
89.3
93.4
91.9
92.9
93.7
100.1
105.5
110.5
89.5
90.4
89.9
84.6
86.2
83.4
82.9
81.8
87.6
94.6
99.6
96.7
99.8
83.8
82.4
86.8
91
85.3
83.6
94
100.3
107.1
100.7
95.5
92.9
79.2
82
79.3
81.5
76
73.1
80.4
82.1
90.5
98.1
89.5
86.5
77
74.7
73.4
72.5
69.3
75.2
83.5
90.5
92.2
110.5
101.8
107.4
95.5
84.5
81.1
86.2
91.5
84.7
92.2
99.2
104.5
113
100.4
101
84.8
86.5
91.7
94.8
95




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time4 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 time4 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=313568&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]4 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=313568&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313568&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 time4 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[200])
18869.3-------
18975.2-------
19083.5-------
19190.5-------
19292.2-------
193110.5-------
194101.8-------
195107.4-------
19695.5-------
19784.5-------
19881.1-------
19986.2-------
20091.5-------
20184.787.033678.186895.88040.30260.16120.99560.1612
20292.289.139279.168499.110.27370.80860.86620.3213
20399.292.909882.939102.88060.10810.55550.68210.6092
204104.597.193487.2258107.16090.07540.34660.83690.8685
205113105.891795.9361115.84730.08080.6080.18210.9977
206100.497.862387.9067107.81790.30870.00140.21910.8948
207101100.400890.4452110.35640.4530.50010.08410.9601
20884.890.799280.8436100.75480.11880.02230.17740.4451
20986.586.266676.31196.22220.48170.61360.6360.1514
21091.783.758773.803193.71440.0590.29470.69970.0637
21194.886.314776.359196.27030.04740.14450.5090.1537
2129588.397778.442198.35330.09680.10380.27070.2707

\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[200]) \tabularnewline
188 & 69.3 & - & - & - & - & - & - & - \tabularnewline
189 & 75.2 & - & - & - & - & - & - & - \tabularnewline
190 & 83.5 & - & - & - & - & - & - & - \tabularnewline
191 & 90.5 & - & - & - & - & - & - & - \tabularnewline
192 & 92.2 & - & - & - & - & - & - & - \tabularnewline
193 & 110.5 & - & - & - & - & - & - & - \tabularnewline
194 & 101.8 & - & - & - & - & - & - & - \tabularnewline
195 & 107.4 & - & - & - & - & - & - & - \tabularnewline
196 & 95.5 & - & - & - & - & - & - & - \tabularnewline
197 & 84.5 & - & - & - & - & - & - & - \tabularnewline
198 & 81.1 & - & - & - & - & - & - & - \tabularnewline
199 & 86.2 & - & - & - & - & - & - & - \tabularnewline
200 & 91.5 & - & - & - & - & - & - & - \tabularnewline
201 & 84.7 & 87.0336 & 78.1868 & 95.8804 & 0.3026 & 0.1612 & 0.9956 & 0.1612 \tabularnewline
202 & 92.2 & 89.1392 & 79.1684 & 99.11 & 0.2737 & 0.8086 & 0.8662 & 0.3213 \tabularnewline
203 & 99.2 & 92.9098 & 82.939 & 102.8806 & 0.1081 & 0.5555 & 0.6821 & 0.6092 \tabularnewline
204 & 104.5 & 97.1934 & 87.2258 & 107.1609 & 0.0754 & 0.3466 & 0.8369 & 0.8685 \tabularnewline
205 & 113 & 105.8917 & 95.9361 & 115.8473 & 0.0808 & 0.608 & 0.1821 & 0.9977 \tabularnewline
206 & 100.4 & 97.8623 & 87.9067 & 107.8179 & 0.3087 & 0.0014 & 0.2191 & 0.8948 \tabularnewline
207 & 101 & 100.4008 & 90.4452 & 110.3564 & 0.453 & 0.5001 & 0.0841 & 0.9601 \tabularnewline
208 & 84.8 & 90.7992 & 80.8436 & 100.7548 & 0.1188 & 0.0223 & 0.1774 & 0.4451 \tabularnewline
209 & 86.5 & 86.2666 & 76.311 & 96.2222 & 0.4817 & 0.6136 & 0.636 & 0.1514 \tabularnewline
210 & 91.7 & 83.7587 & 73.8031 & 93.7144 & 0.059 & 0.2947 & 0.6997 & 0.0637 \tabularnewline
211 & 94.8 & 86.3147 & 76.3591 & 96.2703 & 0.0474 & 0.1445 & 0.509 & 0.1537 \tabularnewline
212 & 95 & 88.3977 & 78.4421 & 98.3533 & 0.0968 & 0.1038 & 0.2707 & 0.2707 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=313568&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[200])[/C][/ROW]
[ROW][C]188[/C][C]69.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]75.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]83.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]90.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]92.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]110.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]101.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]107.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]95.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]84.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]81.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]86.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]91.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]84.7[/C][C]87.0336[/C][C]78.1868[/C][C]95.8804[/C][C]0.3026[/C][C]0.1612[/C][C]0.9956[/C][C]0.1612[/C][/ROW]
[ROW][C]202[/C][C]92.2[/C][C]89.1392[/C][C]79.1684[/C][C]99.11[/C][C]0.2737[/C][C]0.8086[/C][C]0.8662[/C][C]0.3213[/C][/ROW]
[ROW][C]203[/C][C]99.2[/C][C]92.9098[/C][C]82.939[/C][C]102.8806[/C][C]0.1081[/C][C]0.5555[/C][C]0.6821[/C][C]0.6092[/C][/ROW]
[ROW][C]204[/C][C]104.5[/C][C]97.1934[/C][C]87.2258[/C][C]107.1609[/C][C]0.0754[/C][C]0.3466[/C][C]0.8369[/C][C]0.8685[/C][/ROW]
[ROW][C]205[/C][C]113[/C][C]105.8917[/C][C]95.9361[/C][C]115.8473[/C][C]0.0808[/C][C]0.608[/C][C]0.1821[/C][C]0.9977[/C][/ROW]
[ROW][C]206[/C][C]100.4[/C][C]97.8623[/C][C]87.9067[/C][C]107.8179[/C][C]0.3087[/C][C]0.0014[/C][C]0.2191[/C][C]0.8948[/C][/ROW]
[ROW][C]207[/C][C]101[/C][C]100.4008[/C][C]90.4452[/C][C]110.3564[/C][C]0.453[/C][C]0.5001[/C][C]0.0841[/C][C]0.9601[/C][/ROW]
[ROW][C]208[/C][C]84.8[/C][C]90.7992[/C][C]80.8436[/C][C]100.7548[/C][C]0.1188[/C][C]0.0223[/C][C]0.1774[/C][C]0.4451[/C][/ROW]
[ROW][C]209[/C][C]86.5[/C][C]86.2666[/C][C]76.311[/C][C]96.2222[/C][C]0.4817[/C][C]0.6136[/C][C]0.636[/C][C]0.1514[/C][/ROW]
[ROW][C]210[/C][C]91.7[/C][C]83.7587[/C][C]73.8031[/C][C]93.7144[/C][C]0.059[/C][C]0.2947[/C][C]0.6997[/C][C]0.0637[/C][/ROW]
[ROW][C]211[/C][C]94.8[/C][C]86.3147[/C][C]76.3591[/C][C]96.2703[/C][C]0.0474[/C][C]0.1445[/C][C]0.509[/C][C]0.1537[/C][/ROW]
[ROW][C]212[/C][C]95[/C][C]88.3977[/C][C]78.4421[/C][C]98.3533[/C][C]0.0968[/C][C]0.1038[/C][C]0.2707[/C][C]0.2707[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=313568&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313568&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[200])
18869.3-------
18975.2-------
19083.5-------
19190.5-------
19292.2-------
193110.5-------
194101.8-------
195107.4-------
19695.5-------
19784.5-------
19881.1-------
19986.2-------
20091.5-------
20184.787.033678.186895.88040.30260.16120.99560.1612
20292.289.139279.168499.110.27370.80860.86620.3213
20399.292.909882.939102.88060.10810.55550.68210.6092
204104.597.193487.2258107.16090.07540.34660.83690.8685
205113105.891795.9361115.84730.08080.6080.18210.9977
206100.497.862387.9067107.81790.30870.00140.21910.8948
207101100.400890.4452110.35640.4530.50010.08410.9601
20884.890.799280.8436100.75480.11880.02230.17740.4451
20986.586.266676.31196.22220.48170.61360.6360.1514
21091.783.758773.803193.71440.0590.29470.69970.0637
21194.886.314776.359196.27030.04740.14450.5090.1537
2129588.397778.442198.35330.09680.10380.27070.2707







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0519-0.02760.02760.02725.445800-0.37810.3781
2020.05710.03320.03040.03059.36857.40712.72160.49590.437
2030.05480.06340.04140.042139.566218.12684.25761.0190.631
2040.05230.06990.04850.049753.386926.94195.19061.18370.7692
2050.0480.06290.05140.052850.527931.65915.62661.15160.8456
2060.05190.02530.0470.04826.439727.45595.23980.41110.7732
2070.05060.00590.04120.04220.35923.58494.85640.09710.6766
2080.0559-0.07070.04490.045535.990625.13565.0135-0.97190.7135
2090.05890.00270.04020.04070.054522.34884.72750.03780.6385
2100.06060.08660.04480.045763.063526.42035.14011.28650.7033
2110.05880.08950.04890.050172.000230.56395.52851.37460.7643
2120.05750.06950.05060.051943.590831.64955.62581.06960.7897

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
201 & 0.0519 & -0.0276 & 0.0276 & 0.0272 & 5.4458 & 0 & 0 & -0.3781 & 0.3781 \tabularnewline
202 & 0.0571 & 0.0332 & 0.0304 & 0.0305 & 9.3685 & 7.4071 & 2.7216 & 0.4959 & 0.437 \tabularnewline
203 & 0.0548 & 0.0634 & 0.0414 & 0.0421 & 39.5662 & 18.1268 & 4.2576 & 1.019 & 0.631 \tabularnewline
204 & 0.0523 & 0.0699 & 0.0485 & 0.0497 & 53.3869 & 26.9419 & 5.1906 & 1.1837 & 0.7692 \tabularnewline
205 & 0.048 & 0.0629 & 0.0514 & 0.0528 & 50.5279 & 31.6591 & 5.6266 & 1.1516 & 0.8456 \tabularnewline
206 & 0.0519 & 0.0253 & 0.047 & 0.0482 & 6.4397 & 27.4559 & 5.2398 & 0.4111 & 0.7732 \tabularnewline
207 & 0.0506 & 0.0059 & 0.0412 & 0.0422 & 0.359 & 23.5849 & 4.8564 & 0.0971 & 0.6766 \tabularnewline
208 & 0.0559 & -0.0707 & 0.0449 & 0.0455 & 35.9906 & 25.1356 & 5.0135 & -0.9719 & 0.7135 \tabularnewline
209 & 0.0589 & 0.0027 & 0.0402 & 0.0407 & 0.0545 & 22.3488 & 4.7275 & 0.0378 & 0.6385 \tabularnewline
210 & 0.0606 & 0.0866 & 0.0448 & 0.0457 & 63.0635 & 26.4203 & 5.1401 & 1.2865 & 0.7033 \tabularnewline
211 & 0.0588 & 0.0895 & 0.0489 & 0.0501 & 72.0002 & 30.5639 & 5.5285 & 1.3746 & 0.7643 \tabularnewline
212 & 0.0575 & 0.0695 & 0.0506 & 0.0519 & 43.5908 & 31.6495 & 5.6258 & 1.0696 & 0.7897 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=313568&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]201[/C][C]0.0519[/C][C]-0.0276[/C][C]0.0276[/C][C]0.0272[/C][C]5.4458[/C][C]0[/C][C]0[/C][C]-0.3781[/C][C]0.3781[/C][/ROW]
[ROW][C]202[/C][C]0.0571[/C][C]0.0332[/C][C]0.0304[/C][C]0.0305[/C][C]9.3685[/C][C]7.4071[/C][C]2.7216[/C][C]0.4959[/C][C]0.437[/C][/ROW]
[ROW][C]203[/C][C]0.0548[/C][C]0.0634[/C][C]0.0414[/C][C]0.0421[/C][C]39.5662[/C][C]18.1268[/C][C]4.2576[/C][C]1.019[/C][C]0.631[/C][/ROW]
[ROW][C]204[/C][C]0.0523[/C][C]0.0699[/C][C]0.0485[/C][C]0.0497[/C][C]53.3869[/C][C]26.9419[/C][C]5.1906[/C][C]1.1837[/C][C]0.7692[/C][/ROW]
[ROW][C]205[/C][C]0.048[/C][C]0.0629[/C][C]0.0514[/C][C]0.0528[/C][C]50.5279[/C][C]31.6591[/C][C]5.6266[/C][C]1.1516[/C][C]0.8456[/C][/ROW]
[ROW][C]206[/C][C]0.0519[/C][C]0.0253[/C][C]0.047[/C][C]0.0482[/C][C]6.4397[/C][C]27.4559[/C][C]5.2398[/C][C]0.4111[/C][C]0.7732[/C][/ROW]
[ROW][C]207[/C][C]0.0506[/C][C]0.0059[/C][C]0.0412[/C][C]0.0422[/C][C]0.359[/C][C]23.5849[/C][C]4.8564[/C][C]0.0971[/C][C]0.6766[/C][/ROW]
[ROW][C]208[/C][C]0.0559[/C][C]-0.0707[/C][C]0.0449[/C][C]0.0455[/C][C]35.9906[/C][C]25.1356[/C][C]5.0135[/C][C]-0.9719[/C][C]0.7135[/C][/ROW]
[ROW][C]209[/C][C]0.0589[/C][C]0.0027[/C][C]0.0402[/C][C]0.0407[/C][C]0.0545[/C][C]22.3488[/C][C]4.7275[/C][C]0.0378[/C][C]0.6385[/C][/ROW]
[ROW][C]210[/C][C]0.0606[/C][C]0.0866[/C][C]0.0448[/C][C]0.0457[/C][C]63.0635[/C][C]26.4203[/C][C]5.1401[/C][C]1.2865[/C][C]0.7033[/C][/ROW]
[ROW][C]211[/C][C]0.0588[/C][C]0.0895[/C][C]0.0489[/C][C]0.0501[/C][C]72.0002[/C][C]30.5639[/C][C]5.5285[/C][C]1.3746[/C][C]0.7643[/C][/ROW]
[ROW][C]212[/C][C]0.0575[/C][C]0.0695[/C][C]0.0506[/C][C]0.0519[/C][C]43.5908[/C][C]31.6495[/C][C]5.6258[/C][C]1.0696[/C][C]0.7897[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=313568&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313568&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
2010.0519-0.02760.02760.02725.445800-0.37810.3781
2020.05710.03320.03040.03059.36857.40712.72160.49590.437
2030.05480.06340.04140.042139.566218.12684.25761.0190.631
2040.05230.06990.04850.049753.386926.94195.19061.18370.7692
2050.0480.06290.05140.052850.527931.65915.62661.15160.8456
2060.05190.02530.0470.04826.439727.45595.23980.41110.7732
2070.05060.00590.04120.04220.35923.58494.85640.09710.6766
2080.0559-0.07070.04490.045535.990625.13565.0135-0.97190.7135
2090.05890.00270.04020.04070.054522.34884.72750.03780.6385
2100.06060.08660.04480.045763.063526.42035.14011.28650.7033
2110.05880.08950.04890.050172.000230.56395.52851.37460.7643
2120.05750.06950.05060.051943.590831.64955.62581.06960.7897



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