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 computationSun, 17 Dec 2017 00:58:42 +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/17/t1513469391h3h2t8m7yybcwla.htm/, Retrieved Wed, 15 May 2024 19:12:43 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=309949, Retrieved Wed, 15 May 2024 19:12:43 +0000
QR Codes:

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

Post a new message
Dataseries X:
122.2
136.1
145.5
116.7
137.1
125.5
112.4
106.3
145.7
151.5
144.6
116.4
137.7
138.8
149.5
125
133.4
134.4
124.8
110.6
142.4
149.6
134.6
103.3
136.5
137.1
140.7
131.4
126.2
125.3
126.6
107.7
144.5
154.2
131.4
105.7
136.2
133.3
130
129.3
113.1
117.7
116.3
97.3
140.6
141.2
120.8
106.2
121.5
122.6
137.2
118.9
107.2
127.4
111.8
100
138.3
128
121.2
105.9
112.5
123.1
129
115.5
105.7
122.3
106.4
101.1
131.6
119.5
127
106.9
115.9
122.7
137.2
108.5
115.2
129.4
112.3
104.3
140
139.9
134.9
105.1
127
135.5
143.9
115.8
117.5
129.3
117.9
108.1
131.7
143.7
126.2
96.9
125.8
129.6
124.9
136.8
107.5
114.3
110.3
85.5
116.8
115.1
95.2
83.4
95.4
96.3
100.5
90.9
80.6
94.8
93.9
75.9
101.6
103.3
91.8
83.5
92
101.2
109.1
99.8
90.8
110.6
97.8
81.9
114.4
108.8
103.1
90.4
94.4
100.5
115.1
93.9
102.5
97.1
91.2
82.3
107.1
99.2
94.8
81.1
92.5
97.7
98.5
81.2
86.2
92
86.3
74.8
90
101.1
87.8
66.3
88.6
90
92
85.1
85.9
88.5
92.3
68
93.6
97.7
85.1
69.9
96.1
97
95.9
91.3
83.5
91.4
96.8
71
106.9
102.7
84.9
75.8
93.6
100.7
100.5
95.9
85.7
104.1
93.5
81.5
102.1
98.2
88.4
77.8
90.1
101
98.6
91.5
86.4
98.9
85.2
77.3
93
86.8
91.3
74.9
93.9
95
103.1
81.4
93.1
97.2
86.4
75.5




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309949&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 time2 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])
18881.5-------
189102.1-------
19098.2-------
19188.4-------
19277.8-------
19390.1-------
194101-------
19598.6-------
19691.5-------
19786.4-------
19898.9-------
19985.2-------
20077.3-------
2019396.202786.8456106.91380.27890.99970.14030.9997
20286.896.183186.2426107.6660.05460.70650.36530.9994
20391.388.953379.463499.97070.33820.64920.53920.9809
20474.974.985266.982784.27650.49283e-040.27630.3127
20593.987.606977.41399.61690.15220.98090.34210.9537
2069593.448181.935107.15610.41220.47420.14010.9895
207103.195.127782.9174109.78240.14320.50680.32120.9914
20881.485.550174.522198.79740.26960.00470.18930.8889
20993.183.55772.517796.88460.08020.62450.33790.8213
21097.289.727477.285104.90470.16730.33160.11810.9457
21186.483.523871.852597.78470.34630.03010.40890.8038
21275.571.649261.79783.64490.26460.0080.17790.1779

