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 computationFri, 15 Dec 2017 23:39:59 +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/15/t15133776062wfcs3whwheyrpy.htm/, Retrieved Wed, 15 May 2024 08:37:19 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=309827, Retrieved Wed, 15 May 2024 08:37:19 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact52
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2017-12-15 22:39:59] [8329b9b38c877eb1bcf8703660df8d0b] [Current]
Feedback Forum

Post a new message
Dataseries X:
35
36.1
40.1
35.4
37.4
39.9
32
32.6
44.9
36.3
43.7
39.8
42.6
48.6
49.1
46.9
45.7
56.1
38.3
40.6
46.5
51.4
47
44.6
51
51.1
54.9
52.1
48.7
50.5
47.5
44.6
50.3
54.3
50
44.8
57.6
47.2
59.1
53.9
45.7
54.5
52.8
52.9
66
63.7
54.4
74.4
50.1
62.5
77.2
65.6
58.2
72.6
68.6
63.1
76.9
70.6
71.4
90.6
71.9
60.9
72.9
69.2
64.8
70.2
63
62.2
82.8
77.6
71.2
70.6
71.1
74
87.9
68.3
68.1
75.7
62.7
66.2
81.3
84
80
80.8
67.3
61.9
77.2
65.6
68.7
82
81.4
70.9
71.2
71.9
71.6
76.4
75.6
73.2
80.2
74
69.5
82
82.8
64.5
92.6
82
78.4
103.8
66.6
73.3
92.3
73.6
74.9
83.6
83.3
70.9
82.5
81.7
83.1
92.4
86.9
110.1
112.1
81.5
84.3
113.5
100.3
93.2
100.4
94.4
110.2
113
94.6
111
160.1
110.1
102.8
112.4
105.4
130.4
117.2
103.9
92.2
95.8
93.1
93.9
147.6
89.6
83
99.2
118.3
110.9
124.4
115.8
112.7
111.9
108.6
102.5
141.9
137.7
121.3
142.8
143
121.1
130.2
146.3
143.7
139.3
109.3
141.3
152.7
152.2
151.8
180.5
129
126.1
187.9
170
168.4
157.1
133.9
103.1
166.3
148
131.4
136.3
135.8
151.8
172.2
154.4
158
146.2
128
124.7
160.3
148.1
139.7
194
188.7
172.2
184.8
160.5
139.7
219.8
143.9
166.2
182.7
152.7
146.8
177.1
186
189.2




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309827&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 time1 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])
188151.8-------
189172.2-------
190154.4-------
191158-------
192146.2-------
193128-------
194124.7-------
195160.3-------
196148.1-------
197139.7-------
198194-------
199188.7-------
200172.2-------
201184.8196.4402146.5034273.88580.38420.73020.73020.7302
202160.5184.6698137.2993258.50250.26060.49860.78920.6297
203139.7182.4741134.5703258.12280.13390.71540.7370.605
204219.8183.6826134.128263.20520.18670.86080.82220.6114
205143.9157.1718115.8729222.42460.34510.030.80950.3259
206166.2158.1279115.5555226.36130.40830.65860.83150.343
207182.7217.7494151.5578332.72010.27510.81020.83630.7813
208152.7180.3588127.6347269.43940.27140.47950.76110.5712
209146.8168.2816119.2362250.97620.30530.64410.75090.463
210177.1207.2452141.6853324.60490.30730.84360.58750.7208
211186192.5242131.9773300.41580.45280.61030.52770.644
212189.2184.1999126.1294287.87510.46230.48640.58970.5897

