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 computationFri, 21 Dec 2012 10:03:43 -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/2012/Dec/21/t1356102248xr587lo6b2h8446.htm/, Retrieved Fri, 19 Apr 2024 17:24:38 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=203767, Retrieved Fri, 19 Apr 2024 17:24:38 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact71
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima Forecasting] [2012-12-21 15:03:43] [e5cf4d544f75f57c12196ef0ffd71d75] [Current]
Feedback Forum

Post a new message
Dataseries X:
41
39
50
40
43
38
44
35
39
35
29
49
50
59
63
32
39
47
53
60
57
52
70
90
74
62
55
84
94
70
108
139
120
97
126
149
158
124
140
109
114
77
120
133
110
92
97
78
99
107
112
90
98
125
155
190
236
189
174
178
136
161
171
149
184
155
276
224
213
279
268
287
238
213
257
293
212
246
353
339
308
247
257
322
298
273
312
249
286
279
309
401
309
328
353
354
327
324
285
243
241
287
355
460
364
487
452
391
500
451
375
372
302
316
398
394
431
431




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=203767&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'Gertrude Mary Cox' @ cox.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[106])
94328-------
95353-------
96354-------
97327-------
98324-------
99285-------
100243-------
101241-------
102287-------
103355-------
104460-------
105364-------
106487-------
107452431.0568365.0797497.0340.26690.04830.98980.0483
108391439.0389364.195513.88270.10420.36710.9870.1046
109500410.759328.718492.80010.01650.68160.97730.0343
110451399.5281312.7345486.32170.12250.01160.9560.0241
111375398.085307.4647488.70540.30880.12620.99280.0272
112372376.5253282.6785470.37220.46240.51270.99740.0105
113302375.3456278.6201472.07120.06860.5270.99680.0118
114316385.8547286.4781485.23140.08410.95090.97440.023
115398427.7488325.875529.62260.28350.98420.91920.1272
116394464.7219360.4619568.98180.09180.89510.53540.3377
117431424.2099317.648530.77180.45030.71080.86590.1241
118431452.1112343.3148560.90760.35190.64810.26480.2648

