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 computationWed, 29 Dec 2010 20:14:11 +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/t1293653531wtxarcdwhpyu8cp.htm/, Retrieved Fri, 03 May 2024 10:39:37 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=117102, Retrieved Fri, 03 May 2024 10:39:37 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact127
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [paper ARIMA forec...] [2010-12-26 09:05:52] [df61ce38492c371f14c407a12b3bb2eb]
-         [ARIMA Forecasting] [] [2010-12-29 20:14:11] [1e640daebbc6b5a89eef23229b5a56d5] [Current]
Feedback Forum

Post a new message
Dataseries X:
16198.90
16554.20
19554.20
15903.80
18003.80
18329.60
16260.70
14851.90
18174.10
18406.60
18466.50
16016.50
17428.50
17167.20
19630.00
17183.60
18344.70
19301.40
18147.50
16192.90
18374.40
20515.20
18957.20
16471.50
18746.80
19009.50
19211.20
20547.70
19325.80
20605.50
20056.90
16141.40
20359.80
19711.60
15638.60
14384.50
13721.40
14134.30
15021.70
14212.60
13635.00
15446.90
14762.10
12521.00
16236.80
16065.00
16032.10
15794.30
15160.00
15692.10
18908.90
17424.50
17014.20
19790.40
17681.20
16006.90
19601.70




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\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 & 2 seconds \tabularnewline
R Server & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117102&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117102&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117102&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 time2 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk







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[45])
3320359.8-------
3419711.6-------
3515638.6-------
3614384.5-------
3713721.4-------
3814134.3-------
3915021.7-------
4014212.6-------
4113635-------
4215446.9-------
4314762.1-------
4412521-------
4516236.8-------
461606515974.417113831.816118117.01820.4670.40523e-040.4052
4716032.112598.686110225.786214971.58610.00230.00210.0060.0013
4815794.310855.98577873.133613838.83776e-043e-040.01022e-04
491516010711.58886815.323214607.85430.01260.00530.0650.0027
5015692.111229.49996963.039115495.96070.02020.03550.0910.0107
5118908.911889.05586898.096216880.01550.00290.06770.10930.0439
5217424.511474.11255882.878717065.34640.01850.00460.16850.0475
5317014.210763.75284733.225116794.28060.02110.01520.17540.0376
5419790.412565.19575906.65519223.73650.01670.09520.19810.1399
5517681.212081.73924961.650919201.82760.06160.01690.23030.1264
5616006.99686.56622111.285717261.84670.0510.01930.23170.0451
5719601.713489.54255404.661321574.42360.06920.27080.25270.2527

