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 11:35:57 +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/t1517481428g4p4a85ooh9mkhd.htm/, Retrieved Mon, 29 Apr 2024 05:59:18 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=314798, Retrieved Mon, 29 Apr 2024 05:59:18 +0000
QR Codes:

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

Post a new message
Dataseries X:
62.4
67.4
76.1
67.4
74.5
72.6
60.5
66.1
76.5
76.8
77
71
74.8
73.7
80.5
71.8
76.9
79.9
65.9
69.5
75.1
79.6
75.2
68
72.8
71.5
78.5
76.8
75.3
76.7
69.7
67.8
77.5
82.5
75.3
70.9
76
73.7
79.7
77.8
73.3
78.3
71.9
67
82
83.7
74.8
80
74.3
76.8
89
81.9
76.8
88.9
75.8
75.5
89.1
88
85.9
89.3
82.9
81.2
90.5
86.4
81.8
91.3
73.4
76.6
91
87
89.7
90.7
86.5
86.6
98.8
84.4
91.4
95.7
78.5
81.7
94.3
98.5
95.4
91.7
92.8
90.5
102.2
91.8
95
102
88.9
89.6
97.9
108.6
100.8
95.1
101
100.9
102.5
105.4
98.4
105.3
96.5
88.1
107.9
107
92.5
95.7
85.2
85.5
94.7
86.2
88.8
93.4
83.4
82.9
96.7
96.2
92.8
92.8
90
95.4
108.3
96.3
95
109
92
92.3
107
105.5
105.4
103.9
99.2
102.2
121.5
102.3
110
105.9
91.9
100
111.7
104.9
103.3
101.8
100.8
104.2
116.5
97.9
100.7
107
96.3
96
104.5
107.4
102.4
94.9
98.8
96.8
108.2
103.8
102.3
107.2
102
92.6
105.2
113
105.6
101.6
101.7
102.7
109
105.5
103.3
108.6
98.2
90
112.4
111.9
102.1
102.4
101.7
98.7
114
105.1
98.3
110
96.5
92.2
112
111.4
107.5
103.4
103.5
107.4
117.6
110.2
104.3
115.9
98.9
101.9
113.5
109.5
110
114.2
106.9
109.2
124.2
104.7
111.9
119
102.9
106.3




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314798&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 time11 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])
18892.2-------
189112-------
190111.4-------
191107.5-------
192103.4-------
193103.5-------
194107.4-------
195117.6-------
196110.2-------
197104.3-------
198115.9-------
19998.9-------
200101.9-------
201113.5115.1697108.7962121.54310.303810.83521
202109.5114.117107.5244120.70960.08490.57280.79040.9999
203110112.0822105.1313119.03310.27860.76670.90180.998
204114.2108.8029100.5589117.04690.09970.3880.90050.9496
205106.9107.381898.887115.87660.45570.05780.81480.897
206109.2109.8199100.8272118.81260.44630.73770.70110.9578
207124.2118.9041109.2587128.54940.14090.97570.60450.9997
208104.7110.899100.9443120.85380.11110.00440.55470.9618
209111.9110.7299100.3061121.15360.41290.87160.88670.9516
210119116.6465105.7733127.51960.33570.80390.55350.9961
211102.9103.835892.6279115.04360.4350.0040.8060.6325
212106.3104.210292.5932115.82720.36220.58750.65160.6516

