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, 15 Jan 2015 21:30:23 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2015/Jan/15/t1421357486gnayixqwaqzbkp9.htm/, Retrieved Wed, 15 May 2024 13:36:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=273008, Retrieved Wed, 15 May 2024 13:36:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact44
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]
- RMP   [ARIMA Backward Selection] [] [2011-12-06 19:59:13] [b98453cac15ba1066b407e146608df68]
- RMPD      [ARIMA Forecasting] [vraag 7 proefex] [2015-01-15 21:30:23] [5d881a36bd0ad8435ec4402f15a04cd7] [Current]
Feedback Forum

Post a new message
Dataseries X:
112
118
132
129
121
135
148
148
136
119
104
118
115
126
141
135
125
149
170
170
158
133
114
140
145
150
178
163
172
178
199
199
184
162
146
166
171
180
193
181
183
218
230
242
209
191
172
194
196
196
236
235
229
243
264
272
237
211
180
201
204
188
235
227
234
264
302
293
259
229
203
229
242
233
267
269
270
315
364
347
312
274
237
278
284
277
317
313
318
374
413
405
355
306
271
306
315
301
356
348
355
422
465
467
404
347
305
336
340
318
362
348
363
435
491
505
404
359
310
337
360
342
406
396
420
472
548
559
463
407
362
405
417
391
419
461
472
535
622
606
508
461
390
432




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Sir Maurice George Kendall' @ kendall.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 & 3 seconds \tabularnewline
R Server & 'Sir Maurice George Kendall' @ kendall.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=273008&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Maurice George Kendall' @ kendall.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=273008&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=273008&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 time3 seconds
R Server'Sir Maurice George Kendall' @ kendall.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[132])
120337-------
121360-------
122342-------
123406-------
124396-------
125420-------
126472-------
127548-------
128559-------
129463-------
130407-------
131362-------
132405-------
133417420.1096384.1296460.59670.44020.76780.99820.7678
134391395.9412356.1321441.73460.41630.18370.98950.3491
135419466.6865409.1871535.1480.08610.98490.95880.9613
136461451.5689390.274525.99130.40190.80450.92830.89
137472472.4193401.6985560.21820.49630.60060.8790.9338
138535553.7076461.0039672.18110.37850.91180.91180.9931
139622633.3425516.8718786.36890.44220.89610.86280.9983
140606644.9642519.6762812.53170.32430.60590.84270.9975
141508525.8349424.6264660.77980.39780.12210.81930.9604
142461456.8834368.7162574.54220.47270.19720.7970.8063
143390397.5532320.9033499.81180.44240.1120.75220.4433
144432440.6791350.5801563.35130.44490.7910.71570.7157

