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, 07 Dec 2013 18:23:03 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2013/Dec/07/t1386458610vbutdp5i8nahg8o.htm/, Retrieved Fri, 29 Mar 2024 15:59:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=231421, Retrieved Fri, 29 Mar 2024 15:59:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact61
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2008-12-08 19:22:39] [d2d412c7f4d35ffbf5ee5ee89db327d4]
- RMPD  [Spectral Analysis] [] [2013-12-04 20:47:06] [497a7351e93a087c0afe86c3efb7103c]
- RMP       [ARIMA Forecasting] [workshop 9 review...] [2013-12-07 23:23:03] [249761a82d67c41cbe9b5c486860cdc6] [Current]
Feedback Forum

Post a new message
Dataseries X:
41
39
50
40
43
38
44
35
39
35
29
49
50
59
63
32
39
47
53
60
57
52
70
90
74
62
55
84
94
70
108
139
120
97
126
149
158
124
140
109
114
77
120
133
110
92
97
78
99
107
112
90
98
125
155
190
236
189
174
178
136
161
171
149
184
155
276
224
213
279
268
287
238
213
257
293
212
246
353
339
308
247
257
322
298
273
312
249
286
279
309
401
309
328
353
354
327
324
285
243
241
287
355
460
364
487
452
391
500
451
375
372
302
316
398
394
431
431




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 4 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=231421&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=231421&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=231421&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 Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net







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[106])
94328-------
95353-------
96354-------
97327-------
98324-------
99285-------
100243-------
101241-------
102287-------
103355-------
104460-------
105364-------
106487-------
107452443.9504307.3462641.27010.46810.33450.81680.3345
108391486.1674317.1296745.30660.23580.6020.84130.4975
109500464.9652287.9224750.87130.40510.69390.82790.44
110451455.1285268.9553770.17260.48980.39010.79270.4214
111375478.0443270.6255844.43750.29070.55750.84910.4809
112372429.3889233.5703789.37650.37730.61640.84490.3769
113302447.8392234.6514854.71430.24120.64260.84050.4252
114316439.2352222.1391868.4990.28680.73450.75650.4137
115398542.0854265.08311108.54510.3090.7830.74130.5756
116394575.1463272.35551214.56390.28940.70640.63790.6065
117431542.8558249.26531182.24410.36580.67590.70820.568
118431525.8712234.41531179.70350.38810.61190.54640.5464