\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 & 92.2 & - & - & - & - & - & - & - \tabularnewline
189 & 112 & - & - & - & - & - & - & - \tabularnewline
190 & 111.4 & - & - & - & - & - & - & - \tabularnewline
191 & 107.5 & - & - & - & - & - & - & - \tabularnewline
192 & 103.4 & - & - & - & - & - & - & - \tabularnewline
193 & 103.5 & - & - & - & - & - & - & - \tabularnewline
194 & 107.4 & - & - & - & - & - & - & - \tabularnewline
195 & 117.6 & - & - & - & - & - & - & - \tabularnewline
196 & 110.2 & - & - & - & - & - & - & - \tabularnewline
197 & 104.3 & - & - & - & - & - & - & - \tabularnewline
198 & 115.9 & - & - & - & - & - & - & - \tabularnewline
199 & 98.9 & - & - & - & - & - & - & - \tabularnewline
200 & 101.9 & - & - & - & - & - & - & - \tabularnewline
201 & 113.5 & 115.1697 & 108.7962 & 121.5431 & 0.3038 & 1 & 0.8352 & 1 \tabularnewline
202 & 109.5 & 114.117 & 107.5244 & 120.7096 & 0.0849 & 0.5728 & 0.7904 & 0.9999 \tabularnewline
203 & 110 & 112.0822 & 105.1313 & 119.0331 & 0.2786 & 0.7667 & 0.9018 & 0.998 \tabularnewline
204 & 114.2 & 108.8029 & 100.5589 & 117.0469 & 0.0997 & 0.388 & 0.9005 & 0.9496 \tabularnewline
205 & 106.9 & 107.3818 & 98.887 & 115.8766 & 0.4557 & 0.0578 & 0.8148 & 0.897 \tabularnewline
206 & 109.2 & 109.8199 & 100.8272 & 118.8126 & 0.4463 & 0.7377 & 0.7011 & 0.9578 \tabularnewline
207 & 124.2 & 118.9041 & 109.2587 & 128.5494 & 0.1409 & 0.9757 & 0.6045 & 0.9997 \tabularnewline
208 & 104.7 & 110.899 & 100.9443 & 120.8538 & 0.1111 & 0.0044 & 0.5547 & 0.9618 \tabularnewline
209 & 111.9 & 110.7299 & 100.3061 & 121.1536 & 0.4129 & 0.8716 & 0.8867 & 0.9516 \tabularnewline
210 & 119 & 116.6465 & 105.7733 & 127.5196 & 0.3357 & 0.8039 & 0.5535 & 0.9961 \tabularnewline
211 & 102.9 & 103.8358 & 92.6279 & 115.0436 & 0.435 & 0.004 & 0.806 & 0.6325 \tabularnewline
212 & 106.3 & 104.2102 & 92.5932 & 115.8272 & 0.3622 & 0.5875 & 0.6516 & 0.6516 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=314798&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]92.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]112[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]111.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]107.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]103.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]103.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]107.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]117.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]110.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]104.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]115.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]98.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]101.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]113.5[/C][C]115.1697[/C][C]108.7962[/C][C]121.5431[/C][C]0.3038[/C][C]1[/C][C]0.8352[/C][C]1[/C][/ROW]
[ROW][C]202[/C][C]109.5[/C][C]114.117[/C][C]107.5244[/C][C]120.7096[/C][C]0.0849[/C][C]0.5728[/C][C]0.7904[/C][C]0.9999[/C][/ROW]
[ROW][C]203[/C][C]110[/C][C]112.0822[/C][C]105.1313[/C][C]119.0331[/C][C]0.2786[/C][C]0.7667[/C][C]0.9018[/C][C]0.998[/C][/ROW]
[ROW][C]204[/C][C]114.2[/C][C]108.8029[/C][C]100.5589[/C][C]117.0469[/C][C]0.0997[/C][C]0.388[/C][C]0.9005[/C][C]0.9496[/C][/ROW]
[ROW][C]205[/C][C]106.9[/C][C]107.3818[/C][C]98.887[/C][C]115.8766[/C][C]0.4557[/C][C]0.0578[/C][C]0.8148[/C][C]0.897[/C][/ROW]
[ROW][C]206[/C][C]109.2[/C][C]109.8199[/C][C]100.8272[/C][C]118.8126[/C][C]0.4463[/C][C]0.7377[/C][C]0.7011[/C][C]0.9578[/C][/ROW]
[ROW][C]207[/C][C]124.2[/C][C]118.9041[/C][C]109.2587[/C][C]128.5494[/C][C]0.1409[/C][C]0.9757[/C][C]0.6045[/C][C]0.9997[/C][/ROW]
[ROW][C]208[/C][C]104.7[/C][C]110.899[/C][C]100.9443[/C][C]120.8538[/C][C]0.1111[/C][C]0.0044[/C][C]0.5547[/C][C]0.9618[/C][/ROW]
[ROW][C]209[/C][C]111.9[/C][C]110.7299[/C][C]100.3061[/C][C]121.1536[/C][C]0.4129[/C][C]0.8716[/C][C]0.8867[/C][C]0.9516[/C][/ROW]
[ROW][C]210[/C][C]119[/C][C]116.6465[/C][C]105.7733[/C][C]127.5196[/C][C]0.3357[/C][C]0.8039[/C][C]0.5535[/C][C]0.9961[/C][/ROW]
[ROW][C]211[/C][C]102.9[/C][C]103.8358[/C][C]92.6279[/C][C]115.0436[/C][C]0.435[/C][C]0.004[/C][C]0.806[/C][C]0.6325[/C][/ROW]
[ROW][C]212[/C][C]106.3[/C][C]104.2102[/C][C]92.5932[/C][C]115.8272[/C][C]0.3622[/C][C]0.5875[/C][C]0.6516[/C][C]0.6516[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=314798&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314798&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])
18892.2-------
189112-------
190111.4-------
191107.5-------
192103.4-------
193103.5-------
194107.4-------
195117.6-------
196110.2-------
197104.3-------
198115.9-------
19998.9-------
200101.9-------
201113.5115.1697108.7962121.54310.303810.83521
202109.5114.117107.5244120.70960.08490.57280.79040.9999
203110112.0822105.1313119.03310.27860.76670.90180.998
204114.2108.8029100.5589117.04690.09970.3880.90050.9496
205106.9107.381898.887115.87660.45570.05780.81480.897
206109.2109.8199100.8272118.81260.44630.73770.70110.9578
207124.2118.9041109.2587128.54940.14090.97570.60450.9997
208104.7110.899100.9443120.85380.11110.00440.55470.9618
209111.9110.7299100.3061121.15360.41290.87160.88670.9516
210119116.6465105.7733127.51960.33570.80390.55350.9961
211102.9103.835892.6279115.04360.4350.0040.8060.6325
212106.3104.210292.5932115.82720.36220.58750.65160.6516







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0282-0.01470.01470.01462.787800-0.21210.2121
2020.0295-0.04220.02840.027921.31712.05243.4717-0.58650.3993
2030.0316-0.01890.02530.02494.33569.48013.079-0.26450.3543
2040.03870.04730.03080.030829.128614.39223.79370.68550.4371
2050.0404-0.00450.02550.02550.232111.56023.4-0.06120.362
2060.0418-0.00570.02220.02220.38439.69753.1141-0.07870.3148
2070.04140.04260.02510.025328.04712.31893.50980.67270.3659
2080.0458-0.05920.02940.029338.427915.58253.9475-0.78740.4186
2090.0480.01050.02730.02721.369214.00333.74210.14860.3886
2100.04760.01980.02650.02655.539113.15693.62720.29890.3796
2110.0551-0.00910.02490.02490.875712.04043.4699-0.11890.3559
2120.05690.01970.02450.02454.367211.40093.37650.26540.3484

