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 13:06:29 +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/t1513512395lzjix0ee3y4j65j.htm/, Retrieved Wed, 15 May 2024 12:17:57 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=309960, Retrieved Wed, 15 May 2024 12:17:57 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact106
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2017-12-17 12:06:29] [8829069b4432872c842806a35f4fa8df] [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=309960&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=309960&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309960&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.5000000000001-------
189102.1-------
19098.2000000000001-------
19188.4000000000001-------
19277.8-------
19390.1-------
194101-------
19598.6000000000001-------
19691.5-------
19786.4-------
19898.9-------
19985.2-------
20077.3-------
2019399.977790.0127110.92470.105810.3521
20286.896.171586.3606106.97440.04450.71750.35640.9997
20391.389.07479.364399.83990.34260.66060.54880.984
20474.974.577164.919485.50910.47690.00140.28170.3127
20593.988.623477.0607101.72470.21490.980.41260.9549
2069596.450383.2199111.54470.42530.62970.27730.9936
207103.196.488882.404112.70450.21210.57140.39930.9898
20881.488.190974.8424103.64520.19450.02930.33740.9164
20993.184.370.902999.93380.1350.64190.39620.8099
21097.293.513478.2324111.43010.34340.5180.27780.9619
21186.486.056471.4873103.24540.48440.10190.53890.841
21275.573.894860.77589.51080.42020.05830.33450.3345

\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.5000000000001 & - & - & - & - & - & - & - \tabularnewline
189 & 102.1 & - & - & - & - & - & - & - \tabularnewline
190 & 98.2000000000001 & - & - & - & - & - & - & - \tabularnewline
191 & 88.4000000000001 & - & - & - & - & - & - & - \tabularnewline
192 & 77.8 & - & - & - & - & - & - & - \tabularnewline
193 & 90.1 & - & - & - & - & - & - & - \tabularnewline
194 & 101 & - & - & - & - & - & - & - \tabularnewline
195 & 98.6000000000001 & - & - & - & - & - & - & - \tabularnewline
196 & 91.5 & - & - & - & - & - & - & - \tabularnewline
197 & 86.4 & - & - & - & - & - & - & - \tabularnewline
198 & 98.9 & - & - & - & - & - & - & - \tabularnewline
199 & 85.2 & - & - & - & - & - & - & - \tabularnewline
200 & 77.3 & - & - & - & - & - & - & - \tabularnewline
201 & 93 & 99.9777 & 90.0127 & 110.9247 & 0.1058 & 1 & 0.352 & 1 \tabularnewline
202 & 86.8 & 96.1715 & 86.3606 & 106.9744 & 0.0445 & 0.7175 & 0.3564 & 0.9997 \tabularnewline
203 & 91.3 & 89.074 & 79.3643 & 99.8399 & 0.3426 & 0.6606 & 0.5488 & 0.984 \tabularnewline
204 & 74.9 & 74.5771 & 64.9194 & 85.5091 & 0.4769 & 0.0014 & 0.2817 & 0.3127 \tabularnewline
205 & 93.9 & 88.6234 & 77.0607 & 101.7247 & 0.2149 & 0.98 & 0.4126 & 0.9549 \tabularnewline
206 & 95 & 96.4503 & 83.2199 & 111.5447 & 0.4253 & 0.6297 & 0.2773 & 0.9936 \tabularnewline
207 & 103.1 & 96.4888 & 82.404 & 112.7045 & 0.2121 & 0.5714 & 0.3993 & 0.9898 \tabularnewline
208 & 81.4 & 88.1909 & 74.8424 & 103.6452 & 0.1945 & 0.0293 & 0.3374 & 0.9164 \tabularnewline
209 & 93.1 & 84.3 & 70.9029 & 99.9338 & 0.135 & 0.6419 & 0.3962 & 0.8099 \tabularnewline
210 & 97.2 & 93.5134 & 78.2324 & 111.4301 & 0.3434 & 0.518 & 0.2778 & 0.9619 \tabularnewline
211 & 86.4 & 86.0564 & 71.4873 & 103.2454 & 0.4844 & 0.1019 & 0.5389 & 0.841 \tabularnewline
212 & 75.5 & 73.8948 & 60.775 & 89.5108 & 0.4202 & 0.0583 & 0.3345 & 0.3345 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309960&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.5000000000001[/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.2000000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]88.4000000000001[/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.6000000000001[/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]99.9777[/C][C]90.0127[/C][C]110.9247[/C][C]0.1058[/C][C]1[/C][C]0.352[/C][C]1[/C][/ROW]
[ROW][C]202[/C][C]86.8[/C][C]96.1715[/C][C]86.3606[/C][C]106.9744[/C][C]0.0445[/C][C]0.7175[/C][C]0.3564[/C][C]0.9997[/C][/ROW]
[ROW][C]203[/C][C]91.3[/C][C]89.074[/C][C]79.3643[/C][C]99.8399[/C][C]0.3426[/C][C]0.6606[/C][C]0.5488[/C][C]0.984[/C][/ROW]
[ROW][C]204[/C][C]74.9[/C][C]74.5771[/C][C]64.9194[/C][C]85.5091[/C][C]0.4769[/C][C]0.0014[/C][C]0.2817[/C][C]0.3127[/C][/ROW]
[ROW][C]205[/C][C]93.9[/C][C]88.6234[/C][C]77.0607[/C][C]101.7247[/C][C]0.2149[/C][C]0.98[/C][C]0.4126[/C][C]0.9549[/C][/ROW]
[ROW][C]206[/C][C]95[/C][C]96.4503[/C][C]83.2199[/C][C]111.5447[/C][C]0.4253[/C][C]0.6297[/C][C]0.2773[/C][C]0.9936[/C][/ROW]
[ROW][C]207[/C][C]103.1[/C][C]96.4888[/C][C]82.404[/C][C]112.7045[/C][C]0.2121[/C][C]0.5714[/C][C]0.3993[/C][C]0.9898[/C][/ROW]
[ROW][C]208[/C][C]81.4[/C][C]88.1909[/C][C]74.8424[/C][C]103.6452[/C][C]0.1945[/C][C]0.0293[/C][C]0.3374[/C][C]0.9164[/C][/ROW]
[ROW][C]209[/C][C]93.1[/C][C]84.3[/C][C]70.9029[/C][C]99.9338[/C][C]0.135[/C][C]0.6419[/C][C]0.3962[/C][C]0.8099[/C][/ROW]
[ROW][C]210[/C][C]97.2[/C][C]93.5134[/C][C]78.2324[/C][C]111.4301[/C][C]0.3434[/C][C]0.518[/C][C]0.2778[/C][C]0.9619[/C][/ROW]
[ROW][C]211[/C][C]86.4[/C][C]86.0564[/C][C]71.4873[/C][C]103.2454[/C][C]0.4844[/C][C]0.1019[/C][C]0.5389[/C][C]0.841[/C][/ROW]
[ROW][C]212[/C][C]75.5[/C][C]73.8948[/C][C]60.775[/C][C]89.5108[/C][C]0.4202[/C][C]0.0583[/C][C]0.3345[/C][C]0.3345[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309960&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309960&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.5000000000001-------
189102.1-------
19098.2000000000001-------
19188.4000000000001-------
19277.8-------
19390.1-------
194101-------
19598.6000000000001-------
19691.5-------
19786.4-------
19898.9-------
19985.2-------
20077.3-------
2019399.977790.0127110.92470.105810.3521
20286.896.171586.3606106.97440.04450.71750.35640.9997
20391.389.07479.364399.83990.34260.66060.54880.984
20474.974.577164.919485.50910.47690.00140.28170.3127
20593.988.623477.0607101.72470.21490.980.41260.9549
2069596.450383.2199111.54470.42530.62970.27730.9936
207103.196.488882.404112.70450.21210.57140.39930.9898
20881.488.190974.8424103.64520.19450.02930.33740.9164
20993.184.370.902999.93380.1350.64190.39620.8099
21097.293.513478.2324111.43010.34340.5180.27780.9619
21186.486.056471.4873103.24540.48440.10190.53890.841
21275.573.894860.77589.51080.42020.05830.33450.3345







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0559-0.0750.0750.072348.687600-0.67030.6703
2020.0573-0.1080.09150.087487.825868.25678.2618-0.90030.7853
2030.06170.02440.06910.06654.955347.15626.8670.21390.5948
2040.07480.00430.05290.05090.104335.39325.94920.0310.4539
2050.07540.05620.05360.052327.84333.88325.82090.50690.4645
2060.0798-0.01530.04720.04612.103428.58665.3466-0.13930.4103
2070.08570.06410.04960.04943.707530.74675.5450.63510.4424
2080.0894-0.08340.05380.052946.116832.6685.7156-0.65240.4687
2090.09460.09450.05840.05877.439737.64266.13540.84540.5105
2100.09780.03790.05630.056113.59135.23745.93610.35420.4949
2110.10190.0040.05160.05140.118132.04485.66080.0330.4529
2120.10780.02130.0490.04892.576629.58915.43960.15420.428

\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.0559 & -0.075 & 0.075 & 0.0723 & 48.6876 & 0 & 0 & -0.6703 & 0.6703 \tabularnewline
202 & 0.0573 & -0.108 & 0.0915 & 0.0874 & 87.8258 & 68.2567 & 8.2618 & -0.9003 & 0.7853 \tabularnewline
203 & 0.0617 & 0.0244 & 0.0691 & 0.0665 & 4.9553 & 47.1562 & 6.867 & 0.2139 & 0.5948 \tabularnewline
204 & 0.0748 & 0.0043 & 0.0529 & 0.0509 & 0.1043 & 35.3932 & 5.9492 & 0.031 & 0.4539 \tabularnewline
205 & 0.0754 & 0.0562 & 0.0536 & 0.0523 & 27.843 & 33.8832 & 5.8209 & 0.5069 & 0.4645 \tabularnewline
206 & 0.0798 & -0.0153 & 0.0472 & 0.0461 & 2.1034 & 28.5866 & 5.3466 & -0.1393 & 0.4103 \tabularnewline
207 & 0.0857 & 0.0641 & 0.0496 & 0.049 & 43.7075 & 30.7467 & 5.545 & 0.6351 & 0.4424 \tabularnewline
208 & 0.0894 & -0.0834 & 0.0538 & 0.0529 & 46.1168 & 32.668 & 5.7156 & -0.6524 & 0.4687 \tabularnewline
209 & 0.0946 & 0.0945 & 0.0584 & 0.058 & 77.4397 & 37.6426 & 6.1354 & 0.8454 & 0.5105 \tabularnewline
210 & 0.0978 & 0.0379 & 0.0563 & 0.0561 & 13.591 & 35.2374 & 5.9361 & 0.3542 & 0.4949 \tabularnewline
211 & 0.1019 & 0.004 & 0.0516 & 0.0514 & 0.1181 & 32.0448 & 5.6608 & 0.033 & 0.4529 \tabularnewline
212 & 0.1078 & 0.0213 & 0.049 & 0.0489 & 2.5766 & 29.5891 & 5.4396 & 0.1542 & 0.428 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309960&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.0559[/C][C]-0.075[/C][C]0.075[/C][C]0.0723[/C][C]48.6876[/C][C]0[/C][C]0[/C][C]-0.6703[/C][C]0.6703[/C][/ROW]
[ROW][C]202[/C][C]0.0573[/C][C]-0.108[/C][C]0.0915[/C][C]0.0874[/C][C]87.8258[/C][C]68.2567[/C][C]8.2618[/C][C]-0.9003[/C][C]0.7853[/C][/ROW]
[ROW][C]203[/C][C]0.0617[/C][C]0.0244[/C][C]0.0691[/C][C]0.0665[/C][C]4.9553[/C][C]47.1562[/C][C]6.867[/C][C]0.2139[/C][C]0.5948[/C][/ROW]
[ROW][C]204[/C][C]0.0748[/C][C]0.0043[/C][C]0.0529[/C][C]0.0509[/C][C]0.1043[/C][C]35.3932[/C][C]5.9492[/C][C]0.031[/C][C]0.4539[/C][/ROW]
[ROW][C]205[/C][C]0.0754[/C][C]0.0562[/C][C]0.0536[/C][C]0.0523[/C][C]27.843[/C][C]33.8832[/C][C]5.8209[/C][C]0.5069[/C][C]0.4645[/C][/ROW]
[ROW][C]206[/C][C]0.0798[/C][C]-0.0153[/C][C]0.0472[/C][C]0.0461[/C][C]2.1034[/C][C]28.5866[/C][C]5.3466[/C][C]-0.1393[/C][C]0.4103[/C][/ROW]
[ROW][C]207[/C][C]0.0857[/C][C]0.0641[/C][C]0.0496[/C][C]0.049[/C][C]43.7075[/C][C]30.7467[/C][C]5.545[/C][C]0.6351[/C][C]0.4424[/C][/ROW]
[ROW][C]208[/C][C]0.0894[/C][C]-0.0834[/C][C]0.0538[/C][C]0.0529[/C][C]46.1168[/C][C]32.668[/C][C]5.7156[/C][C]-0.6524[/C][C]0.4687[/C][/ROW]
[ROW][C]209[/C][C]0.0946[/C][C]0.0945[/C][C]0.0584[/C][C]0.058[/C][C]77.4397[/C][C]37.6426[/C][C]6.1354[/C][C]0.8454[/C][C]0.5105[/C][/ROW]
[ROW][C]210[/C][C]0.0978[/C][C]0.0379[/C][C]0.0563[/C][C]0.0561[/C][C]13.591[/C][C]35.2374[/C][C]5.9361[/C][C]0.3542[/C][C]0.4949[/C][/ROW]
[ROW][C]211[/C][C]0.1019[/C][C]0.004[/C][C]0.0516[/C][C]0.0514[/C][C]0.1181[/C][C]32.0448[/C][C]5.6608[/C][C]0.033[/C][C]0.4529[/C][/ROW]
[ROW][C]212[/C][C]0.1078[/C][C]0.0213[/C][C]0.049[/C][C]0.0489[/C][C]2.5766[/C][C]29.5891[/C][C]5.4396[/C][C]0.1542[/C][C]0.428[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309960&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309960&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.0559-0.0750.0750.072348.687600-0.67030.6703
2020.0573-0.1080.09150.087487.825868.25678.2618-0.90030.7853
2030.06170.02440.06910.06654.955347.15626.8670.21390.5948
2040.07480.00430.05290.05090.104335.39325.94920.0310.4539
2050.07540.05620.05360.052327.84333.88325.82090.50690.4645
2060.0798-0.01530.04720.04612.103428.58665.3466-0.13930.4103
2070.08570.06410.04960.04943.707530.74675.5450.63510.4424
2080.0894-0.08340.05380.052946.116832.6685.7156-0.65240.4687
2090.09460.09450.05840.05877.439737.64266.13540.84540.5105
2100.09780.03790.05630.056113.59135.23745.93610.35420.4949
2110.10190.0040.05160.05140.118132.04485.66080.0330.4529
2120.10780.02130.0490.04892.576629.58915.43960.15420.428



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