\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[45]) \tabularnewline
33 & 20359.8 & - & - & - & - & - & - & - \tabularnewline
34 & 19711.6 & - & - & - & - & - & - & - \tabularnewline
35 & 15638.6 & - & - & - & - & - & - & - \tabularnewline
36 & 14384.5 & - & - & - & - & - & - & - \tabularnewline
37 & 13721.4 & - & - & - & - & - & - & - \tabularnewline
38 & 14134.3 & - & - & - & - & - & - & - \tabularnewline
39 & 15021.7 & - & - & - & - & - & - & - \tabularnewline
40 & 14212.6 & - & - & - & - & - & - & - \tabularnewline
41 & 13635 & - & - & - & - & - & - & - \tabularnewline
42 & 15446.9 & - & - & - & - & - & - & - \tabularnewline
43 & 14762.1 & - & - & - & - & - & - & - \tabularnewline
44 & 12521 & - & - & - & - & - & - & - \tabularnewline
45 & 16236.8 & - & - & - & - & - & - & - \tabularnewline
46 & 16065 & 15974.4171 & 13831.8161 & 18117.0182 & 0.467 & 0.4052 & 3e-04 & 0.4052 \tabularnewline
47 & 16032.1 & 12598.6861 & 10225.7862 & 14971.5861 & 0.0023 & 0.0021 & 0.006 & 0.0013 \tabularnewline
48 & 15794.3 & 10855.9857 & 7873.1336 & 13838.8377 & 6e-04 & 3e-04 & 0.0102 & 2e-04 \tabularnewline
49 & 15160 & 10711.5888 & 6815.3232 & 14607.8543 & 0.0126 & 0.0053 & 0.065 & 0.0027 \tabularnewline
50 & 15692.1 & 11229.4999 & 6963.0391 & 15495.9607 & 0.0202 & 0.0355 & 0.091 & 0.0107 \tabularnewline
51 & 18908.9 & 11889.0558 & 6898.0962 & 16880.0155 & 0.0029 & 0.0677 & 0.1093 & 0.0439 \tabularnewline
52 & 17424.5 & 11474.1125 & 5882.8787 & 17065.3464 & 0.0185 & 0.0046 & 0.1685 & 0.0475 \tabularnewline
53 & 17014.2 & 10763.7528 & 4733.2251 & 16794.2806 & 0.0211 & 0.0152 & 0.1754 & 0.0376 \tabularnewline
54 & 19790.4 & 12565.1957 & 5906.655 & 19223.7365 & 0.0167 & 0.0952 & 0.1981 & 0.1399 \tabularnewline
55 & 17681.2 & 12081.7392 & 4961.6509 & 19201.8276 & 0.0616 & 0.0169 & 0.2303 & 0.1264 \tabularnewline
56 & 16006.9 & 9686.5662 & 2111.2857 & 17261.8467 & 0.051 & 0.0193 & 0.2317 & 0.0451 \tabularnewline
57 & 19601.7 & 13489.5425 & 5404.6613 & 21574.4236 & 0.0692 & 0.2708 & 0.2527 & 0.2527 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117102&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[45])[/C][/ROW]
[ROW][C]33[/C][C]20359.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]19711.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]15638.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]14384.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]13721.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]14134.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]15021.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]14212.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]13635[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]15446.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]14762.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]12521[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]16236.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]16065[/C][C]15974.4171[/C][C]13831.8161[/C][C]18117.0182[/C][C]0.467[/C][C]0.4052[/C][C]3e-04[/C][C]0.4052[/C][/ROW]
[ROW][C]47[/C][C]16032.1[/C][C]12598.6861[/C][C]10225.7862[/C][C]14971.5861[/C][C]0.0023[/C][C]0.0021[/C][C]0.006[/C][C]0.0013[/C][/ROW]
[ROW][C]48[/C][C]15794.3[/C][C]10855.9857[/C][C]7873.1336[/C][C]13838.8377[/C][C]6e-04[/C][C]3e-04[/C][C]0.0102[/C][C]2e-04[/C][/ROW]
[ROW][C]49[/C][C]15160[/C][C]10711.5888[/C][C]6815.3232[/C][C]14607.8543[/C][C]0.0126[/C][C]0.0053[/C][C]0.065[/C][C]0.0027[/C][/ROW]
[ROW][C]50[/C][C]15692.1[/C][C]11229.4999[/C][C]6963.0391[/C][C]15495.9607[/C][C]0.0202[/C][C]0.0355[/C][C]0.091[/C][C]0.0107[/C][/ROW]
[ROW][C]51[/C][C]18908.9[/C][C]11889.0558[/C][C]6898.0962[/C][C]16880.0155[/C][C]0.0029[/C][C]0.0677[/C][C]0.1093[/C][C]0.0439[/C][/ROW]
[ROW][C]52[/C][C]17424.5[/C][C]11474.1125[/C][C]5882.8787[/C][C]17065.3464[/C][C]0.0185[/C][C]0.0046[/C][C]0.1685[/C][C]0.0475[/C][/ROW]
[ROW][C]53[/C][C]17014.2[/C][C]10763.7528[/C][C]4733.2251[/C][C]16794.2806[/C][C]0.0211[/C][C]0.0152[/C][C]0.1754[/C][C]0.0376[/C][/ROW]
[ROW][C]54[/C][C]19790.4[/C][C]12565.1957[/C][C]5906.655[/C][C]19223.7365[/C][C]0.0167[/C][C]0.0952[/C][C]0.1981[/C][C]0.1399[/C][/ROW]
[ROW][C]55[/C][C]17681.2[/C][C]12081.7392[/C][C]4961.6509[/C][C]19201.8276[/C][C]0.0616[/C][C]0.0169[/C][C]0.2303[/C][C]0.1264[/C][/ROW]
[ROW][C]56[/C][C]16006.9[/C][C]9686.5662[/C][C]2111.2857[/C][C]17261.8467[/C][C]0.051[/C][C]0.0193[/C][C]0.2317[/C][C]0.0451[/C][/ROW]
[ROW][C]57[/C][C]19601.7[/C][C]13489.5425[/C][C]5404.6613[/C][C]21574.4236[/C][C]0.0692[/C][C]0.2708[/C][C]0.2527[/C][C]0.2527[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117102&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117102&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[45])
3320359.8-------
3419711.6-------
3515638.6-------
3614384.5-------
3713721.4-------
3814134.3-------
3915021.7-------
4014212.6-------
4113635-------
4215446.9-------
4314762.1-------
4412521-------
4516236.8-------
461606515974.417113831.816118117.01820.4670.40523e-040.4052
4716032.112598.686110225.786214971.58610.00230.00210.0060.0013
4815794.310855.98577873.133613838.83776e-043e-040.01022e-04
491516010711.58886815.323214607.85430.01260.00530.0650.0027
5015692.111229.49996963.039115495.96070.02020.03550.0910.0107
5118908.911889.05586898.096216880.01550.00290.06770.10930.0439
5217424.511474.11255882.878717065.34640.01850.00460.16850.0475
5317014.210763.75284733.225116794.28060.02110.01520.17540.0376
5419790.412565.19575906.65519223.73650.01670.09520.19810.1399
5517681.212081.73924961.650919201.82760.06160.01690.23030.1264
5616006.99686.56622111.285717261.84670.0510.01930.23170.0451
5719601.713489.54255404.661321574.42360.06920.27080.25270.2527







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
460.06840.005708205.254700
470.09610.27250.139111788330.98495898268.11982428.635
480.14020.45490.244424386948.189912061161.47653472.9183
490.18560.41530.287119788362.349113992961.69463740.7167
500.19380.39740.309219914799.975115177329.35073895.8092
510.21420.59040.35649278212.127920860809.81364567.3636
520.24860.51860.379335407110.97222938852.83624789.4522
530.28580.58070.404439068090.039224955007.48664995.4987
540.27040.5750.423452203576.778627982626.29685289.8607
550.30070.46350.427431353960.967828319759.76395321.6313
560.3990.65250.447939946619.728229376747.03345420.032
570.30580.45310.448337358469.559930041890.57735481.0483

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
46 & 0.0684 & 0.0057 & 0 & 8205.2547 & 0 & 0 \tabularnewline
47 & 0.0961 & 0.2725 & 0.1391 & 11788330.9849 & 5898268.1198 & 2428.635 \tabularnewline
48 & 0.1402 & 0.4549 & 0.2444 & 24386948.1899 & 12061161.4765 & 3472.9183 \tabularnewline
49 & 0.1856 & 0.4153 & 0.2871 & 19788362.3491 & 13992961.6946 & 3740.7167 \tabularnewline
50 & 0.1938 & 0.3974 & 0.3092 & 19914799.9751 & 15177329.3507 & 3895.8092 \tabularnewline
51 & 0.2142 & 0.5904 & 0.356 & 49278212.1279 & 20860809.8136 & 4567.3636 \tabularnewline
52 & 0.2486 & 0.5186 & 0.3793 & 35407110.972 & 22938852.8362 & 4789.4522 \tabularnewline
53 & 0.2858 & 0.5807 & 0.4044 & 39068090.0392 & 24955007.4866 & 4995.4987 \tabularnewline
54 & 0.2704 & 0.575 & 0.4234 & 52203576.7786 & 27982626.2968 & 5289.8607 \tabularnewline
55 & 0.3007 & 0.4635 & 0.4274 & 31353960.9678 & 28319759.7639 & 5321.6313 \tabularnewline
56 & 0.399 & 0.6525 & 0.4479 & 39946619.7282 & 29376747.0334 & 5420.032 \tabularnewline
57 & 0.3058 & 0.4531 & 0.4483 & 37358469.5599 & 30041890.5773 & 5481.0483 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117102&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]46[/C][C]0.0684[/C][C]0.0057[/C][C]0[/C][C]8205.2547[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]47[/C][C]0.0961[/C][C]0.2725[/C][C]0.1391[/C][C]11788330.9849[/C][C]5898268.1198[/C][C]2428.635[/C][/ROW]
[ROW][C]48[/C][C]0.1402[/C][C]0.4549[/C][C]0.2444[/C][C]24386948.1899[/C][C]12061161.4765[/C][C]3472.9183[/C][/ROW]
[ROW][C]49[/C][C]0.1856[/C][C]0.4153[/C][C]0.2871[/C][C]19788362.3491[/C][C]13992961.6946[/C][C]3740.7167[/C][/ROW]
[ROW][C]50[/C][C]0.1938[/C][C]0.3974[/C][C]0.3092[/C][C]19914799.9751[/C][C]15177329.3507[/C][C]3895.8092[/C][/ROW]
[ROW][C]51[/C][C]0.2142[/C][C]0.5904[/C][C]0.356[/C][C]49278212.1279[/C][C]20860809.8136[/C][C]4567.3636[/C][/ROW]
[ROW][C]52[/C][C]0.2486[/C][C]0.5186[/C][C]0.3793[/C][C]35407110.972[/C][C]22938852.8362[/C][C]4789.4522[/C][/ROW]
[ROW][C]53[/C][C]0.2858[/C][C]0.5807[/C][C]0.4044[/C][C]39068090.0392[/C][C]24955007.4866[/C][C]4995.4987[/C][/ROW]
[ROW][C]54[/C][C]0.2704[/C][C]0.575[/C][C]0.4234[/C][C]52203576.7786[/C][C]27982626.2968[/C][C]5289.8607[/C][/ROW]
[ROW][C]55[/C][C]0.3007[/C][C]0.4635[/C][C]0.4274[/C][C]31353960.9678[/C][C]28319759.7639[/C][C]5321.6313[/C][/ROW]
[ROW][C]56[/C][C]0.399[/C][C]0.6525[/C][C]0.4479[/C][C]39946619.7282[/C][C]29376747.0334[/C][C]5420.032[/C][/ROW]
[ROW][C]57[/C][C]0.3058[/C][C]0.4531[/C][C]0.4483[/C][C]37358469.5599[/C][C]30041890.5773[/C][C]5481.0483[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117102&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117102&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
460.06840.005708205.254700
470.09610.27250.139111788330.98495898268.11982428.635
480.14020.45490.244424386948.189912061161.47653472.9183
490.18560.41530.287119788362.349113992961.69463740.7167
500.19380.39740.309219914799.975115177329.35073895.8092
510.21420.59040.35649278212.127920860809.81364567.3636
520.24860.51860.379335407110.97222938852.83624789.4522
530.28580.58070.404439068090.039224955007.48664995.4987
540.27040.5750.423452203576.778627982626.29685289.8607
550.30070.46350.427431353960.967828319759.76395321.6313
560.3990.65250.447939946619.728229376747.03345420.032
570.30580.45310.448337358469.559930041890.57735481.0483



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ; par11 = ; par12 = ; par13 = ; par14 = ; par15 = ; par16 = ; par17 = ; par18 = ; par19 = ; par20 = ;
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')