\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.0282 & -0.0147 & 0.0147 & 0.0146 & 2.7878 & 0 & 0 & -0.2121 & 0.2121 \tabularnewline
202 & 0.0295 & -0.0422 & 0.0284 & 0.0279 & 21.317 & 12.0524 & 3.4717 & -0.5865 & 0.3993 \tabularnewline
203 & 0.0316 & -0.0189 & 0.0253 & 0.0249 & 4.3356 & 9.4801 & 3.079 & -0.2645 & 0.3543 \tabularnewline
204 & 0.0387 & 0.0473 & 0.0308 & 0.0308 & 29.1286 & 14.3922 & 3.7937 & 0.6855 & 0.4371 \tabularnewline
205 & 0.0404 & -0.0045 & 0.0255 & 0.0255 & 0.2321 & 11.5602 & 3.4 & -0.0612 & 0.362 \tabularnewline
206 & 0.0418 & -0.0057 & 0.0222 & 0.0222 & 0.3843 & 9.6975 & 3.1141 & -0.0787 & 0.3148 \tabularnewline
207 & 0.0414 & 0.0426 & 0.0251 & 0.0253 & 28.047 & 12.3189 & 3.5098 & 0.6727 & 0.3659 \tabularnewline
208 & 0.0458 & -0.0592 & 0.0294 & 0.0293 & 38.4279 & 15.5825 & 3.9475 & -0.7874 & 0.4186 \tabularnewline
209 & 0.048 & 0.0105 & 0.0273 & 0.0272 & 1.3692 & 14.0033 & 3.7421 & 0.1486 & 0.3886 \tabularnewline
210 & 0.0476 & 0.0198 & 0.0265 & 0.0265 & 5.5391 & 13.1569 & 3.6272 & 0.2989 & 0.3796 \tabularnewline
211 & 0.0551 & -0.0091 & 0.0249 & 0.0249 & 0.8757 & 12.0404 & 3.4699 & -0.1189 & 0.3559 \tabularnewline
212 & 0.0569 & 0.0197 & 0.0245 & 0.0245 & 4.3672 & 11.4009 & 3.3765 & 0.2654 & 0.3484 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=314798&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.0282[/C][C]-0.0147[/C][C]0.0147[/C][C]0.0146[/C][C]2.7878[/C][C]0[/C][C]0[/C][C]-0.2121[/C][C]0.2121[/C][/ROW]
[ROW][C]202[/C][C]0.0295[/C][C]-0.0422[/C][C]0.0284[/C][C]0.0279[/C][C]21.317[/C][C]12.0524[/C][C]3.4717[/C][C]-0.5865[/C][C]0.3993[/C][/ROW]
[ROW][C]203[/C][C]0.0316[/C][C]-0.0189[/C][C]0.0253[/C][C]0.0249[/C][C]4.3356[/C][C]9.4801[/C][C]3.079[/C][C]-0.2645[/C][C]0.3543[/C][/ROW]
[ROW][C]204[/C][C]0.0387[/C][C]0.0473[/C][C]0.0308[/C][C]0.0308[/C][C]29.1286[/C][C]14.3922[/C][C]3.7937[/C][C]0.6855[/C][C]0.4371[/C][/ROW]
[ROW][C]205[/C][C]0.0404[/C][C]-0.0045[/C][C]0.0255[/C][C]0.0255[/C][C]0.2321[/C][C]11.5602[/C][C]3.4[/C][C]-0.0612[/C][C]0.362[/C][/ROW]
[ROW][C]206[/C][C]0.0418[/C][C]-0.0057[/C][C]0.0222[/C][C]0.0222[/C][C]0.3843[/C][C]9.6975[/C][C]3.1141[/C][C]-0.0787[/C][C]0.3148[/C][/ROW]
[ROW][C]207[/C][C]0.0414[/C][C]0.0426[/C][C]0.0251[/C][C]0.0253[/C][C]28.047[/C][C]12.3189[/C][C]3.5098[/C][C]0.6727[/C][C]0.3659[/C][/ROW]
[ROW][C]208[/C][C]0.0458[/C][C]-0.0592[/C][C]0.0294[/C][C]0.0293[/C][C]38.4279[/C][C]15.5825[/C][C]3.9475[/C][C]-0.7874[/C][C]0.4186[/C][/ROW]
[ROW][C]209[/C][C]0.048[/C][C]0.0105[/C][C]0.0273[/C][C]0.0272[/C][C]1.3692[/C][C]14.0033[/C][C]3.7421[/C][C]0.1486[/C][C]0.3886[/C][/ROW]
[ROW][C]210[/C][C]0.0476[/C][C]0.0198[/C][C]0.0265[/C][C]0.0265[/C][C]5.5391[/C][C]13.1569[/C][C]3.6272[/C][C]0.2989[/C][C]0.3796[/C][/ROW]
[ROW][C]211[/C][C]0.0551[/C][C]-0.0091[/C][C]0.0249[/C][C]0.0249[/C][C]0.8757[/C][C]12.0404[/C][C]3.4699[/C][C]-0.1189[/C][C]0.3559[/C][/ROW]
[ROW][C]212[/C][C]0.0569[/C][C]0.0197[/C][C]0.0245[/C][C]0.0245[/C][C]4.3672[/C][C]11.4009[/C][C]3.3765[/C][C]0.2654[/C][C]0.3484[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=314798&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314798&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.0282-0.01470.01470.01462.787800-0.21210.2121
2020.0295-0.04220.02840.027921.31712.05243.4717-0.58650.3993
2030.0316-0.01890.02530.02494.33569.48013.079-0.26450.3543
2040.03870.04730.03080.030829.128614.39223.79370.68550.4371
2050.0404-0.00450.02550.02550.232111.56023.4-0.06120.362
2060.0418-0.00570.02220.02220.38439.69753.1141-0.07870.3148
2070.04140.04260.02510.025328.04712.31893.50980.67270.3659
2080.0458-0.05920.02940.029338.427915.58253.9475-0.78740.4186
2090.0480.01050.02730.02721.369214.00333.74210.14860.3886
2100.04760.01980.02650.02655.539113.15693.62720.29890.3796
2110.0551-0.00910.02490.02490.875712.04043.4699-0.11890.3559
2120.05690.01970.02450.02454.367211.40093.37650.26540.3484



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