\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[106]) \tabularnewline
94 & 328 & - & - & - & - & - & - & - \tabularnewline
95 & 353 & - & - & - & - & - & - & - \tabularnewline
96 & 354 & - & - & - & - & - & - & - \tabularnewline
97 & 327 & - & - & - & - & - & - & - \tabularnewline
98 & 324 & - & - & - & - & - & - & - \tabularnewline
99 & 285 & - & - & - & - & - & - & - \tabularnewline
100 & 243 & - & - & - & - & - & - & - \tabularnewline
101 & 241 & - & - & - & - & - & - & - \tabularnewline
102 & 287 & - & - & - & - & - & - & - \tabularnewline
103 & 355 & - & - & - & - & - & - & - \tabularnewline
104 & 460 & - & - & - & - & - & - & - \tabularnewline
105 & 364 & - & - & - & - & - & - & - \tabularnewline
106 & 487 & - & - & - & - & - & - & - \tabularnewline
107 & 452 & 443.9504 & 307.3462 & 641.2701 & 0.4681 & 0.3345 & 0.8168 & 0.3345 \tabularnewline
108 & 391 & 486.1674 & 317.1296 & 745.3066 & 0.2358 & 0.602 & 0.8413 & 0.4975 \tabularnewline
109 & 500 & 464.9652 & 287.9224 & 750.8713 & 0.4051 & 0.6939 & 0.8279 & 0.44 \tabularnewline
110 & 451 & 455.1285 & 268.9553 & 770.1726 & 0.4898 & 0.3901 & 0.7927 & 0.4214 \tabularnewline
111 & 375 & 478.0443 & 270.6255 & 844.4375 & 0.2907 & 0.5575 & 0.8491 & 0.4809 \tabularnewline
112 & 372 & 429.3889 & 233.5703 & 789.3765 & 0.3773 & 0.6164 & 0.8449 & 0.3769 \tabularnewline
113 & 302 & 447.8392 & 234.6514 & 854.7143 & 0.2412 & 0.6426 & 0.8405 & 0.4252 \tabularnewline
114 & 316 & 439.2352 & 222.1391 & 868.499 & 0.2868 & 0.7345 & 0.7565 & 0.4137 \tabularnewline
115 & 398 & 542.0854 & 265.0831 & 1108.5451 & 0.309 & 0.783 & 0.7413 & 0.5756 \tabularnewline
116 & 394 & 575.1463 & 272.3555 & 1214.5639 & 0.2894 & 0.7064 & 0.6379 & 0.6065 \tabularnewline
117 & 431 & 542.8558 & 249.2653 & 1182.2441 & 0.3658 & 0.6759 & 0.7082 & 0.568 \tabularnewline
118 & 431 & 525.8712 & 234.4153 & 1179.7035 & 0.3881 & 0.6119 & 0.5464 & 0.5464 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=231421&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[106])[/C][/ROW]
[ROW][C]94[/C][C]328[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]353[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]354[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]327[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]324[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]285[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]243[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]241[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]287[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]355[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]460[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]364[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]487[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]452[/C][C]443.9504[/C][C]307.3462[/C][C]641.2701[/C][C]0.4681[/C][C]0.3345[/C][C]0.8168[/C][C]0.3345[/C][/ROW]
[ROW][C]108[/C][C]391[/C][C]486.1674[/C][C]317.1296[/C][C]745.3066[/C][C]0.2358[/C][C]0.602[/C][C]0.8413[/C][C]0.4975[/C][/ROW]
[ROW][C]109[/C][C]500[/C][C]464.9652[/C][C]287.9224[/C][C]750.8713[/C][C]0.4051[/C][C]0.6939[/C][C]0.8279[/C][C]0.44[/C][/ROW]
[ROW][C]110[/C][C]451[/C][C]455.1285[/C][C]268.9553[/C][C]770.1726[/C][C]0.4898[/C][C]0.3901[/C][C]0.7927[/C][C]0.4214[/C][/ROW]
[ROW][C]111[/C][C]375[/C][C]478.0443[/C][C]270.6255[/C][C]844.4375[/C][C]0.2907[/C][C]0.5575[/C][C]0.8491[/C][C]0.4809[/C][/ROW]
[ROW][C]112[/C][C]372[/C][C]429.3889[/C][C]233.5703[/C][C]789.3765[/C][C]0.3773[/C][C]0.6164[/C][C]0.8449[/C][C]0.3769[/C][/ROW]
[ROW][C]113[/C][C]302[/C][C]447.8392[/C][C]234.6514[/C][C]854.7143[/C][C]0.2412[/C][C]0.6426[/C][C]0.8405[/C][C]0.4252[/C][/ROW]
[ROW][C]114[/C][C]316[/C][C]439.2352[/C][C]222.1391[/C][C]868.499[/C][C]0.2868[/C][C]0.7345[/C][C]0.7565[/C][C]0.4137[/C][/ROW]
[ROW][C]115[/C][C]398[/C][C]542.0854[/C][C]265.0831[/C][C]1108.5451[/C][C]0.309[/C][C]0.783[/C][C]0.7413[/C][C]0.5756[/C][/ROW]
[ROW][C]116[/C][C]394[/C][C]575.1463[/C][C]272.3555[/C][C]1214.5639[/C][C]0.2894[/C][C]0.7064[/C][C]0.6379[/C][C]0.6065[/C][/ROW]
[ROW][C]117[/C][C]431[/C][C]542.8558[/C][C]249.2653[/C][C]1182.2441[/C][C]0.3658[/C][C]0.6759[/C][C]0.7082[/C][C]0.568[/C][/ROW]
[ROW][C]118[/C][C]431[/C][C]525.8712[/C][C]234.4153[/C][C]1179.7035[/C][C]0.3881[/C][C]0.6119[/C][C]0.5464[/C][C]0.5464[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=231421&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=231421&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[106])
94328-------
95353-------
96354-------
97327-------
98324-------
99285-------
100243-------
101241-------
102287-------
103355-------
104460-------
105364-------
106487-------
107452443.9504307.3462641.27010.46810.33450.81680.3345
108391486.1674317.1296745.30660.23580.6020.84130.4975
109500464.9652287.9224750.87130.40510.69390.82790.44
110451455.1285268.9553770.17260.48980.39010.79270.4214
111375478.0443270.6255844.43750.29070.55750.84910.4809
112372429.3889233.5703789.37650.37730.61640.84490.3769
113302447.8392234.6514854.71430.24120.64260.84050.4252
114316439.2352222.1391868.4990.28680.73450.75650.4137
115398542.0854265.08311108.54510.3090.7830.74130.5756
116394575.1463272.35551214.56390.28940.70640.63790.6065
117431542.8558249.26531182.24410.36580.67590.70820.568
118431525.8712234.41531179.70350.38810.61190.54640.5464







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1070.22680.01780.01780.01864.7962000.17530.1753
1080.272-0.24340.13060.11759056.8434560.819667.5338-2.0731.1241
1090.31370.07010.11040.10251227.43613449.691858.73410.76311.0038
1100.3532-0.00920.08510.079217.04462591.5350.9071-0.08990.7753
1110.391-0.27480.1230.111710618.12274196.848564.7831-2.24451.0692
1120.4277-0.15430.12820.11693293.49114046.288963.6104-1.25011.0993
1130.4635-0.48290.17890.155821269.06656506.685780.664-3.17671.3961
1140.4986-0.390.20530.177115186.91867591.714887.1304-2.68431.5571
1150.5331-0.3620.22270.191520760.59559054.923895.1574-3.13851.7328
1160.5672-0.45980.24640.209732813.96611430.828106.9151-3.94581.9541
1170.6009-0.25950.24760.211512511.710911529.0901107.3736-2.43651.998
1180.6344-0.22010.24530.21049000.550711318.3785106.3879-2.06652.0037

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
107 & 0.2268 & 0.0178 & 0.0178 & 0.018 & 64.7962 & 0 & 0 & 0.1753 & 0.1753 \tabularnewline
108 & 0.272 & -0.2434 & 0.1306 & 0.1175 & 9056.843 & 4560.8196 & 67.5338 & -2.073 & 1.1241 \tabularnewline
109 & 0.3137 & 0.0701 & 0.1104 & 0.1025 & 1227.4361 & 3449.6918 & 58.7341 & 0.7631 & 1.0038 \tabularnewline
110 & 0.3532 & -0.0092 & 0.0851 & 0.0792 & 17.0446 & 2591.53 & 50.9071 & -0.0899 & 0.7753 \tabularnewline
111 & 0.391 & -0.2748 & 0.123 & 0.1117 & 10618.1227 & 4196.8485 & 64.7831 & -2.2445 & 1.0692 \tabularnewline
112 & 0.4277 & -0.1543 & 0.1282 & 0.1169 & 3293.4911 & 4046.2889 & 63.6104 & -1.2501 & 1.0993 \tabularnewline
113 & 0.4635 & -0.4829 & 0.1789 & 0.1558 & 21269.0665 & 6506.6857 & 80.664 & -3.1767 & 1.3961 \tabularnewline
114 & 0.4986 & -0.39 & 0.2053 & 0.1771 & 15186.9186 & 7591.7148 & 87.1304 & -2.6843 & 1.5571 \tabularnewline
115 & 0.5331 & -0.362 & 0.2227 & 0.1915 & 20760.5955 & 9054.9238 & 95.1574 & -3.1385 & 1.7328 \tabularnewline
116 & 0.5672 & -0.4598 & 0.2464 & 0.2097 & 32813.966 & 11430.828 & 106.9151 & -3.9458 & 1.9541 \tabularnewline
117 & 0.6009 & -0.2595 & 0.2476 & 0.2115 & 12511.7109 & 11529.0901 & 107.3736 & -2.4365 & 1.998 \tabularnewline
118 & 0.6344 & -0.2201 & 0.2453 & 0.2104 & 9000.5507 & 11318.3785 & 106.3879 & -2.0665 & 2.0037 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=231421&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]107[/C][C]0.2268[/C][C]0.0178[/C][C]0.0178[/C][C]0.018[/C][C]64.7962[/C][C]0[/C][C]0[/C][C]0.1753[/C][C]0.1753[/C][/ROW]
[ROW][C]108[/C][C]0.272[/C][C]-0.2434[/C][C]0.1306[/C][C]0.1175[/C][C]9056.843[/C][C]4560.8196[/C][C]67.5338[/C][C]-2.073[/C][C]1.1241[/C][/ROW]
[ROW][C]109[/C][C]0.3137[/C][C]0.0701[/C][C]0.1104[/C][C]0.1025[/C][C]1227.4361[/C][C]3449.6918[/C][C]58.7341[/C][C]0.7631[/C][C]1.0038[/C][/ROW]
[ROW][C]110[/C][C]0.3532[/C][C]-0.0092[/C][C]0.0851[/C][C]0.0792[/C][C]17.0446[/C][C]2591.53[/C][C]50.9071[/C][C]-0.0899[/C][C]0.7753[/C][/ROW]
[ROW][C]111[/C][C]0.391[/C][C]-0.2748[/C][C]0.123[/C][C]0.1117[/C][C]10618.1227[/C][C]4196.8485[/C][C]64.7831[/C][C]-2.2445[/C][C]1.0692[/C][/ROW]
[ROW][C]112[/C][C]0.4277[/C][C]-0.1543[/C][C]0.1282[/C][C]0.1169[/C][C]3293.4911[/C][C]4046.2889[/C][C]63.6104[/C][C]-1.2501[/C][C]1.0993[/C][/ROW]
[ROW][C]113[/C][C]0.4635[/C][C]-0.4829[/C][C]0.1789[/C][C]0.1558[/C][C]21269.0665[/C][C]6506.6857[/C][C]80.664[/C][C]-3.1767[/C][C]1.3961[/C][/ROW]
[ROW][C]114[/C][C]0.4986[/C][C]-0.39[/C][C]0.2053[/C][C]0.1771[/C][C]15186.9186[/C][C]7591.7148[/C][C]87.1304[/C][C]-2.6843[/C][C]1.5571[/C][/ROW]
[ROW][C]115[/C][C]0.5331[/C][C]-0.362[/C][C]0.2227[/C][C]0.1915[/C][C]20760.5955[/C][C]9054.9238[/C][C]95.1574[/C][C]-3.1385[/C][C]1.7328[/C][/ROW]
[ROW][C]116[/C][C]0.5672[/C][C]-0.4598[/C][C]0.2464[/C][C]0.2097[/C][C]32813.966[/C][C]11430.828[/C][C]106.9151[/C][C]-3.9458[/C][C]1.9541[/C][/ROW]
[ROW][C]117[/C][C]0.6009[/C][C]-0.2595[/C][C]0.2476[/C][C]0.2115[/C][C]12511.7109[/C][C]11529.0901[/C][C]107.3736[/C][C]-2.4365[/C][C]1.998[/C][/ROW]
[ROW][C]118[/C][C]0.6344[/C][C]-0.2201[/C][C]0.2453[/C][C]0.2104[/C][C]9000.5507[/C][C]11318.3785[/C][C]106.3879[/C][C]-2.0665[/C][C]2.0037[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=231421&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=231421&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
1070.22680.01780.01780.01864.7962000.17530.1753
1080.272-0.24340.13060.11759056.8434560.819667.5338-2.0731.1241
1090.31370.07010.11040.10251227.43613449.691858.73410.76311.0038
1100.3532-0.00920.08510.079217.04462591.5350.9071-0.08990.7753
1110.391-0.27480.1230.111710618.12274196.848564.7831-2.24451.0692
1120.4277-0.15430.12820.11693293.49114046.288963.6104-1.25011.0993
1130.4635-0.48290.17890.155821269.06656506.685780.664-3.17671.3961
1140.4986-0.390.20530.177115186.91867591.714887.1304-2.68431.5571
1150.5331-0.3620.22270.191520760.59559054.923895.1574-3.13851.7328
1160.5672-0.45980.24640.209732813.96611430.828106.9151-3.94581.9541
1170.6009-0.25950.24760.211512511.710911529.0901107.3736-2.43651.998
1180.6344-0.22010.24530.21049000.550711318.3785106.3879-2.06652.0037



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