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 computationTue, 13 Dec 2011 10:58:10 -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/2011/Dec/13/t1323791916i3haa54gutlyaa4.htm/, Retrieved Thu, 02 May 2024 23:23:51 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=154454, Retrieved Thu, 02 May 2024 23:23:51 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact154
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2011-12-13 15:58:10] [d76b387543b13b5e3afd8ff9e5fdc89f] [Current]
Feedback Forum

Post a new message
Dataseries X:
117
116
166
180
202
290
298
441
388
260
175
105
137
142
176
231
240
316
363
537
487
324
185
133
169
157
206
244
243
393
405
579
525
373
198
148
201
177
222
275
290
402
534
614
578
419
203
173
229
192
294
310
365
509
537
655
643
444
259
229
276
245
324
323
349
480
530
676
670
476
281
240
259
237
400
367
497
593
696
969
878
581
373
232
358
318
410
480
604
713
844
1134
1013
755
371
280
417
417
514
548
583
839
924
1179
1109
896
452
337
484
524
575
622
664
926
1028
1361
1304
937
505
427
580
483
625
695
729
1099
1090
1393
1261
988
525
416
516
454
629
755
706
951
1099
1444
1316
1066
585
430
669
598
714
835
912
1031
1210
1581
1416
1120
652
505
741
675
782
956
996
1259
1389
1868
1609
1385
735
577
815
798
940
1007
1094
1413
1552
2038
1762
1411
805
729
912
753
989
1137
1256
1554
1629
2024
1900
1563
905
766
952
915
1197
1242
1197
1522
1591
2128
1962
1653
987
877
990
880
1258
1240
1312
1713
1683
2220
1996
1628
1119
890
1118
1164
1364
1412
1721
1752
1794
2434
2390
1929
1352
1060
1435
1196
1478
1648
1812
2118
2211
2826
2534
2290
1367
1105
1463
1299
1576
1850
1929
2367
2508
3073
2922
2377
1627
1259
1547
1436
1905
2079
1994
2501
2569
3467
2885
2211
1597
1141
1533
1546
1967
2171
2021
2753
2626
3532
3096
2639
1653
1425
1802
1674
1970
2092
2280
2715
2971
3937
3110
2662
1728
1609
1922
1863
1945
2365
2275
2962
2930
4062
3445
2943
1879
1694
2147
1999
2266
2562
2583
2965
3142
4115
3654
2992
2031
1699
2313
1970
2382
2830
2614
3321
3418
4468
3657
3250
2174
2014
2118
2227
2563
2817
2680
3337
3559
4608
3930
3133
2042
1999
2679
2425
2693
2760
2941
3611
3779
4945
4034
2906
2132
1932
2268
2178
2317
2552
2582
2886
3283
4125
3536
2568
1802
1598
2013
1872
2227
2497
2530
3119
3411
4511
3528
2833
1760
1517
1968
1809
2104
2391
2691
3023
3188
4057
3476




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=154454&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'AstonUniversity' @ aston.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[369])
3573536-------
3582568-------
3591802-------
3601598-------
3612013-------
3621872-------
3632227-------
3642497-------
3652530-------
3663119-------
3673411-------
3684511-------
3693528-------
37028332881.00062588.15513199.77380.383900.97290
37117601974.66441740.83322232.97340.051700.90490
37215171724.88761498.51021977.83290.05360.39280.83720
37319682158.58321855.75182499.71840.13680.99990.79850
37418092024.05161717.60452372.75660.11340.62360.80360
37521042339.69571974.4472757.10250.13420.99360.70170
37623912594.85482175.13523077.0020.20360.9770.65461e-04
37726912615.2692173.02763126.7490.38580.80490.62812e-04
37830233177.76192637.43393803.22720.31380.93640.5730.1362
37931883402.00112808.54714091.78540.27160.85920.48980.3602
38040574435.95063673.24295320.39740.20050.99720.4340.9779
38134763676.83213001.12414469.11310.30970.17350.64360.6436

