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:55:26 -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/t1323791839fwy9fnqs376qdze.htm/, Retrieved Thu, 31 Oct 2024 22:59:26 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=154451, Retrieved Thu, 31 Oct 2024 22:59:26 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact190
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2011-12-13 15:55:26] [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'Herman Ole Andreas Wold' @ wold.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 & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=154451&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]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=154451&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=154451&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'Herman Ole Andreas Wold' @ wold.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-------
37028332854.68922571.90053161.82310.44500.96630
37117601949.03681731.82012187.52230.060100.88660
37215171726.62441521.50221953.29610.03490.38640.8670
37319682145.04451891.15732425.49520.10810.8220
37418092012.13461762.54862289.22640.07540.62250.83920
37521042335.31442044.4542658.37530.08030.99930.74450
37623912587.51392261.73842949.79170.14380.99560.68780
37726912610.62232273.03932987.17370.33780.87350.66260
37830233175.43992769.01553628.24470.25470.9820.59650.0635
37931883397.00322956.71683888.24460.20220.93220.47770.3006
38040574429.50753870.21985051.66210.120310.39870.9977
38134763681.20793188.72284232.74590.23290.09090.70690.7069

\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 & 2854.6892 & 2571.9005 & 3161.8231 & 0.445 & 0 & 0.9663 & 0 \tabularnewline
371 & 1760 & 1949.0368 & 1731.8201 & 2187.5223 & 0.0601 & 0 & 0.8866 & 0 \tabularnewline
372 & 1517 & 1726.6244 & 1521.5022 & 1953.2961 & 0.0349 & 0.3864 & 0.867 & 0 \tabularnewline
373 & 1968 & 2145.0445 & 1891.1573 & 2425.4952 & 0.108 & 1 & 0.822 & 0 \tabularnewline
374 & 1809 & 2012.1346 & 1762.5486 & 2289.2264 & 0.0754 & 0.6225 & 0.8392 & 0 \tabularnewline
375 & 2104 & 2335.3144 & 2044.454 & 2658.3753 & 0.0803 & 0.9993 & 0.7445 & 0 \tabularnewline
376 & 2391 & 2587.5139 & 2261.7384 & 2949.7917 & 0.1438 & 0.9956 & 0.6878 & 0 \tabularnewline
377 & 2691 & 2610.6223 & 2273.0393 & 2987.1737 & 0.3378 & 0.8735 & 0.6626 & 0 \tabularnewline
378 & 3023 & 3175.4399 & 2769.0155 & 3628.2447 & 0.2547 & 0.982 & 0.5965 & 0.0635 \tabularnewline
379 & 3188 & 3397.0032 & 2956.7168 & 3888.2446 & 0.2022 & 0.9322 & 0.4777 & 0.3006 \tabularnewline
380 & 4057 & 4429.5075 & 3870.2198 & 5051.6621 & 0.1203 & 1 & 0.3987 & 0.9977 \tabularnewline
381 & 3476 & 3681.2079 & 3188.7228 & 4232.7459 & 0.2329 & 0.0909 & 0.7069 & 0.7069 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=154451&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]2854.6892[/C][C]2571.9005[/C][C]3161.8231[/C][C]0.445[/C][C]0[/C][C]0.9663[/C][C]0[/C][/ROW]
[ROW][C]371[/C][C]1760[/C][C]1949.0368[/C][C]1731.8201[/C][C]2187.5223[/C][C]0.0601[/C][C]0[/C][C]0.8866[/C][C]0[/C][/ROW]
[ROW][C]372[/C][C]1517[/C][C]1726.6244[/C][C]1521.5022[/C][C]1953.2961[/C][C]0.0349[/C][C]0.3864[/C][C]0.867[/C][C]0[/C][/ROW]
[ROW][C]373[/C][C]1968[/C][C]2145.0445[/C][C]1891.1573[/C][C]2425.4952[/C][C]0.108[/C][C]1[/C][C]0.822[/C][C]0[/C][/ROW]
[ROW][C]374[/C][C]1809[/C][C]2012.1346[/C][C]1762.5486[/C][C]2289.2264[/C][C]0.0754[/C][C]0.6225[/C][C]0.8392[/C][C]0[/C][/ROW]
[ROW][C]375[/C][C]2104[/C][C]2335.3144[/C][C]2044.454[/C][C]2658.3753[/C][C]0.0803[/C][C]0.9993[/C][C]0.7445[/C][C]0[/C][/ROW]
[ROW][C]376[/C][C]2391[/C][C]2587.5139[/C][C]2261.7384[/C][C]2949.7917[/C][C]0.1438[/C][C]0.9956[/C][C]0.6878[/C][C]0[/C][/ROW]
[ROW][C]377[/C][C]2691[/C][C]2610.6223[/C][C]2273.0393[/C][C]2987.1737[/C][C]0.3378[/C][C]0.8735[/C][C]0.6626[/C][C]0[/C][/ROW]
[ROW][C]378[/C][C]3023[/C][C]3175.4399[/C][C]2769.0155[/C][C]3628.2447[/C][C]0.2547[/C][C]0.982[/C][C]0.5965[/C][C]0.0635[/C][/ROW]
[ROW][C]379[/C][C]3188[/C][C]3397.0032[/C][C]2956.7168[/C][C]3888.2446[/C][C]0.2022[/C][C]0.9322[/C][C]0.4777[/C][C]0.3006[/C][/ROW]
[ROW][C]380[/C][C]4057[/C][C]4429.5075[/C][C]3870.2198[/C][C]5051.6621[/C][C]0.1203[/C][C]1[/C][C]0.3987[/C][C]0.9977[/C][/ROW]
[ROW][C]381[/C][C]3476[/C][C]3681.2079[/C][C]3188.7228[/C][C]4232.7459[/C][C]0.2329[/C][C]0.0909[/C][C]0.7069[/C][C]0.7069[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=154451&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=154451&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-------
37028332854.68922571.90053161.82310.44500.96630
37117601949.03681731.82012187.52230.060100.88660
37215171726.62441521.50221953.29610.03490.38640.8670
37319682145.04451891.15732425.49520.10810.8220
37418092012.13461762.54862289.22640.07540.62250.83920
37521042335.31442044.4542658.37530.08030.99930.74450
37623912587.51392261.73842949.79170.14380.99560.68780
37726912610.62232273.03932987.17370.33780.87350.66260
37830233175.43992769.01553628.24470.25470.9820.59650.0635
37931883397.00322956.71683888.24460.20220.93220.47770.3006
38040574429.50753870.21985051.66210.120310.39870.9977
38134763681.20793188.72284232.74590.23290.09090.70690.7069







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
3700.0549-0.00760470.420500
3710.0624-0.0970.052335734.916618102.6686134.5462
3720.067-0.12140.075343942.390626715.9092163.45
3730.0667-0.08250.077131344.744427873.118166.9524
3740.0703-0.1010.081941263.664230551.2272174.7891
3750.0706-0.09910.084853506.347434377.0806185.4106
3760.0714-0.07590.083538617.717434982.8859187.0371
3770.07360.03080.07696460.579831417.5976177.2501
3780.0728-0.0480.073723237.909630508.7434174.6675
3790.0738-0.06150.072543682.346331826.1037178.3987
3800.0717-0.08410.0735138761.849741547.5351203.8321
3810.0764-0.05570.072142110.26341594.4291203.9471

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
370 & 0.0549 & -0.0076 & 0 & 470.4205 & 0 & 0 \tabularnewline
371 & 0.0624 & -0.097 & 0.0523 & 35734.9166 & 18102.6686 & 134.5462 \tabularnewline
372 & 0.067 & -0.1214 & 0.0753 & 43942.3906 & 26715.9092 & 163.45 \tabularnewline
373 & 0.0667 & -0.0825 & 0.0771 & 31344.7444 & 27873.118 & 166.9524 \tabularnewline
374 & 0.0703 & -0.101 & 0.0819 & 41263.6642 & 30551.2272 & 174.7891 \tabularnewline
375 & 0.0706 & -0.0991 & 0.0848 & 53506.3474 & 34377.0806 & 185.4106 \tabularnewline
376 & 0.0714 & -0.0759 & 0.0835 & 38617.7174 & 34982.8859 & 187.0371 \tabularnewline
377 & 0.0736 & 0.0308 & 0.0769 & 6460.5798 & 31417.5976 & 177.2501 \tabularnewline
378 & 0.0728 & -0.048 & 0.0737 & 23237.9096 & 30508.7434 & 174.6675 \tabularnewline
379 & 0.0738 & -0.0615 & 0.0725 & 43682.3463 & 31826.1037 & 178.3987 \tabularnewline
380 & 0.0717 & -0.0841 & 0.0735 & 138761.8497 & 41547.5351 & 203.8321 \tabularnewline
381 & 0.0764 & -0.0557 & 0.0721 & 42110.263 & 41594.4291 & 203.9471 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=154451&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.0549[/C][C]-0.0076[/C][C]0[/C][C]470.4205[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]371[/C][C]0.0624[/C][C]-0.097[/C][C]0.0523[/C][C]35734.9166[/C][C]18102.6686[/C][C]134.5462[/C][/ROW]
[ROW][C]372[/C][C]0.067[/C][C]-0.1214[/C][C]0.0753[/C][C]43942.3906[/C][C]26715.9092[/C][C]163.45[/C][/ROW]
[ROW][C]373[/C][C]0.0667[/C][C]-0.0825[/C][C]0.0771[/C][C]31344.7444[/C][C]27873.118[/C][C]166.9524[/C][/ROW]
[ROW][C]374[/C][C]0.0703[/C][C]-0.101[/C][C]0.0819[/C][C]41263.6642[/C][C]30551.2272[/C][C]174.7891[/C][/ROW]
[ROW][C]375[/C][C]0.0706[/C][C]-0.0991[/C][C]0.0848[/C][C]53506.3474[/C][C]34377.0806[/C][C]185.4106[/C][/ROW]
[ROW][C]376[/C][C]0.0714[/C][C]-0.0759[/C][C]0.0835[/C][C]38617.7174[/C][C]34982.8859[/C][C]187.0371[/C][/ROW]
[ROW][C]377[/C][C]0.0736[/C][C]0.0308[/C][C]0.0769[/C][C]6460.5798[/C][C]31417.5976[/C][C]177.2501[/C][/ROW]
[ROW][C]378[/C][C]0.0728[/C][C]-0.048[/C][C]0.0737[/C][C]23237.9096[/C][C]30508.7434[/C][C]174.6675[/C][/ROW]
[ROW][C]379[/C][C]0.0738[/C][C]-0.0615[/C][C]0.0725[/C][C]43682.3463[/C][C]31826.1037[/C][C]178.3987[/C][/ROW]
[ROW][C]380[/C][C]0.0717[/C][C]-0.0841[/C][C]0.0735[/C][C]138761.8497[/C][C]41547.5351[/C][C]203.8321[/C][/ROW]
[ROW][C]381[/C][C]0.0764[/C][C]-0.0557[/C][C]0.0721[/C][C]42110.263[/C][C]41594.4291[/C][C]203.9471[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=154451&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=154451&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.0549-0.00760470.420500
3710.0624-0.0970.052335734.916618102.6686134.5462
3720.067-0.12140.075343942.390626715.9092163.45
3730.0667-0.08250.077131344.744427873.118166.9524
3740.0703-0.1010.081941263.664230551.2272174.7891
3750.0706-0.09910.084853506.347434377.0806185.4106
3760.0714-0.07590.083538617.717434982.8859187.0371
3770.07360.03080.07696460.579831417.5976177.2501
3780.0728-0.0480.073723237.909630508.7434174.6675
3790.0738-0.06150.072543682.346331826.1037178.3987
3800.0717-0.08410.0735138761.849741547.5351203.8321
3810.0764-0.05570.072142110.26341594.4291203.9471



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 = 1 ; par4 = 1 ; 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.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')