\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 & 151.8 & - & - & - & - & - & - & - \tabularnewline
189 & 172.2 & - & - & - & - & - & - & - \tabularnewline
190 & 154.4 & - & - & - & - & - & - & - \tabularnewline
191 & 158 & - & - & - & - & - & - & - \tabularnewline
192 & 146.2 & - & - & - & - & - & - & - \tabularnewline
193 & 128 & - & - & - & - & - & - & - \tabularnewline
194 & 124.7 & - & - & - & - & - & - & - \tabularnewline
195 & 160.3 & - & - & - & - & - & - & - \tabularnewline
196 & 148.1 & - & - & - & - & - & - & - \tabularnewline
197 & 139.7 & - & - & - & - & - & - & - \tabularnewline
198 & 194 & - & - & - & - & - & - & - \tabularnewline
199 & 188.7 & - & - & - & - & - & - & - \tabularnewline
200 & 172.2 & - & - & - & - & - & - & - \tabularnewline
201 & 184.8 & 196.4402 & 146.5034 & 273.8858 & 0.3842 & 0.7302 & 0.7302 & 0.7302 \tabularnewline
202 & 160.5 & 184.6698 & 137.2993 & 258.5025 & 0.2606 & 0.4986 & 0.7892 & 0.6297 \tabularnewline
203 & 139.7 & 182.4741 & 134.5703 & 258.1228 & 0.1339 & 0.7154 & 0.737 & 0.605 \tabularnewline
204 & 219.8 & 183.6826 & 134.128 & 263.2052 & 0.1867 & 0.8608 & 0.8222 & 0.6114 \tabularnewline
205 & 143.9 & 157.1718 & 115.8729 & 222.4246 & 0.3451 & 0.03 & 0.8095 & 0.3259 \tabularnewline
206 & 166.2 & 158.1279 & 115.5555 & 226.3613 & 0.4083 & 0.6586 & 0.8315 & 0.343 \tabularnewline
207 & 182.7 & 217.7494 & 151.5578 & 332.7201 & 0.2751 & 0.8102 & 0.8363 & 0.7813 \tabularnewline
208 & 152.7 & 180.3588 & 127.6347 & 269.4394 & 0.2714 & 0.4795 & 0.7611 & 0.5712 \tabularnewline
209 & 146.8 & 168.2816 & 119.2362 & 250.9762 & 0.3053 & 0.6441 & 0.7509 & 0.463 \tabularnewline
210 & 177.1 & 207.2452 & 141.6853 & 324.6049 & 0.3073 & 0.8436 & 0.5875 & 0.7208 \tabularnewline
211 & 186 & 192.5242 & 131.9773 & 300.4158 & 0.4528 & 0.6103 & 0.5277 & 0.644 \tabularnewline
212 & 189.2 & 184.1999 & 126.1294 & 287.8751 & 0.4623 & 0.4864 & 0.5897 & 0.5897 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309827&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]151.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]172.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]154.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]158[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]146.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]128[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]124.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]160.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]148.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]139.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]194[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]188.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]172.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]184.8[/C][C]196.4402[/C][C]146.5034[/C][C]273.8858[/C][C]0.3842[/C][C]0.7302[/C][C]0.7302[/C][C]0.7302[/C][/ROW]
[ROW][C]202[/C][C]160.5[/C][C]184.6698[/C][C]137.2993[/C][C]258.5025[/C][C]0.2606[/C][C]0.4986[/C][C]0.7892[/C][C]0.6297[/C][/ROW]
[ROW][C]203[/C][C]139.7[/C][C]182.4741[/C][C]134.5703[/C][C]258.1228[/C][C]0.1339[/C][C]0.7154[/C][C]0.737[/C][C]0.605[/C][/ROW]
[ROW][C]204[/C][C]219.8[/C][C]183.6826[/C][C]134.128[/C][C]263.2052[/C][C]0.1867[/C][C]0.8608[/C][C]0.8222[/C][C]0.6114[/C][/ROW]
[ROW][C]205[/C][C]143.9[/C][C]157.1718[/C][C]115.8729[/C][C]222.4246[/C][C]0.3451[/C][C]0.03[/C][C]0.8095[/C][C]0.3259[/C][/ROW]
[ROW][C]206[/C][C]166.2[/C][C]158.1279[/C][C]115.5555[/C][C]226.3613[/C][C]0.4083[/C][C]0.6586[/C][C]0.8315[/C][C]0.343[/C][/ROW]
[ROW][C]207[/C][C]182.7[/C][C]217.7494[/C][C]151.5578[/C][C]332.7201[/C][C]0.2751[/C][C]0.8102[/C][C]0.8363[/C][C]0.7813[/C][/ROW]
[ROW][C]208[/C][C]152.7[/C][C]180.3588[/C][C]127.6347[/C][C]269.4394[/C][C]0.2714[/C][C]0.4795[/C][C]0.7611[/C][C]0.5712[/C][/ROW]
[ROW][C]209[/C][C]146.8[/C][C]168.2816[/C][C]119.2362[/C][C]250.9762[/C][C]0.3053[/C][C]0.6441[/C][C]0.7509[/C][C]0.463[/C][/ROW]
[ROW][C]210[/C][C]177.1[/C][C]207.2452[/C][C]141.6853[/C][C]324.6049[/C][C]0.3073[/C][C]0.8436[/C][C]0.5875[/C][C]0.7208[/C][/ROW]
[ROW][C]211[/C][C]186[/C][C]192.5242[/C][C]131.9773[/C][C]300.4158[/C][C]0.4528[/C][C]0.6103[/C][C]0.5277[/C][C]0.644[/C][/ROW]
[ROW][C]212[/C][C]189.2[/C][C]184.1999[/C][C]126.1294[/C][C]287.8751[/C][C]0.4623[/C][C]0.4864[/C][C]0.5897[/C][C]0.5897[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309827&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309827&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])
188151.8-------
189172.2-------
190154.4-------
191158-------
192146.2-------
193128-------
194124.7-------
195160.3-------
196148.1-------
197139.7-------
198194-------
199188.7-------
200172.2-------
201184.8196.4402146.5034273.88580.38420.73020.73020.7302
202160.5184.6698137.2993258.50250.26060.49860.78920.6297
203139.7182.4741134.5703258.12280.13390.71540.7370.605
204219.8183.6826134.128263.20520.18670.86080.82220.6114
205143.9157.1718115.8729222.42460.34510.030.80950.3259
206166.2158.1279115.5555226.36130.40830.65860.83150.343
207182.7217.7494151.5578332.72010.27510.81020.83630.7813
208152.7180.3588127.6347269.43940.27140.47950.76110.5712
209146.8168.2816119.2362250.97620.30530.64410.75090.463
210177.1207.2452141.6853324.60490.30730.84360.58750.7208
211186192.5242131.9773300.41580.45280.61030.52770.644
212189.2184.1999126.1294287.87510.46230.48640.58970.5897







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.2011-0.0630.0630.0611135.494300-0.40240.4024
2020.204-0.15060.10680.1006584.178359.836218.9693-0.83550.619
2030.2115-0.30620.17330.15551829.6206849.764329.1507-1.47870.9055
2040.22090.16430.1710.16141304.4643963.439331.03931.24860.9913
2050.2118-0.09220.15530.1468176.1416805.979828.3898-0.45880.8848
2060.22020.04860.13750.130665.158682.509526.12490.2790.7838
2070.2694-0.19180.14520.1371228.4623760.502827.5772-1.21160.845
2080.252-0.18110.14970.1406765.0068761.065827.5874-0.95610.8588
2090.2507-0.14630.14940.1401461.457727.775926.9773-0.74260.8459
2100.2889-0.17020.15140.1418908.734745.871727.3107-1.04210.8656
2110.2859-0.03510.14090.13242.5657681.934826.1139-0.22550.8074
2120.28720.02640.13130.123325.0007627.190325.04380.17280.7545

