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 computationWed, 30 Jan 2019 16:47:15 +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/2019/Jan/30/t1548864309vbm8codtlimkgzo.htm/, Retrieved Sun, 28 Apr 2024 04:45:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=317055, Retrieved Sun, 28 Apr 2024 04:45:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact89
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2019-01-30 15:47:15] [5a8386ea105441dc8dedaeca452a37dc] [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 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=317055&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=317055&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=317055&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])
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.5119.7314108.6348131.96150.1590.99790.89230.9979
202109.5120.4862104.9024138.38520.11450.77790.84010.9791
203110115.046596.9829136.47460.32220.6940.7550.8854
204114.2111.549491.4601136.05120.4160.54930.74280.7799
205106.9111.022688.7875138.82620.38570.41140.7020.7399
206109.2112.808588.158144.35160.41130.64320.63160.7511
207124.2124.731195.3885163.09980.48920.78620.64220.8783
208104.7115.09786.2318153.62440.29840.32160.59840.749
209111.9112.972482.9934153.78040.47950.65440.66150.7026
210119121.50687.5895168.55550.45840.65550.59230.793
211102.9104.959974.2891148.29330.46290.26270.6080.555
212106.3105.580873.4105151.8490.48780.54520.5620.562

\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 & 119.7314 & 108.6348 & 131.9615 & 0.159 & 0.9979 & 0.8923 & 0.9979 \tabularnewline
202 & 109.5 & 120.4862 & 104.9024 & 138.3852 & 0.1145 & 0.7779 & 0.8401 & 0.9791 \tabularnewline
203 & 110 & 115.0465 & 96.9829 & 136.4746 & 0.3222 & 0.694 & 0.755 & 0.8854 \tabularnewline
204 & 114.2 & 111.5494 & 91.4601 & 136.0512 & 0.416 & 0.5493 & 0.7428 & 0.7799 \tabularnewline
205 & 106.9 & 111.0226 & 88.7875 & 138.8262 & 0.3857 & 0.4114 & 0.702 & 0.7399 \tabularnewline
206 & 109.2 & 112.8085 & 88.158 & 144.3516 & 0.4113 & 0.6432 & 0.6316 & 0.7511 \tabularnewline
207 & 124.2 & 124.7311 & 95.3885 & 163.0998 & 0.4892 & 0.7862 & 0.6422 & 0.8783 \tabularnewline
208 & 104.7 & 115.097 & 86.2318 & 153.6244 & 0.2984 & 0.3216 & 0.5984 & 0.749 \tabularnewline
209 & 111.9 & 112.9724 & 82.9934 & 153.7804 & 0.4795 & 0.6544 & 0.6615 & 0.7026 \tabularnewline
210 & 119 & 121.506 & 87.5895 & 168.5555 & 0.4584 & 0.6555 & 0.5923 & 0.793 \tabularnewline
211 & 102.9 & 104.9599 & 74.2891 & 148.2933 & 0.4629 & 0.2627 & 0.608 & 0.555 \tabularnewline
212 & 106.3 & 105.5808 & 73.4105 & 151.849 & 0.4878 & 0.5452 & 0.562 & 0.562 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=317055&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]119.7314[/C][C]108.6348[/C][C]131.9615[/C][C]0.159[/C][C]0.9979[/C][C]0.8923[/C][C]0.9979[/C][/ROW]
[ROW][C]202[/C][C]109.5[/C][C]120.4862[/C][C]104.9024[/C][C]138.3852[/C][C]0.1145[/C][C]0.7779[/C][C]0.8401[/C][C]0.9791[/C][/ROW]
[ROW][C]203[/C][C]110[/C][C]115.0465[/C][C]96.9829[/C][C]136.4746[/C][C]0.3222[/C][C]0.694[/C][C]0.755[/C][C]0.8854[/C][/ROW]
[ROW][C]204[/C][C]114.2[/C][C]111.5494[/C][C]91.4601[/C][C]136.0512[/C][C]0.416[/C][C]0.5493[/C][C]0.7428[/C][C]0.7799[/C][/ROW]
[ROW][C]205[/C][C]106.9[/C][C]111.0226[/C][C]88.7875[/C][C]138.8262[/C][C]0.3857[/C][C]0.4114[/C][C]0.702[/C][C]0.7399[/C][/ROW]
[ROW][C]206[/C][C]109.2[/C][C]112.8085[/C][C]88.158[/C][C]144.3516[/C][C]0.4113[/C][C]0.6432[/C][C]0.6316[/C][C]0.7511[/C][/ROW]
[ROW][C]207[/C][C]124.2[/C][C]124.7311[/C][C]95.3885[/C][C]163.0998[/C][C]0.4892[/C][C]0.7862[/C][C]0.6422[/C][C]0.8783[/C][/ROW]
[ROW][C]208[/C][C]104.7[/C][C]115.097[/C][C]86.2318[/C][C]153.6244[/C][C]0.2984[/C][C]0.3216[/C][C]0.5984[/C][C]0.749[/C][/ROW]
[ROW][C]209[/C][C]111.9[/C][C]112.9724[/C][C]82.9934[/C][C]153.7804[/C][C]0.4795[/C][C]0.6544[/C][C]0.6615[/C][C]0.7026[/C][/ROW]
[ROW][C]210[/C][C]119[/C][C]121.506[/C][C]87.5895[/C][C]168.5555[/C][C]0.4584[/C][C]0.6555[/C][C]0.5923[/C][C]0.793[/C][/ROW]
[ROW][C]211[/C][C]102.9[/C][C]104.9599[/C][C]74.2891[/C][C]148.2933[/C][C]0.4629[/C][C]0.2627[/C][C]0.608[/C][C]0.555[/C][/ROW]
[ROW][C]212[/C][C]106.3[/C][C]105.5808[/C][C]73.4105[/C][C]151.849[/C][C]0.4878[/C][C]0.5452[/C][C]0.562[/C][C]0.562[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=317055&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=317055&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.5119.7314108.6348131.96150.1590.99790.89230.9979
202109.5120.4862104.9024138.38520.11450.77790.84010.9791
203110115.046596.9829136.47460.32220.6940.7550.8854
204114.2111.549491.4601136.05120.4160.54930.74280.7799
205106.9111.022688.7875138.82620.38570.41140.7020.7399
206109.2112.808588.158144.35160.41130.64320.63160.7511
207124.2124.731195.3885163.09980.48920.78620.64220.8783
208104.7115.09786.2318153.62440.29840.32160.59840.749
209111.9112.972482.9934153.78040.47950.65440.66150.7026
210119121.50687.5895168.55550.45840.65550.59230.793
211102.9104.959974.2891148.29330.46290.26270.6080.555
212106.3105.580873.4105151.8490.48780.54520.5620.562







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0521-0.05490.05490.053438.830700-0.79150.7915
2020.0758-0.10030.07760.0745120.697279.7648.9311-1.39551.0935
2030.095-0.04590.0670.064625.467661.66527.8527-0.6410.9427
2040.11210.02320.05610.05437.025848.00536.92860.33670.7912
2050.1278-0.03860.05260.05116.996241.80356.4656-0.52370.7377
2060.1427-0.0330.04930.047913.02137.00646.0833-0.45840.6911
2070.1569-0.00430.04290.04170.282131.76015.6356-0.06750.602
2080.1708-0.09930.04990.0483108.096941.30226.4267-1.32060.6919
2090.1843-0.00960.04550.0441.1536.84086.0697-0.13620.6301
2100.1976-0.02110.0430.04176.279933.78475.8125-0.31830.5989
2110.2106-0.020.04090.03974.243131.09915.5767-0.26160.5683
2120.22360.00680.03810.0370.517228.55065.34330.09140.5285

\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.0521 & -0.0549 & 0.0549 & 0.0534 & 38.8307 & 0 & 0 & -0.7915 & 0.7915 \tabularnewline
202 & 0.0758 & -0.1003 & 0.0776 & 0.0745 & 120.6972 & 79.764 & 8.9311 & -1.3955 & 1.0935 \tabularnewline
203 & 0.095 & -0.0459 & 0.067 & 0.0646 & 25.4676 & 61.6652 & 7.8527 & -0.641 & 0.9427 \tabularnewline
204 & 0.1121 & 0.0232 & 0.0561 & 0.0543 & 7.0258 & 48.0053 & 6.9286 & 0.3367 & 0.7912 \tabularnewline
205 & 0.1278 & -0.0386 & 0.0526 & 0.051 & 16.9962 & 41.8035 & 6.4656 & -0.5237 & 0.7377 \tabularnewline
206 & 0.1427 & -0.033 & 0.0493 & 0.0479 & 13.021 & 37.0064 & 6.0833 & -0.4584 & 0.6911 \tabularnewline
207 & 0.1569 & -0.0043 & 0.0429 & 0.0417 & 0.2821 & 31.7601 & 5.6356 & -0.0675 & 0.602 \tabularnewline
208 & 0.1708 & -0.0993 & 0.0499 & 0.0483 & 108.0969 & 41.3022 & 6.4267 & -1.3206 & 0.6919 \tabularnewline
209 & 0.1843 & -0.0096 & 0.0455 & 0.044 & 1.15 & 36.8408 & 6.0697 & -0.1362 & 0.6301 \tabularnewline
210 & 0.1976 & -0.0211 & 0.043 & 0.0417 & 6.2799 & 33.7847 & 5.8125 & -0.3183 & 0.5989 \tabularnewline
211 & 0.2106 & -0.02 & 0.0409 & 0.0397 & 4.2431 & 31.0991 & 5.5767 & -0.2616 & 0.5683 \tabularnewline
212 & 0.2236 & 0.0068 & 0.0381 & 0.037 & 0.5172 & 28.5506 & 5.3433 & 0.0914 & 0.5285 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=317055&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.0521[/C][C]-0.0549[/C][C]0.0549[/C][C]0.0534[/C][C]38.8307[/C][C]0[/C][C]0[/C][C]-0.7915[/C][C]0.7915[/C][/ROW]
[ROW][C]202[/C][C]0.0758[/C][C]-0.1003[/C][C]0.0776[/C][C]0.0745[/C][C]120.6972[/C][C]79.764[/C][C]8.9311[/C][C]-1.3955[/C][C]1.0935[/C][/ROW]
[ROW][C]203[/C][C]0.095[/C][C]-0.0459[/C][C]0.067[/C][C]0.0646[/C][C]25.4676[/C][C]61.6652[/C][C]7.8527[/C][C]-0.641[/C][C]0.9427[/C][/ROW]
[ROW][C]204[/C][C]0.1121[/C][C]0.0232[/C][C]0.0561[/C][C]0.0543[/C][C]7.0258[/C][C]48.0053[/C][C]6.9286[/C][C]0.3367[/C][C]0.7912[/C][/ROW]
[ROW][C]205[/C][C]0.1278[/C][C]-0.0386[/C][C]0.0526[/C][C]0.051[/C][C]16.9962[/C][C]41.8035[/C][C]6.4656[/C][C]-0.5237[/C][C]0.7377[/C][/ROW]
[ROW][C]206[/C][C]0.1427[/C][C]-0.033[/C][C]0.0493[/C][C]0.0479[/C][C]13.021[/C][C]37.0064[/C][C]6.0833[/C][C]-0.4584[/C][C]0.6911[/C][/ROW]
[ROW][C]207[/C][C]0.1569[/C][C]-0.0043[/C][C]0.0429[/C][C]0.0417[/C][C]0.2821[/C][C]31.7601[/C][C]5.6356[/C][C]-0.0675[/C][C]0.602[/C][/ROW]
[ROW][C]208[/C][C]0.1708[/C][C]-0.0993[/C][C]0.0499[/C][C]0.0483[/C][C]108.0969[/C][C]41.3022[/C][C]6.4267[/C][C]-1.3206[/C][C]0.6919[/C][/ROW]
[ROW][C]209[/C][C]0.1843[/C][C]-0.0096[/C][C]0.0455[/C][C]0.044[/C][C]1.15[/C][C]36.8408[/C][C]6.0697[/C][C]-0.1362[/C][C]0.6301[/C][/ROW]
[ROW][C]210[/C][C]0.1976[/C][C]-0.0211[/C][C]0.043[/C][C]0.0417[/C][C]6.2799[/C][C]33.7847[/C][C]5.8125[/C][C]-0.3183[/C][C]0.5989[/C][/ROW]
[ROW][C]211[/C][C]0.2106[/C][C]-0.02[/C][C]0.0409[/C][C]0.0397[/C][C]4.2431[/C][C]31.0991[/C][C]5.5767[/C][C]-0.2616[/C][C]0.5683[/C][/ROW]
[ROW][C]212[/C][C]0.2236[/C][C]0.0068[/C][C]0.0381[/C][C]0.037[/C][C]0.5172[/C][C]28.5506[/C][C]5.3433[/C][C]0.0914[/C][C]0.5285[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=317055&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=317055&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.0521-0.05490.05490.053438.830700-0.79150.7915
2020.0758-0.10030.07760.0745120.697279.7648.9311-1.39551.0935
2030.095-0.04590.0670.064625.467661.66527.8527-0.6410.9427
2040.11210.02320.05610.05437.025848.00536.92860.33670.7912
2050.1278-0.03860.05260.05116.996241.80356.4656-0.52370.7377
2060.1427-0.0330.04930.047913.02137.00646.0833-0.45840.6911
2070.1569-0.00430.04290.04170.282131.76015.6356-0.06750.602
2080.1708-0.09930.04990.0483108.096941.30226.4267-1.32060.6919
2090.1843-0.00960.04550.0441.1536.84086.0697-0.13620.6301
2100.1976-0.02110.0430.04176.279933.78475.8125-0.31830.5989
2110.2106-0.020.04090.03974.243131.09915.5767-0.26160.5683
2120.22360.00680.03810.0370.517228.55065.34330.09140.5285



Parameters (Session):
Parameters (R input):
par1 = 12 ; par2 = 0.0 ; par3 = 2 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '1'
par8 <- '0'
par7 <- '1'
par6 <- '0'
par5 <- '12'
par4 <- '1'
par3 <- '2'
par2 <- '0.0'
par1 <- '12'
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')