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, 30 Jan 2019 17:05:04 +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/2019/Jan/30/t1548864351zgzqyvwdwasn0xa.htm/, Retrieved Sun, 28 Apr 2024 14:15:59 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=317057, Retrieved Sun, 28 Apr 2024 14:15:59 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact80
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2019-01-30 16:05:04] [dd192abbf875d3a289581f61373d5e67] [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 time2 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 time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=317057&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]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=317057&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=317057&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 time2 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-------
133417420.4376385.2234459.9540.43230.77810.99860.7781
134391399.1493361.0418442.65540.35680.21060.9950.3961
135419473.1677420.2928535.02660.04310.99540.98330.9846
136461459.762404.1038525.81170.48530.88680.97080.9479
137472479.1007415.9796555.26150.42750.67930.93590.9717
138535561.8519479.5594663.48750.30230.95840.95840.9988
139622645.7644542.0887776.76630.36110.95130.92820.9998
140606653.5451543.1045795.05290.25510.66890.90480.9997
141508539.2133448.8089654.79360.29830.12870.90190.9886
142461467.3323388.8733567.67860.45080.21350.88070.8883
143390406.0529337.9633493.1080.35890.1080.83940.5095
144432456.5858374.9333562.94780.32530.89010.82910.8291

\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 & 420.4376 & 385.2234 & 459.954 & 0.4323 & 0.7781 & 0.9986 & 0.7781 \tabularnewline
134 & 391 & 399.1493 & 361.0418 & 442.6554 & 0.3568 & 0.2106 & 0.995 & 0.3961 \tabularnewline
135 & 419 & 473.1677 & 420.2928 & 535.0266 & 0.0431 & 0.9954 & 0.9833 & 0.9846 \tabularnewline
136 & 461 & 459.762 & 404.1038 & 525.8117 & 0.4853 & 0.8868 & 0.9708 & 0.9479 \tabularnewline
137 & 472 & 479.1007 & 415.9796 & 555.2615 & 0.4275 & 0.6793 & 0.9359 & 0.9717 \tabularnewline
138 & 535 & 561.8519 & 479.5594 & 663.4875 & 0.3023 & 0.9584 & 0.9584 & 0.9988 \tabularnewline
139 & 622 & 645.7644 & 542.0887 & 776.7663 & 0.3611 & 0.9513 & 0.9282 & 0.9998 \tabularnewline
140 & 606 & 653.5451 & 543.1045 & 795.0529 & 0.2551 & 0.6689 & 0.9048 & 0.9997 \tabularnewline
141 & 508 & 539.2133 & 448.8089 & 654.7936 & 0.2983 & 0.1287 & 0.9019 & 0.9886 \tabularnewline
142 & 461 & 467.3323 & 388.8733 & 567.6786 & 0.4508 & 0.2135 & 0.8807 & 0.8883 \tabularnewline
143 & 390 & 406.0529 & 337.9633 & 493.108 & 0.3589 & 0.108 & 0.8394 & 0.5095 \tabularnewline
144 & 432 & 456.5858 & 374.9333 & 562.9478 & 0.3253 & 0.8901 & 0.8291 & 0.8291 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=317057&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]420.4376[/C][C]385.2234[/C][C]459.954[/C][C]0.4323[/C][C]0.7781[/C][C]0.9986[/C][C]0.7781[/C][/ROW]
[ROW][C]134[/C][C]391[/C][C]399.1493[/C][C]361.0418[/C][C]442.6554[/C][C]0.3568[/C][C]0.2106[/C][C]0.995[/C][C]0.3961[/C][/ROW]
[ROW][C]135[/C][C]419[/C][C]473.1677[/C][C]420.2928[/C][C]535.0266[/C][C]0.0431[/C][C]0.9954[/C][C]0.9833[/C][C]0.9846[/C][/ROW]
[ROW][C]136[/C][C]461[/C][C]459.762[/C][C]404.1038[/C][C]525.8117[/C][C]0.4853[/C][C]0.8868[/C][C]0.9708[/C][C]0.9479[/C][/ROW]
[ROW][C]137[/C][C]472[/C][C]479.1007[/C][C]415.9796[/C][C]555.2615[/C][C]0.4275[/C][C]0.6793[/C][C]0.9359[/C][C]0.9717[/C][/ROW]
[ROW][C]138[/C][C]535[/C][C]561.8519[/C][C]479.5594[/C][C]663.4875[/C][C]0.3023[/C][C]0.9584[/C][C]0.9584[/C][C]0.9988[/C][/ROW]
[ROW][C]139[/C][C]622[/C][C]645.7644[/C][C]542.0887[/C][C]776.7663[/C][C]0.3611[/C][C]0.9513[/C][C]0.9282[/C][C]0.9998[/C][/ROW]
[ROW][C]140[/C][C]606[/C][C]653.5451[/C][C]543.1045[/C][C]795.0529[/C][C]0.2551[/C][C]0.6689[/C][C]0.9048[/C][C]0.9997[/C][/ROW]
[ROW][C]141[/C][C]508[/C][C]539.2133[/C][C]448.8089[/C][C]654.7936[/C][C]0.2983[/C][C]0.1287[/C][C]0.9019[/C][C]0.9886[/C][/ROW]
[ROW][C]142[/C][C]461[/C][C]467.3323[/C][C]388.8733[/C][C]567.6786[/C][C]0.4508[/C][C]0.2135[/C][C]0.8807[/C][C]0.8883[/C][/ROW]
[ROW][C]143[/C][C]390[/C][C]406.0529[/C][C]337.9633[/C][C]493.108[/C][C]0.3589[/C][C]0.108[/C][C]0.8394[/C][C]0.5095[/C][/ROW]
[ROW][C]144[/C][C]432[/C][C]456.5858[/C][C]374.9333[/C][C]562.9478[/C][C]0.3253[/C][C]0.8901[/C][C]0.8291[/C][C]0.8291[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=317057&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=317057&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-------
133417420.4376385.2234459.9540.43230.77810.99860.7781
134391399.1493361.0418442.65540.35680.21060.9950.3961
135419473.1677420.2928535.02660.04310.99540.98330.9846
136461459.762404.1038525.81170.48530.88680.97080.9479
137472479.1007415.9796555.26150.42750.67930.93590.9717
138535561.8519479.5594663.48750.30230.95840.95840.9988
139622645.7644542.0887776.76630.36110.95130.92820.9998
140606653.5451543.1045795.05290.25510.66890.90480.9997
141508539.2133448.8089654.79360.29830.12870.90190.9886
142461467.3323388.8733567.67860.45080.21350.88070.8883
143390406.0529337.9633493.1080.35890.1080.83940.5095
144432456.5858374.9333562.94780.32530.89010.82910.8291







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1330.048-0.00820.00820.008211.817400-0.07120.0712
1340.0556-0.02080.01450.014466.410939.11416.2541-0.16880.12
1350.0667-0.12930.05280.05012934.13841004.122231.6879-1.12210.454
1360.07330.00270.04030.03821.5327753.474827.44950.02560.3469
1370.0811-0.0150.03520.033650.4206612.86424.7561-0.14710.307
1380.0923-0.05020.03770.0361721.0228630.890525.1175-0.55630.3485
1390.1035-0.03820.03780.0363564.7491621.441724.9287-0.49230.3691
1400.1105-0.07850.04290.04122260.5365826.328528.7459-0.98490.446
1410.1094-0.06140.04490.0433974.2672842.766229.0304-0.64660.4683
1420.1096-0.01370.04180.040340.0983762.499427.6134-0.13120.4346
1430.1094-0.04120.04180.0403257.6945716.60826.7695-0.33250.4253
1440.1189-0.05690.0430.0416604.4633707.262626.5944-0.50930.4323

\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.048 & -0.0082 & 0.0082 & 0.0082 & 11.8174 & 0 & 0 & -0.0712 & 0.0712 \tabularnewline
134 & 0.0556 & -0.0208 & 0.0145 & 0.0144 & 66.4109 & 39.1141 & 6.2541 & -0.1688 & 0.12 \tabularnewline
135 & 0.0667 & -0.1293 & 0.0528 & 0.0501 & 2934.1384 & 1004.1222 & 31.6879 & -1.1221 & 0.454 \tabularnewline
136 & 0.0733 & 0.0027 & 0.0403 & 0.0382 & 1.5327 & 753.4748 & 27.4495 & 0.0256 & 0.3469 \tabularnewline
137 & 0.0811 & -0.015 & 0.0352 & 0.0336 & 50.4206 & 612.864 & 24.7561 & -0.1471 & 0.307 \tabularnewline
138 & 0.0923 & -0.0502 & 0.0377 & 0.0361 & 721.0228 & 630.8905 & 25.1175 & -0.5563 & 0.3485 \tabularnewline
139 & 0.1035 & -0.0382 & 0.0378 & 0.0363 & 564.7491 & 621.4417 & 24.9287 & -0.4923 & 0.3691 \tabularnewline
140 & 0.1105 & -0.0785 & 0.0429 & 0.0412 & 2260.5365 & 826.3285 & 28.7459 & -0.9849 & 0.446 \tabularnewline
141 & 0.1094 & -0.0614 & 0.0449 & 0.0433 & 974.2672 & 842.7662 & 29.0304 & -0.6466 & 0.4683 \tabularnewline
142 & 0.1096 & -0.0137 & 0.0418 & 0.0403 & 40.0983 & 762.4994 & 27.6134 & -0.1312 & 0.4346 \tabularnewline
143 & 0.1094 & -0.0412 & 0.0418 & 0.0403 & 257.6945 & 716.608 & 26.7695 & -0.3325 & 0.4253 \tabularnewline
144 & 0.1189 & -0.0569 & 0.043 & 0.0416 & 604.4633 & 707.2626 & 26.5944 & -0.5093 & 0.4323 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=317057&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.048[/C][C]-0.0082[/C][C]0.0082[/C][C]0.0082[/C][C]11.8174[/C][C]0[/C][C]0[/C][C]-0.0712[/C][C]0.0712[/C][/ROW]
[ROW][C]134[/C][C]0.0556[/C][C]-0.0208[/C][C]0.0145[/C][C]0.0144[/C][C]66.4109[/C][C]39.1141[/C][C]6.2541[/C][C]-0.1688[/C][C]0.12[/C][/ROW]
[ROW][C]135[/C][C]0.0667[/C][C]-0.1293[/C][C]0.0528[/C][C]0.0501[/C][C]2934.1384[/C][C]1004.1222[/C][C]31.6879[/C][C]-1.1221[/C][C]0.454[/C][/ROW]
[ROW][C]136[/C][C]0.0733[/C][C]0.0027[/C][C]0.0403[/C][C]0.0382[/C][C]1.5327[/C][C]753.4748[/C][C]27.4495[/C][C]0.0256[/C][C]0.3469[/C][/ROW]
[ROW][C]137[/C][C]0.0811[/C][C]-0.015[/C][C]0.0352[/C][C]0.0336[/C][C]50.4206[/C][C]612.864[/C][C]24.7561[/C][C]-0.1471[/C][C]0.307[/C][/ROW]
[ROW][C]138[/C][C]0.0923[/C][C]-0.0502[/C][C]0.0377[/C][C]0.0361[/C][C]721.0228[/C][C]630.8905[/C][C]25.1175[/C][C]-0.5563[/C][C]0.3485[/C][/ROW]
[ROW][C]139[/C][C]0.1035[/C][C]-0.0382[/C][C]0.0378[/C][C]0.0363[/C][C]564.7491[/C][C]621.4417[/C][C]24.9287[/C][C]-0.4923[/C][C]0.3691[/C][/ROW]
[ROW][C]140[/C][C]0.1105[/C][C]-0.0785[/C][C]0.0429[/C][C]0.0412[/C][C]2260.5365[/C][C]826.3285[/C][C]28.7459[/C][C]-0.9849[/C][C]0.446[/C][/ROW]
[ROW][C]141[/C][C]0.1094[/C][C]-0.0614[/C][C]0.0449[/C][C]0.0433[/C][C]974.2672[/C][C]842.7662[/C][C]29.0304[/C][C]-0.6466[/C][C]0.4683[/C][/ROW]
[ROW][C]142[/C][C]0.1096[/C][C]-0.0137[/C][C]0.0418[/C][C]0.0403[/C][C]40.0983[/C][C]762.4994[/C][C]27.6134[/C][C]-0.1312[/C][C]0.4346[/C][/ROW]
[ROW][C]143[/C][C]0.1094[/C][C]-0.0412[/C][C]0.0418[/C][C]0.0403[/C][C]257.6945[/C][C]716.608[/C][C]26.7695[/C][C]-0.3325[/C][C]0.4253[/C][/ROW]
[ROW][C]144[/C][C]0.1189[/C][C]-0.0569[/C][C]0.043[/C][C]0.0416[/C][C]604.4633[/C][C]707.2626[/C][C]26.5944[/C][C]-0.5093[/C][C]0.4323[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=317057&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=317057&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.048-0.00820.00820.008211.817400-0.07120.0712
1340.0556-0.02080.01450.014466.410939.11416.2541-0.16880.12
1350.0667-0.12930.05280.05012934.13841004.122231.6879-1.12210.454
1360.07330.00270.04030.03821.5327753.474827.44950.02560.3469
1370.0811-0.0150.03520.033650.4206612.86424.7561-0.14710.307
1380.0923-0.05020.03770.0361721.0228630.890525.1175-0.55630.3485
1390.1035-0.03820.03780.0363564.7491621.441724.9287-0.49230.3691
1400.1105-0.07850.04290.04122260.5365826.328528.7459-0.98490.446
1410.1094-0.06140.04490.0433974.2672842.766229.0304-0.64660.4683
1420.1096-0.01370.04180.040340.0983762.499427.6134-0.13120.4346
1430.1094-0.04120.04180.0403257.6945716.60826.7695-0.33250.4253
1440.1189-0.05690.0430.0416604.4633707.262626.5944-0.50930.4323



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