Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 29 Dec 2010 20:07:50 +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/2010/Dec/29/t1293653335erb823ob314vbhx.htm/, Retrieved Fri, 03 May 2024 08:28:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=117099, Retrieved Fri, 03 May 2024 08:28:33 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact103
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Bivariate Explorative Data Analysis] [Paper Bivariate E...] [2009-12-13 14:39:24] [143cbdcaf7333bdd9926a1dde50d1082]
- RMPD  [ARIMA Forecasting] [Paper-ARIMAforeca...] [2009-12-15 18:44:14] [f15cfb7053d35072d573abca87df96a0]
- R PD    [ARIMA Forecasting] [Paper-ARIMAforeca...] [2009-12-18 10:49:22] [143cbdcaf7333bdd9926a1dde50d1082]
- R PD        [ARIMA Forecasting] [Arima forcasting ...] [2010-12-29 20:07:50] [e1ffef1929e52c7feb412e7ff10407af] [Current]
Feedback Forum

Post a new message
Dataseries X:
20503
22885
26217
26583
27751
28158
27373
28367
26851
26733
26849
26733
27951
29781
32914
33488
35652
36488
35387
35676
34844
32447
31068
29010
29812
30951
32974
32936
34012
32946
31948
30599
27691
25073
23406
22248
22896
25317
26558
26471
27543
26198
24725
25005
23462
20780
19815
19761
21454
23899
24939
23580
24562
24696
23785
23812
21917
19713
19282
18788
21453
24482
27474
27264
27349
30632
29429
30084
26290
24379
23335
21346
21106
24514
28353
30805
31348
34556
33855
34787
32529
29998
29257
28155
30466
35704
39327
39351
42234
43630
43722
43121
37985
37135
34646
33026
35087
38846
42013
43908
42868
44423
44167
43636
44382
42142
43452
36912
42413
45344
44873
47510
49554
47369
45998
48140
48441
44928
40454
38661
37246
36843
36424
37594
38144
38737
34560
36080
33508
35462
33374
32110
35533
35532
37903
36763
40399
44164
44496
43110
43880
43930
44327




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Herman Ole Andreas Wold' @ www.yougetit.org

\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 & 1 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ www.yougetit.org \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117099&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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ www.yougetit.org[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117099&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117099&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 time1 seconds
R Server'Herman Ole Andreas Wold' @ www.yougetit.org







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[131])
11940454-------
12038661-------
12137246-------
12236843-------
12336424-------
12437594-------
12538144-------
12638737-------
12734560-------
12836080-------
12933508-------
13035462-------
13133374-------
1323211031089.55327948.572734230.53330.26210.07700.077
1333553332272.442427657.019136887.86580.08310.52750.01730.32
1343553234413.39228546.273740280.51040.35430.35420.20850.6358
1353790335954.127528927.539142980.71590.29340.54690.44790.7641
1363676336418.021928277.649844558.39390.46690.36030.38850.7682
1374039937033.077527801.872746264.28230.23740.52290.40680.7814
1384416437251.430326939.528347563.33220.09440.27480.38880.7694
1394449635552.163924161.811646942.51620.06190.06920.56780.6461
1404311035670.120323198.413448141.82720.12120.08270.47430.6409
1414388033388.695419829.22346948.16780.06470.080.49310.5008
1424393031394.610616738.502446050.71880.04680.04750.29320.3956
1434432729594.323513830.946945357.70.03350.03730.31920.3192