\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.2011 & -0.063 & 0.063 & 0.0611 & 135.4943 & 0 & 0 & -0.4024 & 0.4024 \tabularnewline
202 & 0.204 & -0.1506 & 0.1068 & 0.1006 & 584.178 & 359.8362 & 18.9693 & -0.8355 & 0.619 \tabularnewline
203 & 0.2115 & -0.3062 & 0.1733 & 0.1555 & 1829.6206 & 849.7643 & 29.1507 & -1.4787 & 0.9055 \tabularnewline
204 & 0.2209 & 0.1643 & 0.171 & 0.1614 & 1304.4643 & 963.4393 & 31.0393 & 1.2486 & 0.9913 \tabularnewline
205 & 0.2118 & -0.0922 & 0.1553 & 0.1468 & 176.1416 & 805.9798 & 28.3898 & -0.4588 & 0.8848 \tabularnewline
206 & 0.2202 & 0.0486 & 0.1375 & 0.1306 & 65.158 & 682.5095 & 26.1249 & 0.279 & 0.7838 \tabularnewline
207 & 0.2694 & -0.1918 & 0.1452 & 0.137 & 1228.4623 & 760.5028 & 27.5772 & -1.2116 & 0.845 \tabularnewline
208 & 0.252 & -0.1811 & 0.1497 & 0.1406 & 765.0068 & 761.0658 & 27.5874 & -0.9561 & 0.8588 \tabularnewline
209 & 0.2507 & -0.1463 & 0.1494 & 0.1401 & 461.457 & 727.7759 & 26.9773 & -0.7426 & 0.8459 \tabularnewline
210 & 0.2889 & -0.1702 & 0.1514 & 0.1418 & 908.734 & 745.8717 & 27.3107 & -1.0421 & 0.8656 \tabularnewline
211 & 0.2859 & -0.0351 & 0.1409 & 0.132 & 42.5657 & 681.9348 & 26.1139 & -0.2255 & 0.8074 \tabularnewline
212 & 0.2872 & 0.0264 & 0.1313 & 0.1233 & 25.0007 & 627.1903 & 25.0438 & 0.1728 & 0.7545 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309827&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.2011[/C][C]-0.063[/C][C]0.063[/C][C]0.0611[/C][C]135.4943[/C][C]0[/C][C]0[/C][C]-0.4024[/C][C]0.4024[/C][/ROW]
[ROW][C]202[/C][C]0.204[/C][C]-0.1506[/C][C]0.1068[/C][C]0.1006[/C][C]584.178[/C][C]359.8362[/C][C]18.9693[/C][C]-0.8355[/C][C]0.619[/C][/ROW]
[ROW][C]203[/C][C]0.2115[/C][C]-0.3062[/C][C]0.1733[/C][C]0.1555[/C][C]1829.6206[/C][C]849.7643[/C][C]29.1507[/C][C]-1.4787[/C][C]0.9055[/C][/ROW]
[ROW][C]204[/C][C]0.2209[/C][C]0.1643[/C][C]0.171[/C][C]0.1614[/C][C]1304.4643[/C][C]963.4393[/C][C]31.0393[/C][C]1.2486[/C][C]0.9913[/C][/ROW]
[ROW][C]205[/C][C]0.2118[/C][C]-0.0922[/C][C]0.1553[/C][C]0.1468[/C][C]176.1416[/C][C]805.9798[/C][C]28.3898[/C][C]-0.4588[/C][C]0.8848[/C][/ROW]
[ROW][C]206[/C][C]0.2202[/C][C]0.0486[/C][C]0.1375[/C][C]0.1306[/C][C]65.158[/C][C]682.5095[/C][C]26.1249[/C][C]0.279[/C][C]0.7838[/C][/ROW]
[ROW][C]207[/C][C]0.2694[/C][C]-0.1918[/C][C]0.1452[/C][C]0.137[/C][C]1228.4623[/C][C]760.5028[/C][C]27.5772[/C][C]-1.2116[/C][C]0.845[/C][/ROW]
[ROW][C]208[/C][C]0.252[/C][C]-0.1811[/C][C]0.1497[/C][C]0.1406[/C][C]765.0068[/C][C]761.0658[/C][C]27.5874[/C][C]-0.9561[/C][C]0.8588[/C][/ROW]
[ROW][C]209[/C][C]0.2507[/C][C]-0.1463[/C][C]0.1494[/C][C]0.1401[/C][C]461.457[/C][C]727.7759[/C][C]26.9773[/C][C]-0.7426[/C][C]0.8459[/C][/ROW]
[ROW][C]210[/C][C]0.2889[/C][C]-0.1702[/C][C]0.1514[/C][C]0.1418[/C][C]908.734[/C][C]745.8717[/C][C]27.3107[/C][C]-1.0421[/C][C]0.8656[/C][/ROW]
[ROW][C]211[/C][C]0.2859[/C][C]-0.0351[/C][C]0.1409[/C][C]0.132[/C][C]42.5657[/C][C]681.9348[/C][C]26.1139[/C][C]-0.2255[/C][C]0.8074[/C][/ROW]
[ROW][C]212[/C][C]0.2872[/C][C]0.0264[/C][C]0.1313[/C][C]0.1233[/C][C]25.0007[/C][C]627.1903[/C][C]25.0438[/C][C]0.1728[/C][C]0.7545[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309827&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309827&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.2011-0.0630.0630.0611135.494300-0.40240.4024
2020.204-0.15060.10680.1006584.178359.836218.9693-0.83550.619
2030.2115-0.30620.17330.15551829.6206849.764329.1507-1.47870.9055
2040.22090.16430.1710.16141304.4643963.439331.03931.24860.9913
2050.2118-0.09220.15530.1468176.1416805.979828.3898-0.45880.8848
2060.22020.04860.13750.130665.158682.509526.12490.2790.7838
2070.2694-0.19180.14520.1371228.4623760.502827.5772-1.21160.845
2080.252-0.18110.14970.1406765.0068761.065827.5874-0.95610.8588
2090.2507-0.14630.14940.1401461.457727.775926.9773-0.74260.8459
2100.2889-0.17020.15140.1418908.734745.871727.3107-1.04210.8656
2110.2859-0.03510.14090.13242.5657681.934826.1139-0.22550.8074
2120.28720.02640.13130.123325.0007627.190325.04380.17280.7545



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