\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[106]) \tabularnewline
94 & 328 & - & - & - & - & - & - & - \tabularnewline
95 & 353 & - & - & - & - & - & - & - \tabularnewline
96 & 354 & - & - & - & - & - & - & - \tabularnewline
97 & 327 & - & - & - & - & - & - & - \tabularnewline
98 & 324 & - & - & - & - & - & - & - \tabularnewline
99 & 285 & - & - & - & - & - & - & - \tabularnewline
100 & 243 & - & - & - & - & - & - & - \tabularnewline
101 & 241 & - & - & - & - & - & - & - \tabularnewline
102 & 287 & - & - & - & - & - & - & - \tabularnewline
103 & 355 & - & - & - & - & - & - & - \tabularnewline
104 & 460 & - & - & - & - & - & - & - \tabularnewline
105 & 364 & - & - & - & - & - & - & - \tabularnewline
106 & 487 & - & - & - & - & - & - & - \tabularnewline
107 & 452 & 431.0568 & 365.0797 & 497.034 & 0.2669 & 0.0483 & 0.9898 & 0.0483 \tabularnewline
108 & 391 & 439.0389 & 364.195 & 513.8827 & 0.1042 & 0.3671 & 0.987 & 0.1046 \tabularnewline
109 & 500 & 410.759 & 328.718 & 492.8001 & 0.0165 & 0.6816 & 0.9773 & 0.0343 \tabularnewline
110 & 451 & 399.5281 & 312.7345 & 486.3217 & 0.1225 & 0.0116 & 0.956 & 0.0241 \tabularnewline
111 & 375 & 398.085 & 307.4647 & 488.7054 & 0.3088 & 0.1262 & 0.9928 & 0.0272 \tabularnewline
112 & 372 & 376.5253 & 282.6785 & 470.3722 & 0.4624 & 0.5127 & 0.9974 & 0.0105 \tabularnewline
113 & 302 & 375.3456 & 278.6201 & 472.0712 & 0.0686 & 0.527 & 0.9968 & 0.0118 \tabularnewline
114 & 316 & 385.8547 & 286.4781 & 485.2314 & 0.0841 & 0.9509 & 0.9744 & 0.023 \tabularnewline
115 & 398 & 427.7488 & 325.875 & 529.6226 & 0.2835 & 0.9842 & 0.9192 & 0.1272 \tabularnewline
116 & 394 & 464.7219 & 360.4619 & 568.9818 & 0.0918 & 0.8951 & 0.5354 & 0.3377 \tabularnewline
117 & 431 & 424.2099 & 317.648 & 530.7718 & 0.4503 & 0.7108 & 0.8659 & 0.1241 \tabularnewline
118 & 431 & 452.1112 & 343.3148 & 560.9076 & 0.3519 & 0.6481 & 0.2648 & 0.2648 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=203767&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[106])[/C][/ROW]
[ROW][C]94[/C][C]328[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]353[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]354[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]327[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]324[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]285[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]243[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]241[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]287[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]355[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]460[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]364[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]487[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]452[/C][C]431.0568[/C][C]365.0797[/C][C]497.034[/C][C]0.2669[/C][C]0.0483[/C][C]0.9898[/C][C]0.0483[/C][/ROW]
[ROW][C]108[/C][C]391[/C][C]439.0389[/C][C]364.195[/C][C]513.8827[/C][C]0.1042[/C][C]0.3671[/C][C]0.987[/C][C]0.1046[/C][/ROW]
[ROW][C]109[/C][C]500[/C][C]410.759[/C][C]328.718[/C][C]492.8001[/C][C]0.0165[/C][C]0.6816[/C][C]0.9773[/C][C]0.0343[/C][/ROW]
[ROW][C]110[/C][C]451[/C][C]399.5281[/C][C]312.7345[/C][C]486.3217[/C][C]0.1225[/C][C]0.0116[/C][C]0.956[/C][C]0.0241[/C][/ROW]
[ROW][C]111[/C][C]375[/C][C]398.085[/C][C]307.4647[/C][C]488.7054[/C][C]0.3088[/C][C]0.1262[/C][C]0.9928[/C][C]0.0272[/C][/ROW]
[ROW][C]112[/C][C]372[/C][C]376.5253[/C][C]282.6785[/C][C]470.3722[/C][C]0.4624[/C][C]0.5127[/C][C]0.9974[/C][C]0.0105[/C][/ROW]
[ROW][C]113[/C][C]302[/C][C]375.3456[/C][C]278.6201[/C][C]472.0712[/C][C]0.0686[/C][C]0.527[/C][C]0.9968[/C][C]0.0118[/C][/ROW]
[ROW][C]114[/C][C]316[/C][C]385.8547[/C][C]286.4781[/C][C]485.2314[/C][C]0.0841[/C][C]0.9509[/C][C]0.9744[/C][C]0.023[/C][/ROW]
[ROW][C]115[/C][C]398[/C][C]427.7488[/C][C]325.875[/C][C]529.6226[/C][C]0.2835[/C][C]0.9842[/C][C]0.9192[/C][C]0.1272[/C][/ROW]
[ROW][C]116[/C][C]394[/C][C]464.7219[/C][C]360.4619[/C][C]568.9818[/C][C]0.0918[/C][C]0.8951[/C][C]0.5354[/C][C]0.3377[/C][/ROW]
[ROW][C]117[/C][C]431[/C][C]424.2099[/C][C]317.648[/C][C]530.7718[/C][C]0.4503[/C][C]0.7108[/C][C]0.8659[/C][C]0.1241[/C][/ROW]
[ROW][C]118[/C][C]431[/C][C]452.1112[/C][C]343.3148[/C][C]560.9076[/C][C]0.3519[/C][C]0.6481[/C][C]0.2648[/C][C]0.2648[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=203767&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=203767&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[106])
94328-------
95353-------
96354-------
97327-------
98324-------
99285-------
100243-------
101241-------
102287-------
103355-------
104460-------
105364-------
106487-------
107452431.0568365.0797497.0340.26690.04830.98980.0483
108391439.0389364.195513.88270.10420.36710.9870.1046
109500410.759328.718492.80010.01650.68160.97730.0343
110451399.5281312.7345486.32170.12250.01160.9560.0241
111375398.085307.4647488.70540.30880.12620.99280.0272
112372376.5253282.6785470.37220.46240.51270.99740.0105
113302375.3456278.6201472.07120.06860.5270.99680.0118
114316385.8547286.4781485.23140.08410.95090.97440.023
115398427.7488325.875529.62260.28350.98420.91920.1272
116394464.7219360.4619568.98180.09180.89510.53540.3377
117431424.2099317.648530.77180.45030.71080.86590.1241
118431452.1112343.3148560.90760.35190.64810.26480.2648







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1070.07810.04860438.615800
1080.087-0.10940.0792307.73181373.173837.0564
1090.10190.21730.12517963.95143570.099759.7503
1100.11080.12880.1262649.35163339.912657.792
1110.1161-0.0580.1124532.91862778.513852.7116
1120.1272-0.0120.095720.47872318.841348.1543
1130.1315-0.19540.10995379.58382756.090252.4985
1140.1314-0.1810.11884879.68313021.539354.9685
1150.1215-0.06950.1133884.99242784.145252.765
1160.1145-0.15220.11725001.58033005.888754.826
1170.12820.0160.10846.10572736.817652.3146
1180.1228-0.04670.1029445.68342545.889750.4568

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
107 & 0.0781 & 0.0486 & 0 & 438.6158 & 0 & 0 \tabularnewline
108 & 0.087 & -0.1094 & 0.079 & 2307.7318 & 1373.1738 & 37.0564 \tabularnewline
109 & 0.1019 & 0.2173 & 0.1251 & 7963.9514 & 3570.0997 & 59.7503 \tabularnewline
110 & 0.1108 & 0.1288 & 0.126 & 2649.3516 & 3339.9126 & 57.792 \tabularnewline
111 & 0.1161 & -0.058 & 0.1124 & 532.9186 & 2778.5138 & 52.7116 \tabularnewline
112 & 0.1272 & -0.012 & 0.0957 & 20.4787 & 2318.8413 & 48.1543 \tabularnewline
113 & 0.1315 & -0.1954 & 0.1099 & 5379.5838 & 2756.0902 & 52.4985 \tabularnewline
114 & 0.1314 & -0.181 & 0.1188 & 4879.6831 & 3021.5393 & 54.9685 \tabularnewline
115 & 0.1215 & -0.0695 & 0.1133 & 884.9924 & 2784.1452 & 52.765 \tabularnewline
116 & 0.1145 & -0.1522 & 0.1172 & 5001.5803 & 3005.8887 & 54.826 \tabularnewline
117 & 0.1282 & 0.016 & 0.108 & 46.1057 & 2736.8176 & 52.3146 \tabularnewline
118 & 0.1228 & -0.0467 & 0.1029 & 445.6834 & 2545.8897 & 50.4568 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=203767&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]107[/C][C]0.0781[/C][C]0.0486[/C][C]0[/C][C]438.6158[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]108[/C][C]0.087[/C][C]-0.1094[/C][C]0.079[/C][C]2307.7318[/C][C]1373.1738[/C][C]37.0564[/C][/ROW]
[ROW][C]109[/C][C]0.1019[/C][C]0.2173[/C][C]0.1251[/C][C]7963.9514[/C][C]3570.0997[/C][C]59.7503[/C][/ROW]
[ROW][C]110[/C][C]0.1108[/C][C]0.1288[/C][C]0.126[/C][C]2649.3516[/C][C]3339.9126[/C][C]57.792[/C][/ROW]
[ROW][C]111[/C][C]0.1161[/C][C]-0.058[/C][C]0.1124[/C][C]532.9186[/C][C]2778.5138[/C][C]52.7116[/C][/ROW]
[ROW][C]112[/C][C]0.1272[/C][C]-0.012[/C][C]0.0957[/C][C]20.4787[/C][C]2318.8413[/C][C]48.1543[/C][/ROW]
[ROW][C]113[/C][C]0.1315[/C][C]-0.1954[/C][C]0.1099[/C][C]5379.5838[/C][C]2756.0902[/C][C]52.4985[/C][/ROW]
[ROW][C]114[/C][C]0.1314[/C][C]-0.181[/C][C]0.1188[/C][C]4879.6831[/C][C]3021.5393[/C][C]54.9685[/C][/ROW]
[ROW][C]115[/C][C]0.1215[/C][C]-0.0695[/C][C]0.1133[/C][C]884.9924[/C][C]2784.1452[/C][C]52.765[/C][/ROW]
[ROW][C]116[/C][C]0.1145[/C][C]-0.1522[/C][C]0.1172[/C][C]5001.5803[/C][C]3005.8887[/C][C]54.826[/C][/ROW]
[ROW][C]117[/C][C]0.1282[/C][C]0.016[/C][C]0.108[/C][C]46.1057[/C][C]2736.8176[/C][C]52.3146[/C][/ROW]
[ROW][C]118[/C][C]0.1228[/C][C]-0.0467[/C][C]0.1029[/C][C]445.6834[/C][C]2545.8897[/C][C]50.4568[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=203767&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=203767&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
1070.07810.04860438.615800
1080.087-0.10940.0792307.73181373.173837.0564
1090.10190.21730.12517963.95143570.099759.7503
1100.11080.12880.1262649.35163339.912657.792
1110.1161-0.0580.1124532.91862778.513852.7116
1120.1272-0.0120.095720.47872318.841348.1543
1130.1315-0.19540.10995379.58382756.090252.4985
1140.1314-0.1810.11884879.68313021.539354.9685
1150.1215-0.06950.1133884.99242784.145252.765
1160.1145-0.15220.11725001.58033005.888754.826
1170.12820.0160.10846.10572736.817652.3146
1180.1228-0.04670.1029445.68342545.889750.4568



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