\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 & 81.5 & - & - & - & - & - & - & - \tabularnewline
189 & 102.1 & - & - & - & - & - & - & - \tabularnewline
190 & 98.2 & - & - & - & - & - & - & - \tabularnewline
191 & 88.4 & - & - & - & - & - & - & - \tabularnewline
192 & 77.8 & - & - & - & - & - & - & - \tabularnewline
193 & 90.1 & - & - & - & - & - & - & - \tabularnewline
194 & 101 & - & - & - & - & - & - & - \tabularnewline
195 & 98.6 & - & - & - & - & - & - & - \tabularnewline
196 & 91.5 & - & - & - & - & - & - & - \tabularnewline
197 & 86.4 & - & - & - & - & - & - & - \tabularnewline
198 & 98.9 & - & - & - & - & - & - & - \tabularnewline
199 & 85.2 & - & - & - & - & - & - & - \tabularnewline
200 & 77.3 & - & - & - & - & - & - & - \tabularnewline
201 & 93 & 96.2027 & 86.8456 & 106.9138 & 0.2789 & 0.9997 & 0.1403 & 0.9997 \tabularnewline
202 & 86.8 & 96.1831 & 86.2426 & 107.666 & 0.0546 & 0.7065 & 0.3653 & 0.9994 \tabularnewline
203 & 91.3 & 88.9533 & 79.4634 & 99.9707 & 0.3382 & 0.6492 & 0.5392 & 0.9809 \tabularnewline
204 & 74.9 & 74.9852 & 66.9827 & 84.2765 & 0.4928 & 3e-04 & 0.2763 & 0.3127 \tabularnewline
205 & 93.9 & 87.6069 & 77.413 & 99.6169 & 0.1522 & 0.9809 & 0.3421 & 0.9537 \tabularnewline
206 & 95 & 93.4481 & 81.935 & 107.1561 & 0.4122 & 0.4742 & 0.1401 & 0.9895 \tabularnewline
207 & 103.1 & 95.1277 & 82.9174 & 109.7824 & 0.1432 & 0.5068 & 0.3212 & 0.9914 \tabularnewline
208 & 81.4 & 85.5501 & 74.5221 & 98.7974 & 0.2696 & 0.0047 & 0.1893 & 0.8889 \tabularnewline
209 & 93.1 & 83.557 & 72.5177 & 96.8846 & 0.0802 & 0.6245 & 0.3379 & 0.8213 \tabularnewline
210 & 97.2 & 89.7274 & 77.285 & 104.9047 & 0.1673 & 0.3316 & 0.1181 & 0.9457 \tabularnewline
211 & 86.4 & 83.5238 & 71.8525 & 97.7847 & 0.3463 & 0.0301 & 0.4089 & 0.8038 \tabularnewline
212 & 75.5 & 71.6492 & 61.797 & 83.6449 & 0.2646 & 0.008 & 0.1779 & 0.1779 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309949&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]81.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]102.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]98.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]88.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]77.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]90.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]101[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]98.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]91.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]86.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]98.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]85.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]77.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]93[/C][C]96.2027[/C][C]86.8456[/C][C]106.9138[/C][C]0.2789[/C][C]0.9997[/C][C]0.1403[/C][C]0.9997[/C][/ROW]
[ROW][C]202[/C][C]86.8[/C][C]96.1831[/C][C]86.2426[/C][C]107.666[/C][C]0.0546[/C][C]0.7065[/C][C]0.3653[/C][C]0.9994[/C][/ROW]
[ROW][C]203[/C][C]91.3[/C][C]88.9533[/C][C]79.4634[/C][C]99.9707[/C][C]0.3382[/C][C]0.6492[/C][C]0.5392[/C][C]0.9809[/C][/ROW]
[ROW][C]204[/C][C]74.9[/C][C]74.9852[/C][C]66.9827[/C][C]84.2765[/C][C]0.4928[/C][C]3e-04[/C][C]0.2763[/C][C]0.3127[/C][/ROW]
[ROW][C]205[/C][C]93.9[/C][C]87.6069[/C][C]77.413[/C][C]99.6169[/C][C]0.1522[/C][C]0.9809[/C][C]0.3421[/C][C]0.9537[/C][/ROW]
[ROW][C]206[/C][C]95[/C][C]93.4481[/C][C]81.935[/C][C]107.1561[/C][C]0.4122[/C][C]0.4742[/C][C]0.1401[/C][C]0.9895[/C][/ROW]
[ROW][C]207[/C][C]103.1[/C][C]95.1277[/C][C]82.9174[/C][C]109.7824[/C][C]0.1432[/C][C]0.5068[/C][C]0.3212[/C][C]0.9914[/C][/ROW]
[ROW][C]208[/C][C]81.4[/C][C]85.5501[/C][C]74.5221[/C][C]98.7974[/C][C]0.2696[/C][C]0.0047[/C][C]0.1893[/C][C]0.8889[/C][/ROW]
[ROW][C]209[/C][C]93.1[/C][C]83.557[/C][C]72.5177[/C][C]96.8846[/C][C]0.0802[/C][C]0.6245[/C][C]0.3379[/C][C]0.8213[/C][/ROW]
[ROW][C]210[/C][C]97.2[/C][C]89.7274[/C][C]77.285[/C][C]104.9047[/C][C]0.1673[/C][C]0.3316[/C][C]0.1181[/C][C]0.9457[/C][/ROW]
[ROW][C]211[/C][C]86.4[/C][C]83.5238[/C][C]71.8525[/C][C]97.7847[/C][C]0.3463[/C][C]0.0301[/C][C]0.4089[/C][C]0.8038[/C][/ROW]
[ROW][C]212[/C][C]75.5[/C][C]71.6492[/C][C]61.797[/C][C]83.6449[/C][C]0.2646[/C][C]0.008[/C][C]0.1779[/C][C]0.1779[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309949&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309949&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])
18881.5-------
189102.1-------
19098.2-------
19188.4-------
19277.8-------
19390.1-------
194101-------
19598.6-------
19691.5-------
19786.4-------
19898.9-------
19985.2-------
20077.3-------
2019396.202786.8456106.91380.27890.99970.14030.9997
20286.896.183186.2426107.6660.05460.70650.36530.9994
20391.388.953379.463499.97070.33820.64920.53920.9809
20474.974.985266.982784.27650.49283e-040.27630.3127
20593.987.606977.41399.61690.15220.98090.34210.9537
2069593.448181.935107.15610.41220.47420.14010.9895
207103.195.127782.9174109.78240.14320.50680.32120.9914
20881.485.550174.522198.79740.26960.00470.18930.8889
20993.183.55772.517796.88460.08020.62450.33790.8213
21097.289.727477.285104.90470.16730.33160.11810.9457
21186.483.523871.852597.78470.34630.03010.40890.8038
21275.571.649261.79783.64490.26460.0080.17790.1779







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0568-0.03440.03440.033910.25700-0.30770.3077
2020.0609-0.10810.07130.068288.042849.14997.0107-0.90140.6046
2030.06320.02570.05610.05415.507234.60235.88240.22550.4782
2040.0632-0.00110.04230.04090.007325.95365.0945-0.00820.3607
2050.06990.0670.04730.046639.603528.68355.35570.60460.4095
2060.07480.01630.04210.04162.408324.30434.92990.14910.3661
2070.07860.07730.04720.047163.55829.9125.46920.76590.4232
2080.079-0.0510.04760.047417.223728.3265.3222-0.39870.4201
2090.08140.10250.05370.054291.067935.29735.94120.91680.4753
2100.08630.07690.0560.056855.839437.35156.11160.71790.4996
2110.08710.03330.0540.05478.272634.7085.89130.27630.4793
2120.08540.0510.05370.054514.828433.05135.7490.36990.4702

