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 computationThu, 22 Dec 2016 18:29:21 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/22/t1482427778w5id05sa2lpzcre.htm/, Retrieved Sun, 28 Apr 2024 19:21:49 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302591, Retrieved Sun, 28 Apr 2024 19:21:49 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact63
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [arima forecast 2] [2016-12-22 17:29:21] [60937726ec8f1328d8735dbe11c01121] [Current]
Feedback Forum

Post a new message
Dataseries X:
112
118
132
129
121
135
148
148
136
119
104
118
115
126
141
135
125
149
170
170
158
133
114
140
145
150
178
163
172
178
199
199
184
162
146
166
171
180
193
181
183
218
230
242
209
191
172
194
196
196
236
235
229
243
264
272
237
211
180
201
204
188
235
227
234
264
302
293
259
229
203
229
242
233
267
269
270
315
364
347
312
274
237
278
284
277
317
313
318
374
413
405
355
306
271
306
315
301
356
348
355
422
465
467
404
347
305
336
340
318
362
348
363
435
491
505
404
359
310
337
360
342
406
396
420
472
548
559
463
407
362
405
417
391
419
461
472
535
622
606
508
461
390
432




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302591&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302591&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302591&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







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[132])
120337-------
121360-------
122342-------
123406-------
124396-------
125420-------
126472-------
127548-------
128559-------
129463-------
130407-------
131362-------
132405-------
133417419.8572391.2404450.56710.42770.82850.99990.8285
134391398.7532366.1972434.20360.33410.15650.99910.3649
135419466.1575422.0794514.83870.02880.99880.99230.9931
136461454.3844407.8584506.21790.40120.90960.98640.9691
137472473.3571420.5929532.74060.48210.65830.96090.988
138535547.1961481.9821621.23370.37340.97670.97670.9999
139622622.3781543.501712.70250.49670.9710.94671
140606630.4683546.3072727.59480.31070.56780.92541
141508526.7715453.0368612.50690.33390.03510.92760.9973
142461462.3375394.8179541.4040.48680.12880.91490.9224
143390406.6915344.9357479.50390.32660.07190.88550.5182
144432452.3194381.1397536.79220.31870.92590.86390.8639