\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[132]) \tabularnewline
120 & 337 & - & - & - & - & - & - & - \tabularnewline
121 & 360 & - & - & - & - & - & - & - \tabularnewline
122 & 342 & - & - & - & - & - & - & - \tabularnewline
123 & 406 & - & - & - & - & - & - & - \tabularnewline
124 & 396 & - & - & - & - & - & - & - \tabularnewline
125 & 420 & - & - & - & - & - & - & - \tabularnewline
126 & 472 & - & - & - & - & - & - & - \tabularnewline
127 & 548 & - & - & - & - & - & - & - \tabularnewline
128 & 559 & - & - & - & - & - & - & - \tabularnewline
129 & 463 & - & - & - & - & - & - & - \tabularnewline
130 & 407 & - & - & - & - & - & - & - \tabularnewline
131 & 362 & - & - & - & - & - & - & - \tabularnewline
132 & 405 & - & - & - & - & - & - & - \tabularnewline
133 & 417 & 420.1096 & 384.1296 & 460.5967 & 0.4402 & 0.7678 & 0.9982 & 0.7678 \tabularnewline
134 & 391 & 395.9412 & 356.1321 & 441.7346 & 0.4163 & 0.1837 & 0.9895 & 0.3491 \tabularnewline
135 & 419 & 466.6865 & 409.1871 & 535.148 & 0.0861 & 0.9849 & 0.9588 & 0.9613 \tabularnewline
136 & 461 & 451.5689 & 390.274 & 525.9913 & 0.4019 & 0.8045 & 0.9283 & 0.89 \tabularnewline
137 & 472 & 472.4193 & 401.6985 & 560.2182 & 0.4963 & 0.6006 & 0.879 & 0.9338 \tabularnewline
138 & 535 & 553.7076 & 461.0039 & 672.1811 & 0.3785 & 0.9118 & 0.9118 & 0.9931 \tabularnewline
139 & 622 & 633.3425 & 516.8718 & 786.3689 & 0.4422 & 0.8961 & 0.8628 & 0.9983 \tabularnewline
140 & 606 & 644.9642 & 519.6762 & 812.5317 & 0.3243 & 0.6059 & 0.8427 & 0.9975 \tabularnewline
141 & 508 & 525.8349 & 424.6264 & 660.7798 & 0.3978 & 0.1221 & 0.8193 & 0.9604 \tabularnewline
142 & 461 & 456.8834 & 368.7162 & 574.5422 & 0.4727 & 0.1972 & 0.797 & 0.8063 \tabularnewline
143 & 390 & 397.5532 & 320.9033 & 499.8118 & 0.4424 & 0.112 & 0.7522 & 0.4433 \tabularnewline
144 & 432 & 440.6791 & 350.5801 & 563.3513 & 0.4449 & 0.791 & 0.7157 & 0.7157 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=273008&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[132])[/C][/ROW]
[ROW][C]120[/C][C]337[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]360[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]342[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]406[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]396[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]420[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]472[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]548[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]559[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]463[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]407[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]131[/C][C]362[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]132[/C][C]405[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]133[/C][C]417[/C][C]420.1096[/C][C]384.1296[/C][C]460.5967[/C][C]0.4402[/C][C]0.7678[/C][C]0.9982[/C][C]0.7678[/C][/ROW]
[ROW][C]134[/C][C]391[/C][C]395.9412[/C][C]356.1321[/C][C]441.7346[/C][C]0.4163[/C][C]0.1837[/C][C]0.9895[/C][C]0.3491[/C][/ROW]
[ROW][C]135[/C][C]419[/C][C]466.6865[/C][C]409.1871[/C][C]535.148[/C][C]0.0861[/C][C]0.9849[/C][C]0.9588[/C][C]0.9613[/C][/ROW]
[ROW][C]136[/C][C]461[/C][C]451.5689[/C][C]390.274[/C][C]525.9913[/C][C]0.4019[/C][C]0.8045[/C][C]0.9283[/C][C]0.89[/C][/ROW]
[ROW][C]137[/C][C]472[/C][C]472.4193[/C][C]401.6985[/C][C]560.2182[/C][C]0.4963[/C][C]0.6006[/C][C]0.879[/C][C]0.9338[/C][/ROW]
[ROW][C]138[/C][C]535[/C][C]553.7076[/C][C]461.0039[/C][C]672.1811[/C][C]0.3785[/C][C]0.9118[/C][C]0.9118[/C][C]0.9931[/C][/ROW]
[ROW][C]139[/C][C]622[/C][C]633.3425[/C][C]516.8718[/C][C]786.3689[/C][C]0.4422[/C][C]0.8961[/C][C]0.8628[/C][C]0.9983[/C][/ROW]
[ROW][C]140[/C][C]606[/C][C]644.9642[/C][C]519.6762[/C][C]812.5317[/C][C]0.3243[/C][C]0.6059[/C][C]0.8427[/C][C]0.9975[/C][/ROW]
[ROW][C]141[/C][C]508[/C][C]525.8349[/C][C]424.6264[/C][C]660.7798[/C][C]0.3978[/C][C]0.1221[/C][C]0.8193[/C][C]0.9604[/C][/ROW]
[ROW][C]142[/C][C]461[/C][C]456.8834[/C][C]368.7162[/C][C]574.5422[/C][C]0.4727[/C][C]0.1972[/C][C]0.797[/C][C]0.8063[/C][/ROW]
[ROW][C]143[/C][C]390[/C][C]397.5532[/C][C]320.9033[/C][C]499.8118[/C][C]0.4424[/C][C]0.112[/C][C]0.7522[/C][C]0.4433[/C][/ROW]
[ROW][C]144[/C][C]432[/C][C]440.6791[/C][C]350.5801[/C][C]563.3513[/C][C]0.4449[/C][C]0.791[/C][C]0.7157[/C][C]0.7157[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=273008&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=273008&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[132])
120337-------
121360-------
122342-------
123406-------
124396-------
125420-------
126472-------
127548-------
128559-------
129463-------
130407-------
131362-------
132405-------
133417420.1096384.1296460.59670.44020.76780.99820.7678
134391395.9412356.1321441.73460.41630.18370.98950.3491
135419466.6865409.1871535.1480.08610.98490.95880.9613
136461451.5689390.274525.99130.40190.80450.92830.89
137472472.4193401.6985560.21820.49630.60060.8790.9338
138535553.7076461.0039672.18110.37850.91180.91180.9931
139622633.3425516.8718786.36890.44220.89610.86280.9983
140606644.9642519.6762812.53170.32430.60590.84270.9975
141508525.8349424.6264660.77980.39780.12210.81930.9604
142461456.8834368.7162574.54220.47270.19720.7970.8063
143390397.5532320.9033499.81180.44240.1120.75220.4433
144432440.6791350.5801563.35130.44490.7910.71570.7157







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1330.0492-0.00750.00750.00749.669700-0.06440.0644
1340.059-0.01260.010.0124.415817.04284.1283-0.10240.0834
1350.0748-0.11380.04460.04262274.0042769.363227.7374-0.98790.3849
1360.08410.02050.03860.037188.9449599.258724.47980.19540.3375
1370.0948-9e-040.03110.02980.1758479.442121.8962-0.00870.2717
1380.1092-0.0350.03170.0306349.9748457.864221.3978-0.38750.291
1390.1233-0.01820.02980.0288128.6532410.834120.269-0.2350.283
1400.1326-0.06430.03410.0331518.2127549.256423.4362-0.80720.3485
1410.1309-0.03510.03420.0332318.0851523.570722.8817-0.36950.3509
1420.13140.00890.03170.030716.9461472.908221.74650.08530.3243
1430.1312-0.01940.03060.029757.0504435.10320.8591-0.15650.3091
1440.142-0.02010.02970.028975.3264405.121620.1276-0.17980.2983

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
133 & 0.0492 & -0.0075 & 0.0075 & 0.0074 & 9.6697 & 0 & 0 & -0.0644 & 0.0644 \tabularnewline
134 & 0.059 & -0.0126 & 0.01 & 0.01 & 24.4158 & 17.0428 & 4.1283 & -0.1024 & 0.0834 \tabularnewline
135 & 0.0748 & -0.1138 & 0.0446 & 0.0426 & 2274.0042 & 769.3632 & 27.7374 & -0.9879 & 0.3849 \tabularnewline
136 & 0.0841 & 0.0205 & 0.0386 & 0.0371 & 88.9449 & 599.2587 & 24.4798 & 0.1954 & 0.3375 \tabularnewline
137 & 0.0948 & -9e-04 & 0.0311 & 0.0298 & 0.1758 & 479.4421 & 21.8962 & -0.0087 & 0.2717 \tabularnewline
138 & 0.1092 & -0.035 & 0.0317 & 0.0306 & 349.9748 & 457.8642 & 21.3978 & -0.3875 & 0.291 \tabularnewline
139 & 0.1233 & -0.0182 & 0.0298 & 0.0288 & 128.6532 & 410.8341 & 20.269 & -0.235 & 0.283 \tabularnewline
140 & 0.1326 & -0.0643 & 0.0341 & 0.033 & 1518.2127 & 549.2564 & 23.4362 & -0.8072 & 0.3485 \tabularnewline
141 & 0.1309 & -0.0351 & 0.0342 & 0.0332 & 318.0851 & 523.5707 & 22.8817 & -0.3695 & 0.3509 \tabularnewline
142 & 0.1314 & 0.0089 & 0.0317 & 0.0307 & 16.9461 & 472.9082 & 21.7465 & 0.0853 & 0.3243 \tabularnewline
143 & 0.1312 & -0.0194 & 0.0306 & 0.0297 & 57.0504 & 435.103 & 20.8591 & -0.1565 & 0.3091 \tabularnewline
144 & 0.142 & -0.0201 & 0.0297 & 0.0289 & 75.3264 & 405.1216 & 20.1276 & -0.1798 & 0.2983 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=273008&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]133[/C][C]0.0492[/C][C]-0.0075[/C][C]0.0075[/C][C]0.0074[/C][C]9.6697[/C][C]0[/C][C]0[/C][C]-0.0644[/C][C]0.0644[/C][/ROW]
[ROW][C]134[/C][C]0.059[/C][C]-0.0126[/C][C]0.01[/C][C]0.01[/C][C]24.4158[/C][C]17.0428[/C][C]4.1283[/C][C]-0.1024[/C][C]0.0834[/C][/ROW]
[ROW][C]135[/C][C]0.0748[/C][C]-0.1138[/C][C]0.0446[/C][C]0.0426[/C][C]2274.0042[/C][C]769.3632[/C][C]27.7374[/C][C]-0.9879[/C][C]0.3849[/C][/ROW]
[ROW][C]136[/C][C]0.0841[/C][C]0.0205[/C][C]0.0386[/C][C]0.0371[/C][C]88.9449[/C][C]599.2587[/C][C]24.4798[/C][C]0.1954[/C][C]0.3375[/C][/ROW]
[ROW][C]137[/C][C]0.0948[/C][C]-9e-04[/C][C]0.0311[/C][C]0.0298[/C][C]0.1758[/C][C]479.4421[/C][C]21.8962[/C][C]-0.0087[/C][C]0.2717[/C][/ROW]
[ROW][C]138[/C][C]0.1092[/C][C]-0.035[/C][C]0.0317[/C][C]0.0306[/C][C]349.9748[/C][C]457.8642[/C][C]21.3978[/C][C]-0.3875[/C][C]0.291[/C][/ROW]
[ROW][C]139[/C][C]0.1233[/C][C]-0.0182[/C][C]0.0298[/C][C]0.0288[/C][C]128.6532[/C][C]410.8341[/C][C]20.269[/C][C]-0.235[/C][C]0.283[/C][/ROW]
[ROW][C]140[/C][C]0.1326[/C][C]-0.0643[/C][C]0.0341[/C][C]0.033[/C][C]1518.2127[/C][C]549.2564[/C][C]23.4362[/C][C]-0.8072[/C][C]0.3485[/C][/ROW]
[ROW][C]141[/C][C]0.1309[/C][C]-0.0351[/C][C]0.0342[/C][C]0.0332[/C][C]318.0851[/C][C]523.5707[/C][C]22.8817[/C][C]-0.3695[/C][C]0.3509[/C][/ROW]
[ROW][C]142[/C][C]0.1314[/C][C]0.0089[/C][C]0.0317[/C][C]0.0307[/C][C]16.9461[/C][C]472.9082[/C][C]21.7465[/C][C]0.0853[/C][C]0.3243[/C][/ROW]
[ROW][C]143[/C][C]0.1312[/C][C]-0.0194[/C][C]0.0306[/C][C]0.0297[/C][C]57.0504[/C][C]435.103[/C][C]20.8591[/C][C]-0.1565[/C][C]0.3091[/C][/ROW]
[ROW][C]144[/C][C]0.142[/C][C]-0.0201[/C][C]0.0297[/C][C]0.0289[/C][C]75.3264[/C][C]405.1216[/C][C]20.1276[/C][C]-0.1798[/C][C]0.2983[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=273008&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=273008&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
1330.0492-0.00750.00750.00749.669700-0.06440.0644
1340.059-0.01260.010.0124.415817.04284.1283-0.10240.0834
1350.0748-0.11380.04460.04262274.0042769.363227.7374-0.98790.3849
1360.08410.02050.03860.037188.9449599.258724.47980.19540.3375
1370.0948-9e-040.03110.02980.1758479.442121.8962-0.00870.2717
1380.1092-0.0350.03170.0306349.9748457.864221.3978-0.38750.291
1390.1233-0.01820.02980.0288128.6532410.834120.269-0.2350.283
1400.1326-0.06430.03410.0331518.2127549.256423.4362-0.80720.3485
1410.1309-0.03510.03420.0332318.0851523.570722.8817-0.36950.3509
1420.13140.00890.03170.030716.9461472.908221.74650.08530.3243
1430.1312-0.01940.03060.029757.0504435.10320.8591-0.15650.3091
1440.142-0.02010.02970.028975.3264405.121620.1276-0.17980.2983



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