\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.0568 & -0.0344 & 0.0344 & 0.0339 & 10.257 & 0 & 0 & -0.3077 & 0.3077 \tabularnewline
202 & 0.0609 & -0.1081 & 0.0713 & 0.0682 & 88.0428 & 49.1499 & 7.0107 & -0.9014 & 0.6046 \tabularnewline
203 & 0.0632 & 0.0257 & 0.0561 & 0.0541 & 5.5072 & 34.6023 & 5.8824 & 0.2255 & 0.4782 \tabularnewline
204 & 0.0632 & -0.0011 & 0.0423 & 0.0409 & 0.0073 & 25.9536 & 5.0945 & -0.0082 & 0.3607 \tabularnewline
205 & 0.0699 & 0.067 & 0.0473 & 0.0466 & 39.6035 & 28.6835 & 5.3557 & 0.6046 & 0.4095 \tabularnewline
206 & 0.0748 & 0.0163 & 0.0421 & 0.0416 & 2.4083 & 24.3043 & 4.9299 & 0.1491 & 0.3661 \tabularnewline
207 & 0.0786 & 0.0773 & 0.0472 & 0.0471 & 63.558 & 29.912 & 5.4692 & 0.7659 & 0.4232 \tabularnewline
208 & 0.079 & -0.051 & 0.0476 & 0.0474 & 17.2237 & 28.326 & 5.3222 & -0.3987 & 0.4201 \tabularnewline
209 & 0.0814 & 0.1025 & 0.0537 & 0.0542 & 91.0679 & 35.2973 & 5.9412 & 0.9168 & 0.4753 \tabularnewline
210 & 0.0863 & 0.0769 & 0.056 & 0.0568 & 55.8394 & 37.3515 & 6.1116 & 0.7179 & 0.4996 \tabularnewline
211 & 0.0871 & 0.0333 & 0.054 & 0.0547 & 8.2726 & 34.708 & 5.8913 & 0.2763 & 0.4793 \tabularnewline
212 & 0.0854 & 0.051 & 0.0537 & 0.0545 & 14.8284 & 33.0513 & 5.749 & 0.3699 & 0.4702 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309949&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.0568[/C][C]-0.0344[/C][C]0.0344[/C][C]0.0339[/C][C]10.257[/C][C]0[/C][C]0[/C][C]-0.3077[/C][C]0.3077[/C][/ROW]
[ROW][C]202[/C][C]0.0609[/C][C]-0.1081[/C][C]0.0713[/C][C]0.0682[/C][C]88.0428[/C][C]49.1499[/C][C]7.0107[/C][C]-0.9014[/C][C]0.6046[/C][/ROW]
[ROW][C]203[/C][C]0.0632[/C][C]0.0257[/C][C]0.0561[/C][C]0.0541[/C][C]5.5072[/C][C]34.6023[/C][C]5.8824[/C][C]0.2255[/C][C]0.4782[/C][/ROW]
[ROW][C]204[/C][C]0.0632[/C][C]-0.0011[/C][C]0.0423[/C][C]0.0409[/C][C]0.0073[/C][C]25.9536[/C][C]5.0945[/C][C]-0.0082[/C][C]0.3607[/C][/ROW]
[ROW][C]205[/C][C]0.0699[/C][C]0.067[/C][C]0.0473[/C][C]0.0466[/C][C]39.6035[/C][C]28.6835[/C][C]5.3557[/C][C]0.6046[/C][C]0.4095[/C][/ROW]
[ROW][C]206[/C][C]0.0748[/C][C]0.0163[/C][C]0.0421[/C][C]0.0416[/C][C]2.4083[/C][C]24.3043[/C][C]4.9299[/C][C]0.1491[/C][C]0.3661[/C][/ROW]
[ROW][C]207[/C][C]0.0786[/C][C]0.0773[/C][C]0.0472[/C][C]0.0471[/C][C]63.558[/C][C]29.912[/C][C]5.4692[/C][C]0.7659[/C][C]0.4232[/C][/ROW]
[ROW][C]208[/C][C]0.079[/C][C]-0.051[/C][C]0.0476[/C][C]0.0474[/C][C]17.2237[/C][C]28.326[/C][C]5.3222[/C][C]-0.3987[/C][C]0.4201[/C][/ROW]
[ROW][C]209[/C][C]0.0814[/C][C]0.1025[/C][C]0.0537[/C][C]0.0542[/C][C]91.0679[/C][C]35.2973[/C][C]5.9412[/C][C]0.9168[/C][C]0.4753[/C][/ROW]
[ROW][C]210[/C][C]0.0863[/C][C]0.0769[/C][C]0.056[/C][C]0.0568[/C][C]55.8394[/C][C]37.3515[/C][C]6.1116[/C][C]0.7179[/C][C]0.4996[/C][/ROW]
[ROW][C]211[/C][C]0.0871[/C][C]0.0333[/C][C]0.054[/C][C]0.0547[/C][C]8.2726[/C][C]34.708[/C][C]5.8913[/C][C]0.2763[/C][C]0.4793[/C][/ROW]
[ROW][C]212[/C][C]0.0854[/C][C]0.051[/C][C]0.0537[/C][C]0.0545[/C][C]14.8284[/C][C]33.0513[/C][C]5.749[/C][C]0.3699[/C][C]0.4702[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309949&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309949&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.0568-0.03440.03440.033910.25700-0.30770.3077
2020.0609-0.10810.07130.068288.042849.14997.0107-0.90140.6046
2030.06320.02570.05610.05415.507234.60235.88240.22550.4782
2040.0632-0.00110.04230.04090.007325.95365.0945-0.00820.3607
2050.06990.0670.04730.046639.603528.68355.35570.60460.4095
2060.07480.01630.04210.04162.408324.30434.92990.14910.3661
2070.07860.07730.04720.047163.55829.9125.46920.76590.4232
2080.079-0.0510.04760.047417.223728.3265.3222-0.39870.4201
2090.08140.10250.05370.054291.067935.29735.94120.91680.4753
2100.08630.07690.0560.056855.839437.35156.11160.71790.4996
2110.08710.03330.0540.05478.272634.7085.89130.27630.4793
2120.08540.0510.05370.054514.828433.05135.7490.36990.4702



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