\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[131]) \tabularnewline
119 & 40454 & - & - & - & - & - & - & - \tabularnewline
120 & 38661 & - & - & - & - & - & - & - \tabularnewline
121 & 37246 & - & - & - & - & - & - & - \tabularnewline
122 & 36843 & - & - & - & - & - & - & - \tabularnewline
123 & 36424 & - & - & - & - & - & - & - \tabularnewline
124 & 37594 & - & - & - & - & - & - & - \tabularnewline
125 & 38144 & - & - & - & - & - & - & - \tabularnewline
126 & 38737 & - & - & - & - & - & - & - \tabularnewline
127 & 34560 & - & - & - & - & - & - & - \tabularnewline
128 & 36080 & - & - & - & - & - & - & - \tabularnewline
129 & 33508 & - & - & - & - & - & - & - \tabularnewline
130 & 35462 & - & - & - & - & - & - & - \tabularnewline
131 & 33374 & - & - & - & - & - & - & - \tabularnewline
132 & 32110 & 31089.553 & 27948.5727 & 34230.5333 & 0.2621 & 0.077 & 0 & 0.077 \tabularnewline
133 & 35533 & 32272.4424 & 27657.0191 & 36887.8658 & 0.0831 & 0.5275 & 0.0173 & 0.32 \tabularnewline
134 & 35532 & 34413.392 & 28546.2737 & 40280.5104 & 0.3543 & 0.3542 & 0.2085 & 0.6358 \tabularnewline
135 & 37903 & 35954.1275 & 28927.5391 & 42980.7159 & 0.2934 & 0.5469 & 0.4479 & 0.7641 \tabularnewline
136 & 36763 & 36418.0219 & 28277.6498 & 44558.3939 & 0.4669 & 0.3603 & 0.3885 & 0.7682 \tabularnewline
137 & 40399 & 37033.0775 & 27801.8727 & 46264.2823 & 0.2374 & 0.5229 & 0.4068 & 0.7814 \tabularnewline
138 & 44164 & 37251.4303 & 26939.5283 & 47563.3322 & 0.0944 & 0.2748 & 0.3888 & 0.7694 \tabularnewline
139 & 44496 & 35552.1639 & 24161.8116 & 46942.5162 & 0.0619 & 0.0692 & 0.5678 & 0.6461 \tabularnewline
140 & 43110 & 35670.1203 & 23198.4134 & 48141.8272 & 0.1212 & 0.0827 & 0.4743 & 0.6409 \tabularnewline
141 & 43880 & 33388.6954 & 19829.223 & 46948.1678 & 0.0647 & 0.08 & 0.4931 & 0.5008 \tabularnewline
142 & 43930 & 31394.6106 & 16738.5024 & 46050.7188 & 0.0468 & 0.0475 & 0.2932 & 0.3956 \tabularnewline
143 & 44327 & 29594.3235 & 13830.9469 & 45357.7 & 0.0335 & 0.0373 & 0.3192 & 0.3192 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117099&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[131])[/C][/ROW]
[ROW][C]119[/C][C]40454[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]38661[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]37246[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]36843[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]36424[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]37594[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]38144[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]38737[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]34560[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]36080[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]33508[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]35462[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]131[/C][C]33374[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]132[/C][C]32110[/C][C]31089.553[/C][C]27948.5727[/C][C]34230.5333[/C][C]0.2621[/C][C]0.077[/C][C]0[/C][C]0.077[/C][/ROW]
[ROW][C]133[/C][C]35533[/C][C]32272.4424[/C][C]27657.0191[/C][C]36887.8658[/C][C]0.0831[/C][C]0.5275[/C][C]0.0173[/C][C]0.32[/C][/ROW]
[ROW][C]134[/C][C]35532[/C][C]34413.392[/C][C]28546.2737[/C][C]40280.5104[/C][C]0.3543[/C][C]0.3542[/C][C]0.2085[/C][C]0.6358[/C][/ROW]
[ROW][C]135[/C][C]37903[/C][C]35954.1275[/C][C]28927.5391[/C][C]42980.7159[/C][C]0.2934[/C][C]0.5469[/C][C]0.4479[/C][C]0.7641[/C][/ROW]
[ROW][C]136[/C][C]36763[/C][C]36418.0219[/C][C]28277.6498[/C][C]44558.3939[/C][C]0.4669[/C][C]0.3603[/C][C]0.3885[/C][C]0.7682[/C][/ROW]
[ROW][C]137[/C][C]40399[/C][C]37033.0775[/C][C]27801.8727[/C][C]46264.2823[/C][C]0.2374[/C][C]0.5229[/C][C]0.4068[/C][C]0.7814[/C][/ROW]
[ROW][C]138[/C][C]44164[/C][C]37251.4303[/C][C]26939.5283[/C][C]47563.3322[/C][C]0.0944[/C][C]0.2748[/C][C]0.3888[/C][C]0.7694[/C][/ROW]
[ROW][C]139[/C][C]44496[/C][C]35552.1639[/C][C]24161.8116[/C][C]46942.5162[/C][C]0.0619[/C][C]0.0692[/C][C]0.5678[/C][C]0.6461[/C][/ROW]
[ROW][C]140[/C][C]43110[/C][C]35670.1203[/C][C]23198.4134[/C][C]48141.8272[/C][C]0.1212[/C][C]0.0827[/C][C]0.4743[/C][C]0.6409[/C][/ROW]
[ROW][C]141[/C][C]43880[/C][C]33388.6954[/C][C]19829.223[/C][C]46948.1678[/C][C]0.0647[/C][C]0.08[/C][C]0.4931[/C][C]0.5008[/C][/ROW]
[ROW][C]142[/C][C]43930[/C][C]31394.6106[/C][C]16738.5024[/C][C]46050.7188[/C][C]0.0468[/C][C]0.0475[/C][C]0.2932[/C][C]0.3956[/C][/ROW]
[ROW][C]143[/C][C]44327[/C][C]29594.3235[/C][C]13830.9469[/C][C]45357.7[/C][C]0.0335[/C][C]0.0373[/C][C]0.3192[/C][C]0.3192[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117099&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117099&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[131])
11940454-------
12038661-------
12137246-------
12236843-------
12336424-------
12437594-------
12538144-------
12638737-------
12734560-------
12836080-------
12933508-------
13035462-------
13133374-------
1323211031089.55327948.572734230.53330.26210.07700.077
1333553332272.442427657.019136887.86580.08310.52750.01730.32
1343553234413.39228546.273740280.51040.35430.35420.20850.6358
1353790335954.127528927.539142980.71590.29340.54690.44790.7641
1363676336418.021928277.649844558.39390.46690.36030.38850.7682
1374039937033.077527801.872746264.28230.23740.52290.40680.7814
1384416437251.430326939.528347563.33220.09440.27480.38880.7694
1394449635552.163924161.811646942.51620.06190.06920.56780.6461
1404311035670.120323198.413448141.82720.12120.08270.47430.6409
1414388033388.695419829.22346948.16780.06470.080.49310.5008
1424393031394.610616738.502446050.71880.04680.04750.29320.3956
1434432729594.323513830.946945357.70.03350.03730.31920.3192







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1320.05150.032801041312.102800
1330.0730.1010.066910631235.58895836273.84592415.8381
1340.0870.03250.05551251283.7924307943.82792075.5587
1350.09970.05420.05513798103.98774180483.86782044.6232
1360.1140.00950.046119009.90283368189.07481835.2627
1370.12720.09090.053511329434.31634695063.28172166.8095
1380.14120.18560.072447783620.427310850571.44543294.0206
1390.16350.25160.094879992204.119719493275.52974415.119
1400.17840.20860.107455351809.431523477557.07434845.3645
1410.20720.31420.1281110067472.58832136548.62575668.9107
1420.23820.39930.1527157135987.118543500133.94326595.4631
1430.27180.49780.1815217051757.614257962769.24917613.3284

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
132 & 0.0515 & 0.0328 & 0 & 1041312.1028 & 0 & 0 \tabularnewline
133 & 0.073 & 0.101 & 0.0669 & 10631235.5889 & 5836273.8459 & 2415.8381 \tabularnewline
134 & 0.087 & 0.0325 & 0.0555 & 1251283.792 & 4307943.8279 & 2075.5587 \tabularnewline
135 & 0.0997 & 0.0542 & 0.0551 & 3798103.9877 & 4180483.8678 & 2044.6232 \tabularnewline
136 & 0.114 & 0.0095 & 0.046 & 119009.9028 & 3368189.0748 & 1835.2627 \tabularnewline
137 & 0.1272 & 0.0909 & 0.0535 & 11329434.3163 & 4695063.2817 & 2166.8095 \tabularnewline
138 & 0.1412 & 0.1856 & 0.0724 & 47783620.4273 & 10850571.4454 & 3294.0206 \tabularnewline
139 & 0.1635 & 0.2516 & 0.0948 & 79992204.1197 & 19493275.5297 & 4415.119 \tabularnewline
140 & 0.1784 & 0.2086 & 0.1074 & 55351809.4315 & 23477557.0743 & 4845.3645 \tabularnewline
141 & 0.2072 & 0.3142 & 0.1281 & 110067472.588 & 32136548.6257 & 5668.9107 \tabularnewline
142 & 0.2382 & 0.3993 & 0.1527 & 157135987.1185 & 43500133.9432 & 6595.4631 \tabularnewline
143 & 0.2718 & 0.4978 & 0.1815 & 217051757.6142 & 57962769.2491 & 7613.3284 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117099&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]132[/C][C]0.0515[/C][C]0.0328[/C][C]0[/C][C]1041312.1028[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]133[/C][C]0.073[/C][C]0.101[/C][C]0.0669[/C][C]10631235.5889[/C][C]5836273.8459[/C][C]2415.8381[/C][/ROW]
[ROW][C]134[/C][C]0.087[/C][C]0.0325[/C][C]0.0555[/C][C]1251283.792[/C][C]4307943.8279[/C][C]2075.5587[/C][/ROW]
[ROW][C]135[/C][C]0.0997[/C][C]0.0542[/C][C]0.0551[/C][C]3798103.9877[/C][C]4180483.8678[/C][C]2044.6232[/C][/ROW]
[ROW][C]136[/C][C]0.114[/C][C]0.0095[/C][C]0.046[/C][C]119009.9028[/C][C]3368189.0748[/C][C]1835.2627[/C][/ROW]
[ROW][C]137[/C][C]0.1272[/C][C]0.0909[/C][C]0.0535[/C][C]11329434.3163[/C][C]4695063.2817[/C][C]2166.8095[/C][/ROW]
[ROW][C]138[/C][C]0.1412[/C][C]0.1856[/C][C]0.0724[/C][C]47783620.4273[/C][C]10850571.4454[/C][C]3294.0206[/C][/ROW]
[ROW][C]139[/C][C]0.1635[/C][C]0.2516[/C][C]0.0948[/C][C]79992204.1197[/C][C]19493275.5297[/C][C]4415.119[/C][/ROW]
[ROW][C]140[/C][C]0.1784[/C][C]0.2086[/C][C]0.1074[/C][C]55351809.4315[/C][C]23477557.0743[/C][C]4845.3645[/C][/ROW]
[ROW][C]141[/C][C]0.2072[/C][C]0.3142[/C][C]0.1281[/C][C]110067472.588[/C][C]32136548.6257[/C][C]5668.9107[/C][/ROW]
[ROW][C]142[/C][C]0.2382[/C][C]0.3993[/C][C]0.1527[/C][C]157135987.1185[/C][C]43500133.9432[/C][C]6595.4631[/C][/ROW]
[ROW][C]143[/C][C]0.2718[/C][C]0.4978[/C][C]0.1815[/C][C]217051757.6142[/C][C]57962769.2491[/C][C]7613.3284[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117099&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117099&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
1320.05150.032801041312.102800
1330.0730.1010.066910631235.58895836273.84592415.8381
1340.0870.03250.05551251283.7924307943.82792075.5587
1350.09970.05420.05513798103.98774180483.86782044.6232
1360.1140.00950.046119009.90283368189.07481835.2627
1370.12720.09090.053511329434.31634695063.28172166.8095
1380.14120.18560.072447783620.427310850571.44543294.0206
1390.16350.25160.094879992204.119719493275.52974415.119
1400.17840.20860.107455351809.431523477557.07434845.3645
1410.20720.31420.1281110067472.58832136548.62575668.9107
1420.23820.39930.1527157135987.118543500133.94326595.4631
1430.27180.49780.1815217051757.614257962769.24917613.3284



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