\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[369]) \tabularnewline
357 & 3536 & - & - & - & - & - & - & - \tabularnewline
358 & 2568 & - & - & - & - & - & - & - \tabularnewline
359 & 1802 & - & - & - & - & - & - & - \tabularnewline
360 & 1598 & - & - & - & - & - & - & - \tabularnewline
361 & 2013 & - & - & - & - & - & - & - \tabularnewline
362 & 1872 & - & - & - & - & - & - & - \tabularnewline
363 & 2227 & - & - & - & - & - & - & - \tabularnewline
364 & 2497 & - & - & - & - & - & - & - \tabularnewline
365 & 2530 & - & - & - & - & - & - & - \tabularnewline
366 & 3119 & - & - & - & - & - & - & - \tabularnewline
367 & 3411 & - & - & - & - & - & - & - \tabularnewline
368 & 4511 & - & - & - & - & - & - & - \tabularnewline
369 & 3528 & - & - & - & - & - & - & - \tabularnewline
370 & 2833 & 2881.0006 & 2588.1551 & 3199.7738 & 0.3839 & 0 & 0.9729 & 0 \tabularnewline
371 & 1760 & 1974.6644 & 1740.8332 & 2232.9734 & 0.0517 & 0 & 0.9049 & 0 \tabularnewline
372 & 1517 & 1724.8876 & 1498.5102 & 1977.8329 & 0.0536 & 0.3928 & 0.8372 & 0 \tabularnewline
373 & 1968 & 2158.5832 & 1855.7518 & 2499.7184 & 0.1368 & 0.9999 & 0.7985 & 0 \tabularnewline
374 & 1809 & 2024.0516 & 1717.6045 & 2372.7566 & 0.1134 & 0.6236 & 0.8036 & 0 \tabularnewline
375 & 2104 & 2339.6957 & 1974.447 & 2757.1025 & 0.1342 & 0.9936 & 0.7017 & 0 \tabularnewline
376 & 2391 & 2594.8548 & 2175.1352 & 3077.002 & 0.2036 & 0.977 & 0.6546 & 1e-04 \tabularnewline
377 & 2691 & 2615.269 & 2173.0276 & 3126.749 & 0.3858 & 0.8049 & 0.6281 & 2e-04 \tabularnewline
378 & 3023 & 3177.7619 & 2637.4339 & 3803.2272 & 0.3138 & 0.9364 & 0.573 & 0.1362 \tabularnewline
379 & 3188 & 3402.0011 & 2808.5471 & 4091.7854 & 0.2716 & 0.8592 & 0.4898 & 0.3602 \tabularnewline
380 & 4057 & 4435.9506 & 3673.2429 & 5320.3974 & 0.2005 & 0.9972 & 0.434 & 0.9779 \tabularnewline
381 & 3476 & 3676.8321 & 3001.1241 & 4469.1131 & 0.3097 & 0.1735 & 0.6436 & 0.6436 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=154454&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[369])[/C][/ROW]
[ROW][C]357[/C][C]3536[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]358[/C][C]2568[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]359[/C][C]1802[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]360[/C][C]1598[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]361[/C][C]2013[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]362[/C][C]1872[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]363[/C][C]2227[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]364[/C][C]2497[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]365[/C][C]2530[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]366[/C][C]3119[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]367[/C][C]3411[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]368[/C][C]4511[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]369[/C][C]3528[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]370[/C][C]2833[/C][C]2881.0006[/C][C]2588.1551[/C][C]3199.7738[/C][C]0.3839[/C][C]0[/C][C]0.9729[/C][C]0[/C][/ROW]
[ROW][C]371[/C][C]1760[/C][C]1974.6644[/C][C]1740.8332[/C][C]2232.9734[/C][C]0.0517[/C][C]0[/C][C]0.9049[/C][C]0[/C][/ROW]
[ROW][C]372[/C][C]1517[/C][C]1724.8876[/C][C]1498.5102[/C][C]1977.8329[/C][C]0.0536[/C][C]0.3928[/C][C]0.8372[/C][C]0[/C][/ROW]
[ROW][C]373[/C][C]1968[/C][C]2158.5832[/C][C]1855.7518[/C][C]2499.7184[/C][C]0.1368[/C][C]0.9999[/C][C]0.7985[/C][C]0[/C][/ROW]
[ROW][C]374[/C][C]1809[/C][C]2024.0516[/C][C]1717.6045[/C][C]2372.7566[/C][C]0.1134[/C][C]0.6236[/C][C]0.8036[/C][C]0[/C][/ROW]
[ROW][C]375[/C][C]2104[/C][C]2339.6957[/C][C]1974.447[/C][C]2757.1025[/C][C]0.1342[/C][C]0.9936[/C][C]0.7017[/C][C]0[/C][/ROW]
[ROW][C]376[/C][C]2391[/C][C]2594.8548[/C][C]2175.1352[/C][C]3077.002[/C][C]0.2036[/C][C]0.977[/C][C]0.6546[/C][C]1e-04[/C][/ROW]
[ROW][C]377[/C][C]2691[/C][C]2615.269[/C][C]2173.0276[/C][C]3126.749[/C][C]0.3858[/C][C]0.8049[/C][C]0.6281[/C][C]2e-04[/C][/ROW]
[ROW][C]378[/C][C]3023[/C][C]3177.7619[/C][C]2637.4339[/C][C]3803.2272[/C][C]0.3138[/C][C]0.9364[/C][C]0.573[/C][C]0.1362[/C][/ROW]
[ROW][C]379[/C][C]3188[/C][C]3402.0011[/C][C]2808.5471[/C][C]4091.7854[/C][C]0.2716[/C][C]0.8592[/C][C]0.4898[/C][C]0.3602[/C][/ROW]
[ROW][C]380[/C][C]4057[/C][C]4435.9506[/C][C]3673.2429[/C][C]5320.3974[/C][C]0.2005[/C][C]0.9972[/C][C]0.434[/C][C]0.9779[/C][/ROW]
[ROW][C]381[/C][C]3476[/C][C]3676.8321[/C][C]3001.1241[/C][C]4469.1131[/C][C]0.3097[/C][C]0.1735[/C][C]0.6436[/C][C]0.6436[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=154454&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=154454&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[369])
3573536-------
3582568-------
3591802-------
3601598-------
3612013-------
3621872-------
3632227-------
3642497-------
3652530-------
3663119-------
3673411-------
3684511-------
3693528-------
37028332881.00062588.15513199.77380.383900.97290
37117601974.66441740.83322232.97340.051700.90490
37215171724.88761498.51021977.83290.05360.39280.83720
37319682158.58321855.75182499.71840.13680.99990.79850
37418092024.05161717.60452372.75660.11340.62360.80360
37521042339.69571974.4472757.10250.13420.99360.70170
37623912594.85482175.13523077.0020.20360.9770.65461e-04
37726912615.2692173.02763126.7490.38580.80490.62812e-04
37830233177.76192637.43393803.22720.31380.93640.5730.1362
37931883402.00112808.54714091.78540.27160.85920.48980.3602
38040574435.95063673.24295320.39740.20050.99720.4340.9779
38134763676.83213001.12414469.11310.30970.17350.64360.6436







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
3700.0565-0.016702304.057300
3710.0667-0.10870.062746080.790724192.424155.5391
3720.0748-0.12050.08243217.265830534.0379174.7399
3730.0806-0.08830.083536321.972231981.0215178.8324
3740.0879-0.10620.088146247.179534834.2531186.6394
3750.091-0.10070.090255552.486338287.292195.6714
3760.0948-0.07860.088541556.774838754.3609196.8613
3770.09980.0290.08115735.187134626.9642186.0832
3780.1004-0.04870.077523951.251733440.7739182.8682
3790.1034-0.06290.07645796.481534676.3447186.2159
3800.1017-0.08540.0769143603.520144578.8152211.137
3810.1099-0.05460.07540333.551444225.0432210.2975

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
370 & 0.0565 & -0.0167 & 0 & 2304.0573 & 0 & 0 \tabularnewline
371 & 0.0667 & -0.1087 & 0.0627 & 46080.7907 & 24192.424 & 155.5391 \tabularnewline
372 & 0.0748 & -0.1205 & 0.082 & 43217.2658 & 30534.0379 & 174.7399 \tabularnewline
373 & 0.0806 & -0.0883 & 0.0835 & 36321.9722 & 31981.0215 & 178.8324 \tabularnewline
374 & 0.0879 & -0.1062 & 0.0881 & 46247.1795 & 34834.2531 & 186.6394 \tabularnewline
375 & 0.091 & -0.1007 & 0.0902 & 55552.4863 & 38287.292 & 195.6714 \tabularnewline
376 & 0.0948 & -0.0786 & 0.0885 & 41556.7748 & 38754.3609 & 196.8613 \tabularnewline
377 & 0.0998 & 0.029 & 0.0811 & 5735.1871 & 34626.9642 & 186.0832 \tabularnewline
378 & 0.1004 & -0.0487 & 0.0775 & 23951.2517 & 33440.7739 & 182.8682 \tabularnewline
379 & 0.1034 & -0.0629 & 0.076 & 45796.4815 & 34676.3447 & 186.2159 \tabularnewline
380 & 0.1017 & -0.0854 & 0.0769 & 143603.5201 & 44578.8152 & 211.137 \tabularnewline
381 & 0.1099 & -0.0546 & 0.075 & 40333.5514 & 44225.0432 & 210.2975 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=154454&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]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]370[/C][C]0.0565[/C][C]-0.0167[/C][C]0[/C][C]2304.0573[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]371[/C][C]0.0667[/C][C]-0.1087[/C][C]0.0627[/C][C]46080.7907[/C][C]24192.424[/C][C]155.5391[/C][/ROW]
[ROW][C]372[/C][C]0.0748[/C][C]-0.1205[/C][C]0.082[/C][C]43217.2658[/C][C]30534.0379[/C][C]174.7399[/C][/ROW]
[ROW][C]373[/C][C]0.0806[/C][C]-0.0883[/C][C]0.0835[/C][C]36321.9722[/C][C]31981.0215[/C][C]178.8324[/C][/ROW]
[ROW][C]374[/C][C]0.0879[/C][C]-0.1062[/C][C]0.0881[/C][C]46247.1795[/C][C]34834.2531[/C][C]186.6394[/C][/ROW]
[ROW][C]375[/C][C]0.091[/C][C]-0.1007[/C][C]0.0902[/C][C]55552.4863[/C][C]38287.292[/C][C]195.6714[/C][/ROW]
[ROW][C]376[/C][C]0.0948[/C][C]-0.0786[/C][C]0.0885[/C][C]41556.7748[/C][C]38754.3609[/C][C]196.8613[/C][/ROW]
[ROW][C]377[/C][C]0.0998[/C][C]0.029[/C][C]0.0811[/C][C]5735.1871[/C][C]34626.9642[/C][C]186.0832[/C][/ROW]
[ROW][C]378[/C][C]0.1004[/C][C]-0.0487[/C][C]0.0775[/C][C]23951.2517[/C][C]33440.7739[/C][C]182.8682[/C][/ROW]
[ROW][C]379[/C][C]0.1034[/C][C]-0.0629[/C][C]0.076[/C][C]45796.4815[/C][C]34676.3447[/C][C]186.2159[/C][/ROW]
[ROW][C]380[/C][C]0.1017[/C][C]-0.0854[/C][C]0.0769[/C][C]143603.5201[/C][C]44578.8152[/C][C]211.137[/C][/ROW]
[ROW][C]381[/C][C]0.1099[/C][C]-0.0546[/C][C]0.075[/C][C]40333.5514[/C][C]44225.0432[/C][C]210.2975[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=154454&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=154454&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.PEMAPESq.EMSERMSE
3700.0565-0.016702304.057300
3710.0667-0.10870.062746080.790724192.424155.5391
3720.0748-0.12050.08243217.265830534.0379174.7399
3730.0806-0.08830.083536321.972231981.0215178.8324
3740.0879-0.10620.088146247.179534834.2531186.6394
3750.091-0.10070.090255552.486338287.292195.6714
3760.0948-0.07860.088541556.774838754.3609196.8613
3770.09980.0290.08115735.187134626.9642186.0832
3780.1004-0.04870.077523951.251733440.7739182.8682
3790.1034-0.06290.07645796.481534676.3447186.2159
3800.1017-0.08540.0769143603.520144578.8152211.137
3810.1099-0.05460.07540333.551444225.0432210.2975



Parameters (Session):
par1 = FALSE ; par2 = 0.2 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
Parameters (R input):
par1 = 12 ; par2 = 0.2 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; 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.mape <- array(0, dim=fx)
perf.mape1 <- 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)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[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.mse[1] = abs(perf.se[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.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[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',7,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,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',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.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')