\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[132]) \tabularnewline
120 & 337 & - & - & - & - & - & - & - \tabularnewline
121 & 360 & - & - & - & - & - & - & - \tabularnewline
122 & 342 & - & - & - & - & - & - & - \tabularnewline
123 & 406 & - & - & - & - & - & - & - \tabularnewline
124 & 396 & - & - & - & - & - & - & - \tabularnewline
125 & 420 & - & - & - & - & - & - & - \tabularnewline
126 & 472 & - & - & - & - & - & - & - \tabularnewline
127 & 548 & - & - & - & - & - & - & - \tabularnewline
128 & 559 & - & - & - & - & - & - & - \tabularnewline
129 & 463 & - & - & - & - & - & - & - \tabularnewline
130 & 407 & - & - & - & - & - & - & - \tabularnewline
131 & 362 & - & - & - & - & - & - & - \tabularnewline
132 & 405 & - & - & - & - & - & - & - \tabularnewline
133 & 417 & 419.8572 & 391.2404 & 450.5671 & 0.4277 & 0.8285 & 0.9999 & 0.8285 \tabularnewline
134 & 391 & 398.7532 & 366.1972 & 434.2036 & 0.3341 & 0.1565 & 0.9991 & 0.3649 \tabularnewline
135 & 419 & 466.1575 & 422.0794 & 514.8387 & 0.0288 & 0.9988 & 0.9923 & 0.9931 \tabularnewline
136 & 461 & 454.3844 & 407.8584 & 506.2179 & 0.4012 & 0.9096 & 0.9864 & 0.9691 \tabularnewline
137 & 472 & 473.3571 & 420.5929 & 532.7406 & 0.4821 & 0.6583 & 0.9609 & 0.988 \tabularnewline
138 & 535 & 547.1961 & 481.9821 & 621.2337 & 0.3734 & 0.9767 & 0.9767 & 0.9999 \tabularnewline
139 & 622 & 622.3781 & 543.501 & 712.7025 & 0.4967 & 0.971 & 0.9467 & 1 \tabularnewline
140 & 606 & 630.4683 & 546.3072 & 727.5948 & 0.3107 & 0.5678 & 0.9254 & 1 \tabularnewline
141 & 508 & 526.7715 & 453.0368 & 612.5069 & 0.3339 & 0.0351 & 0.9276 & 0.9973 \tabularnewline
142 & 461 & 462.3375 & 394.8179 & 541.404 & 0.4868 & 0.1288 & 0.9149 & 0.9224 \tabularnewline
143 & 390 & 406.6915 & 344.9357 & 479.5039 & 0.3266 & 0.0719 & 0.8855 & 0.5182 \tabularnewline
144 & 432 & 452.3194 & 381.1397 & 536.7922 & 0.3187 & 0.9259 & 0.8639 & 0.8639 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302591&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[132])[/C][/ROW]
[ROW][C]120[/C][C]337[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]360[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]342[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]406[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]396[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]420[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]472[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]548[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]559[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]463[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]407[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]131[/C][C]362[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]132[/C][C]405[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]133[/C][C]417[/C][C]419.8572[/C][C]391.2404[/C][C]450.5671[/C][C]0.4277[/C][C]0.8285[/C][C]0.9999[/C][C]0.8285[/C][/ROW]
[ROW][C]134[/C][C]391[/C][C]398.7532[/C][C]366.1972[/C][C]434.2036[/C][C]0.3341[/C][C]0.1565[/C][C]0.9991[/C][C]0.3649[/C][/ROW]
[ROW][C]135[/C][C]419[/C][C]466.1575[/C][C]422.0794[/C][C]514.8387[/C][C]0.0288[/C][C]0.9988[/C][C]0.9923[/C][C]0.9931[/C][/ROW]
[ROW][C]136[/C][C]461[/C][C]454.3844[/C][C]407.8584[/C][C]506.2179[/C][C]0.4012[/C][C]0.9096[/C][C]0.9864[/C][C]0.9691[/C][/ROW]
[ROW][C]137[/C][C]472[/C][C]473.3571[/C][C]420.5929[/C][C]532.7406[/C][C]0.4821[/C][C]0.6583[/C][C]0.9609[/C][C]0.988[/C][/ROW]
[ROW][C]138[/C][C]535[/C][C]547.1961[/C][C]481.9821[/C][C]621.2337[/C][C]0.3734[/C][C]0.9767[/C][C]0.9767[/C][C]0.9999[/C][/ROW]
[ROW][C]139[/C][C]622[/C][C]622.3781[/C][C]543.501[/C][C]712.7025[/C][C]0.4967[/C][C]0.971[/C][C]0.9467[/C][C]1[/C][/ROW]
[ROW][C]140[/C][C]606[/C][C]630.4683[/C][C]546.3072[/C][C]727.5948[/C][C]0.3107[/C][C]0.5678[/C][C]0.9254[/C][C]1[/C][/ROW]
[ROW][C]141[/C][C]508[/C][C]526.7715[/C][C]453.0368[/C][C]612.5069[/C][C]0.3339[/C][C]0.0351[/C][C]0.9276[/C][C]0.9973[/C][/ROW]
[ROW][C]142[/C][C]461[/C][C]462.3375[/C][C]394.8179[/C][C]541.404[/C][C]0.4868[/C][C]0.1288[/C][C]0.9149[/C][C]0.9224[/C][/ROW]
[ROW][C]143[/C][C]390[/C][C]406.6915[/C][C]344.9357[/C][C]479.5039[/C][C]0.3266[/C][C]0.0719[/C][C]0.8855[/C][C]0.5182[/C][/ROW]
[ROW][C]144[/C][C]432[/C][C]452.3194[/C][C]381.1397[/C][C]536.7922[/C][C]0.3187[/C][C]0.9259[/C][C]0.8639[/C][C]0.8639[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302591&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302591&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[132])
120337-------
121360-------
122342-------
123406-------
124396-------
125420-------
126472-------
127548-------
128559-------
129463-------
130407-------
131362-------
132405-------
133417419.8572391.2404450.56710.42770.82850.99990.8285
134391398.7532366.1972434.20360.33410.15650.99910.3649
135419466.1575422.0794514.83870.02880.99880.99230.9931
136461454.3844407.8584506.21790.40120.90960.98640.9691
137472473.3571420.5929532.74060.48210.65830.96090.988
138535547.1961481.9821621.23370.37340.97670.97670.9999
139622622.3781543.501712.70250.49670.9710.94671
140606630.4683546.3072727.59480.31070.56780.92541
141508526.7715453.0368612.50690.33390.03510.92760.9973
142461462.3375394.8179541.4040.48680.12880.91490.9224
143390406.6915344.9357479.50390.32660.07190.88550.5182
144432452.3194381.1397536.79220.31870.92590.86390.8639







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1330.0373-0.00690.00690.00688.163300-0.05920.0592
1340.0454-0.01980.01330.013260.112634.1385.8428-0.16060.1099
1350.0533-0.11250.04640.04432223.8286764.034827.6412-0.97690.3989
1360.05820.01440.03840.036943.7659583.967624.16540.1370.3334
1370.064-0.00290.03130.03011.8417467.542421.6227-0.02810.2724
1380.069-0.02280.02990.0288148.7442414.409420.357-0.25260.2691
1390.074-6e-040.02570.02480.143355.228518.8475-0.00780.2318
1400.0786-0.04040.02750.0266598.6969385.66219.6383-0.50690.2662
1410.083-0.0370.02860.0277352.368381.962719.5439-0.38890.2798
1420.0873-0.00290.0260.02521.789343.945318.5458-0.02770.2546
1430.0913-0.04280.02750.0267278.6078338.005518.3849-0.34580.2629
1440.0953-0.0470.02920.0283412.8764344.244818.5538-0.42090.276

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
133 & 0.0373 & -0.0069 & 0.0069 & 0.0068 & 8.1633 & 0 & 0 & -0.0592 & 0.0592 \tabularnewline
134 & 0.0454 & -0.0198 & 0.0133 & 0.0132 & 60.1126 & 34.138 & 5.8428 & -0.1606 & 0.1099 \tabularnewline
135 & 0.0533 & -0.1125 & 0.0464 & 0.0443 & 2223.8286 & 764.0348 & 27.6412 & -0.9769 & 0.3989 \tabularnewline
136 & 0.0582 & 0.0144 & 0.0384 & 0.0369 & 43.7659 & 583.9676 & 24.1654 & 0.137 & 0.3334 \tabularnewline
137 & 0.064 & -0.0029 & 0.0313 & 0.0301 & 1.8417 & 467.5424 & 21.6227 & -0.0281 & 0.2724 \tabularnewline
138 & 0.069 & -0.0228 & 0.0299 & 0.0288 & 148.7442 & 414.4094 & 20.357 & -0.2526 & 0.2691 \tabularnewline
139 & 0.074 & -6e-04 & 0.0257 & 0.0248 & 0.143 & 355.2285 & 18.8475 & -0.0078 & 0.2318 \tabularnewline
140 & 0.0786 & -0.0404 & 0.0275 & 0.0266 & 598.6969 & 385.662 & 19.6383 & -0.5069 & 0.2662 \tabularnewline
141 & 0.083 & -0.037 & 0.0286 & 0.0277 & 352.368 & 381.9627 & 19.5439 & -0.3889 & 0.2798 \tabularnewline
142 & 0.0873 & -0.0029 & 0.026 & 0.0252 & 1.789 & 343.9453 & 18.5458 & -0.0277 & 0.2546 \tabularnewline
143 & 0.0913 & -0.0428 & 0.0275 & 0.0267 & 278.6078 & 338.0055 & 18.3849 & -0.3458 & 0.2629 \tabularnewline
144 & 0.0953 & -0.047 & 0.0292 & 0.0283 & 412.8764 & 344.2448 & 18.5538 & -0.4209 & 0.276 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302591&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]133[/C][C]0.0373[/C][C]-0.0069[/C][C]0.0069[/C][C]0.0068[/C][C]8.1633[/C][C]0[/C][C]0[/C][C]-0.0592[/C][C]0.0592[/C][/ROW]
[ROW][C]134[/C][C]0.0454[/C][C]-0.0198[/C][C]0.0133[/C][C]0.0132[/C][C]60.1126[/C][C]34.138[/C][C]5.8428[/C][C]-0.1606[/C][C]0.1099[/C][/ROW]
[ROW][C]135[/C][C]0.0533[/C][C]-0.1125[/C][C]0.0464[/C][C]0.0443[/C][C]2223.8286[/C][C]764.0348[/C][C]27.6412[/C][C]-0.9769[/C][C]0.3989[/C][/ROW]
[ROW][C]136[/C][C]0.0582[/C][C]0.0144[/C][C]0.0384[/C][C]0.0369[/C][C]43.7659[/C][C]583.9676[/C][C]24.1654[/C][C]0.137[/C][C]0.3334[/C][/ROW]
[ROW][C]137[/C][C]0.064[/C][C]-0.0029[/C][C]0.0313[/C][C]0.0301[/C][C]1.8417[/C][C]467.5424[/C][C]21.6227[/C][C]-0.0281[/C][C]0.2724[/C][/ROW]
[ROW][C]138[/C][C]0.069[/C][C]-0.0228[/C][C]0.0299[/C][C]0.0288[/C][C]148.7442[/C][C]414.4094[/C][C]20.357[/C][C]-0.2526[/C][C]0.2691[/C][/ROW]
[ROW][C]139[/C][C]0.074[/C][C]-6e-04[/C][C]0.0257[/C][C]0.0248[/C][C]0.143[/C][C]355.2285[/C][C]18.8475[/C][C]-0.0078[/C][C]0.2318[/C][/ROW]
[ROW][C]140[/C][C]0.0786[/C][C]-0.0404[/C][C]0.0275[/C][C]0.0266[/C][C]598.6969[/C][C]385.662[/C][C]19.6383[/C][C]-0.5069[/C][C]0.2662[/C][/ROW]
[ROW][C]141[/C][C]0.083[/C][C]-0.037[/C][C]0.0286[/C][C]0.0277[/C][C]352.368[/C][C]381.9627[/C][C]19.5439[/C][C]-0.3889[/C][C]0.2798[/C][/ROW]
[ROW][C]142[/C][C]0.0873[/C][C]-0.0029[/C][C]0.026[/C][C]0.0252[/C][C]1.789[/C][C]343.9453[/C][C]18.5458[/C][C]-0.0277[/C][C]0.2546[/C][/ROW]
[ROW][C]143[/C][C]0.0913[/C][C]-0.0428[/C][C]0.0275[/C][C]0.0267[/C][C]278.6078[/C][C]338.0055[/C][C]18.3849[/C][C]-0.3458[/C][C]0.2629[/C][/ROW]
[ROW][C]144[/C][C]0.0953[/C][C]-0.047[/C][C]0.0292[/C][C]0.0283[/C][C]412.8764[/C][C]344.2448[/C][C]18.5538[/C][C]-0.4209[/C][C]0.276[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302591&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302591&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1330.0373-0.00690.00690.00688.163300-0.05920.0592
1340.0454-0.01980.01330.013260.112634.1385.8428-0.16060.1099
1350.0533-0.11250.04640.04432223.8286764.034827.6412-0.97690.3989
1360.05820.01440.03840.036943.7659583.967624.16540.1370.3334
1370.064-0.00290.03130.03011.8417467.542421.6227-0.02810.2724
1380.069-0.02280.02990.0288148.7442414.409420.357-0.25260.2691
1390.074-6e-040.02570.02480.143355.228518.8475-0.00780.2318
1400.0786-0.04040.02750.0266598.6969385.66219.6383-0.50690.2662
1410.083-0.0370.02860.0277352.368381.962719.5439-0.38890.2798
1420.0873-0.00290.0260.02521.789343.945318.5458-0.02770.2546
1430.0913-0.04280.02750.0267278.6078338.005518.3849-0.34580.2629
1440.0953-0.0470.02920.0283412.8764344.244818.5538-0.42090.276



Parameters (Session):
par1 = 12 ; par2 = 0.0 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 0.0 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; 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*2
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,fx))
(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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')