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 computationSat, 23 Dec 2017 12:20:17 +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/23/t1514036620pc5kx0i0rmzx8ce.htm/, Retrieved Wed, 15 May 2024 06:40:49 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310857, Retrieved Wed, 15 May 2024 06:40:49 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact88
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima forecasting] [2017-12-23 11:20:17] [1cdffd72486a8dae23479df836ed99fd] [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=310857&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=310857&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310857&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.5000000000001-------
19786.4-------
19898.9-------
19985.2-------
20077.3-------
2019399.759589.4514111.52640.13010.99990.34830.9999
20286.898.584987.8207110.97190.03110.81160.52430.9996
20391.389.290179.219100.93750.36760.66240.55950.9782
20474.976.246867.504286.3840.39730.00180.3820.4193
20593.989.33978.3463102.23540.24410.98590.4540.9664
2069595.748283.3552110.41920.46020.59750.24150.9931
207103.197.427784.3287113.04580.23830.61970.44150.9942
20881.488.268976.2313102.6610.17480.02170.330.9324
20993.184.83873.000899.0550.12730.68220.41480.8506
21097.293.245879.6315109.75080.31930.50690.2510.9709
21186.484.901172.3881100.10160.42340.05640.48460.8365
21275.574.675863.651488.07270.4520.04310.35050.3505

\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.5000000000001 & - & - & - & - & - & - & - \tabularnewline
197 & 86.4 & - & - & - & - & - & - & - \tabularnewline
198 & 98.9 & - & - & - & - & - & - & - \tabularnewline
199 & 85.2 & - & - & - & - & - & - & - \tabularnewline
200 & 77.3 & - & - & - & - & - & - & - \tabularnewline
201 & 93 & 99.7595 & 89.4514 & 111.5264 & 0.1301 & 0.9999 & 0.3483 & 0.9999 \tabularnewline
202 & 86.8 & 98.5849 & 87.8207 & 110.9719 & 0.0311 & 0.8116 & 0.5243 & 0.9996 \tabularnewline
203 & 91.3 & 89.2901 & 79.219 & 100.9375 & 0.3676 & 0.6624 & 0.5595 & 0.9782 \tabularnewline
204 & 74.9 & 76.2468 & 67.5042 & 86.384 & 0.3973 & 0.0018 & 0.382 & 0.4193 \tabularnewline
205 & 93.9 & 89.339 & 78.3463 & 102.2354 & 0.2441 & 0.9859 & 0.454 & 0.9664 \tabularnewline
206 & 95 & 95.7482 & 83.3552 & 110.4192 & 0.4602 & 0.5975 & 0.2415 & 0.9931 \tabularnewline
207 & 103.1 & 97.4277 & 84.3287 & 113.0458 & 0.2383 & 0.6197 & 0.4415 & 0.9942 \tabularnewline
208 & 81.4 & 88.2689 & 76.2313 & 102.661 & 0.1748 & 0.0217 & 0.33 & 0.9324 \tabularnewline
209 & 93.1 & 84.838 & 73.0008 & 99.055 & 0.1273 & 0.6822 & 0.4148 & 0.8506 \tabularnewline
210 & 97.2 & 93.2458 & 79.6315 & 109.7508 & 0.3193 & 0.5069 & 0.251 & 0.9709 \tabularnewline
211 & 86.4 & 84.9011 & 72.3881 & 100.1016 & 0.4234 & 0.0564 & 0.4846 & 0.8365 \tabularnewline
212 & 75.5 & 74.6758 & 63.6514 & 88.0727 & 0.452 & 0.0431 & 0.3505 & 0.3505 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310857&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.5000000000001[/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.7595[/C][C]89.4514[/C][C]111.5264[/C][C]0.1301[/C][C]0.9999[/C][C]0.3483[/C][C]0.9999[/C][/ROW]
[ROW][C]202[/C][C]86.8[/C][C]98.5849[/C][C]87.8207[/C][C]110.9719[/C][C]0.0311[/C][C]0.8116[/C][C]0.5243[/C][C]0.9996[/C][/ROW]
[ROW][C]203[/C][C]91.3[/C][C]89.2901[/C][C]79.219[/C][C]100.9375[/C][C]0.3676[/C][C]0.6624[/C][C]0.5595[/C][C]0.9782[/C][/ROW]
[ROW][C]204[/C][C]74.9[/C][C]76.2468[/C][C]67.5042[/C][C]86.384[/C][C]0.3973[/C][C]0.0018[/C][C]0.382[/C][C]0.4193[/C][/ROW]
[ROW][C]205[/C][C]93.9[/C][C]89.339[/C][C]78.3463[/C][C]102.2354[/C][C]0.2441[/C][C]0.9859[/C][C]0.454[/C][C]0.9664[/C][/ROW]
[ROW][C]206[/C][C]95[/C][C]95.7482[/C][C]83.3552[/C][C]110.4192[/C][C]0.4602[/C][C]0.5975[/C][C]0.2415[/C][C]0.9931[/C][/ROW]
[ROW][C]207[/C][C]103.1[/C][C]97.4277[/C][C]84.3287[/C][C]113.0458[/C][C]0.2383[/C][C]0.6197[/C][C]0.4415[/C][C]0.9942[/C][/ROW]
[ROW][C]208[/C][C]81.4[/C][C]88.2689[/C][C]76.2313[/C][C]102.661[/C][C]0.1748[/C][C]0.0217[/C][C]0.33[/C][C]0.9324[/C][/ROW]
[ROW][C]209[/C][C]93.1[/C][C]84.838[/C][C]73.0008[/C][C]99.055[/C][C]0.1273[/C][C]0.6822[/C][C]0.4148[/C][C]0.8506[/C][/ROW]
[ROW][C]210[/C][C]97.2[/C][C]93.2458[/C][C]79.6315[/C][C]109.7508[/C][C]0.3193[/C][C]0.5069[/C][C]0.251[/C][C]0.9709[/C][/ROW]
[ROW][C]211[/C][C]86.4[/C][C]84.9011[/C][C]72.3881[/C][C]100.1016[/C][C]0.4234[/C][C]0.0564[/C][C]0.4846[/C][C]0.8365[/C][/ROW]
[ROW][C]212[/C][C]75.5[/C][C]74.6758[/C][C]63.6514[/C][C]88.0727[/C][C]0.452[/C][C]0.0431[/C][C]0.3505[/C][C]0.3505[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310857&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310857&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.5000000000001-------
19786.4-------
19898.9-------
19985.2-------
20077.3-------
2019399.759589.4514111.52640.13010.99990.34830.9999
20286.898.584987.8207110.97190.03110.81160.52430.9996
20391.389.290179.219100.93750.36760.66240.55950.9782
20474.976.246867.504286.3840.39730.00180.3820.4193
20593.989.33978.3463102.23540.24410.98590.4540.9664
2069595.748283.3552110.41920.46020.59750.24150.9931
207103.197.427784.3287113.04580.23830.61970.44150.9942
20881.488.268976.2313102.6610.17480.02170.330.9324
20993.184.83873.000899.0550.12730.68220.41480.8506
21097.293.245879.6315109.75080.31930.50690.2510.9709
21186.484.901172.3881100.10160.42340.05640.48460.8365
21275.574.675863.651488.07270.4520.04310.35050.3505







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0602-0.07270.07270.070145.690900-0.64940.6494
2020.0641-0.13580.10420.0986138.88592.2889.6067-1.13220.8908
2030.06660.0220.07680.07324.039562.87187.92920.19310.6582
2040.0678-0.0180.06210.05931.813947.60736.8998-0.12940.526
2050.07360.04860.05940.057420.802842.24646.49970.43820.5084
2060.0782-0.00790.05080.04920.559835.29875.9413-0.07190.4357
2070.08180.0550.05140.050232.174934.85245.90360.54490.4513
2080.0832-0.08440.05550.054147.18236.39366.0327-0.65990.4774
2090.08550.08870.05920.058468.2639.93436.31940.79370.5125
2100.09030.04070.05740.056715.635937.50456.12410.37990.4993
2110.09130.01730.05370.05312.246634.29925.85660.1440.467
2120.09150.01090.05020.04960.679331.49765.61230.07920.4346

\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.0602 & -0.0727 & 0.0727 & 0.0701 & 45.6909 & 0 & 0 & -0.6494 & 0.6494 \tabularnewline
202 & 0.0641 & -0.1358 & 0.1042 & 0.0986 & 138.885 & 92.288 & 9.6067 & -1.1322 & 0.8908 \tabularnewline
203 & 0.0666 & 0.022 & 0.0768 & 0.0732 & 4.0395 & 62.8718 & 7.9292 & 0.1931 & 0.6582 \tabularnewline
204 & 0.0678 & -0.018 & 0.0621 & 0.0593 & 1.8139 & 47.6073 & 6.8998 & -0.1294 & 0.526 \tabularnewline
205 & 0.0736 & 0.0486 & 0.0594 & 0.0574 & 20.8028 & 42.2464 & 6.4997 & 0.4382 & 0.5084 \tabularnewline
206 & 0.0782 & -0.0079 & 0.0508 & 0.0492 & 0.5598 & 35.2987 & 5.9413 & -0.0719 & 0.4357 \tabularnewline
207 & 0.0818 & 0.055 & 0.0514 & 0.0502 & 32.1749 & 34.8524 & 5.9036 & 0.5449 & 0.4513 \tabularnewline
208 & 0.0832 & -0.0844 & 0.0555 & 0.0541 & 47.182 & 36.3936 & 6.0327 & -0.6599 & 0.4774 \tabularnewline
209 & 0.0855 & 0.0887 & 0.0592 & 0.0584 & 68.26 & 39.9343 & 6.3194 & 0.7937 & 0.5125 \tabularnewline
210 & 0.0903 & 0.0407 & 0.0574 & 0.0567 & 15.6359 & 37.5045 & 6.1241 & 0.3799 & 0.4993 \tabularnewline
211 & 0.0913 & 0.0173 & 0.0537 & 0.0531 & 2.2466 & 34.2992 & 5.8566 & 0.144 & 0.467 \tabularnewline
212 & 0.0915 & 0.0109 & 0.0502 & 0.0496 & 0.6793 & 31.4976 & 5.6123 & 0.0792 & 0.4346 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310857&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.0602[/C][C]-0.0727[/C][C]0.0727[/C][C]0.0701[/C][C]45.6909[/C][C]0[/C][C]0[/C][C]-0.6494[/C][C]0.6494[/C][/ROW]
[ROW][C]202[/C][C]0.0641[/C][C]-0.1358[/C][C]0.1042[/C][C]0.0986[/C][C]138.885[/C][C]92.288[/C][C]9.6067[/C][C]-1.1322[/C][C]0.8908[/C][/ROW]
[ROW][C]203[/C][C]0.0666[/C][C]0.022[/C][C]0.0768[/C][C]0.0732[/C][C]4.0395[/C][C]62.8718[/C][C]7.9292[/C][C]0.1931[/C][C]0.6582[/C][/ROW]
[ROW][C]204[/C][C]0.0678[/C][C]-0.018[/C][C]0.0621[/C][C]0.0593[/C][C]1.8139[/C][C]47.6073[/C][C]6.8998[/C][C]-0.1294[/C][C]0.526[/C][/ROW]
[ROW][C]205[/C][C]0.0736[/C][C]0.0486[/C][C]0.0594[/C][C]0.0574[/C][C]20.8028[/C][C]42.2464[/C][C]6.4997[/C][C]0.4382[/C][C]0.5084[/C][/ROW]
[ROW][C]206[/C][C]0.0782[/C][C]-0.0079[/C][C]0.0508[/C][C]0.0492[/C][C]0.5598[/C][C]35.2987[/C][C]5.9413[/C][C]-0.0719[/C][C]0.4357[/C][/ROW]
[ROW][C]207[/C][C]0.0818[/C][C]0.055[/C][C]0.0514[/C][C]0.0502[/C][C]32.1749[/C][C]34.8524[/C][C]5.9036[/C][C]0.5449[/C][C]0.4513[/C][/ROW]
[ROW][C]208[/C][C]0.0832[/C][C]-0.0844[/C][C]0.0555[/C][C]0.0541[/C][C]47.182[/C][C]36.3936[/C][C]6.0327[/C][C]-0.6599[/C][C]0.4774[/C][/ROW]
[ROW][C]209[/C][C]0.0855[/C][C]0.0887[/C][C]0.0592[/C][C]0.0584[/C][C]68.26[/C][C]39.9343[/C][C]6.3194[/C][C]0.7937[/C][C]0.5125[/C][/ROW]
[ROW][C]210[/C][C]0.0903[/C][C]0.0407[/C][C]0.0574[/C][C]0.0567[/C][C]15.6359[/C][C]37.5045[/C][C]6.1241[/C][C]0.3799[/C][C]0.4993[/C][/ROW]
[ROW][C]211[/C][C]0.0913[/C][C]0.0173[/C][C]0.0537[/C][C]0.0531[/C][C]2.2466[/C][C]34.2992[/C][C]5.8566[/C][C]0.144[/C][C]0.467[/C][/ROW]
[ROW][C]212[/C][C]0.0915[/C][C]0.0109[/C][C]0.0502[/C][C]0.0496[/C][C]0.6793[/C][C]31.4976[/C][C]5.6123[/C][C]0.0792[/C][C]0.4346[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310857&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310857&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.0602-0.07270.07270.070145.690900-0.64940.6494
2020.0641-0.13580.10420.0986138.88592.2889.6067-1.13220.8908
2030.06660.0220.07680.07324.039562.87187.92920.19310.6582
2040.0678-0.0180.06210.05931.813947.60736.8998-0.12940.526
2050.07360.04860.05940.057420.802842.24646.49970.43820.5084
2060.0782-0.00790.05080.04920.559835.29875.9413-0.07190.4357
2070.08180.0550.05140.050232.174934.85245.90360.54490.4513
2080.0832-0.08440.05550.054147.18236.39366.0327-0.65990.4774
2090.08550.08870.05920.058468.2639.93436.31940.79370.5125
2100.09030.04070.05740.056715.635937.50456.12410.37990.4993
2110.09130.01730.05370.05312.246634.29925.85660.1440.467
2120.09150.01090.05020.04960.679331.49765.61230.07920.4346



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