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, 22 Nov 2013 07:32:35 -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/2013/Nov/22/t1385123622tgxyg9x2gteezdy.htm/, Retrieved Mon, 29 Apr 2024 17:18:45 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=227528, Retrieved Mon, 29 Apr 2024 17:18:45 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsARIMA forecasting
Estimated Impact92
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Workshop 9] [2013-11-22 12:32:35] [5e42c9004249d2da32be1cc4d951d589] [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 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=227528&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=227528&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=227528&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[132])
120337-------
121360-------
122342-------
123406-------
124396-------
125420-------
126472-------
127548-------
128559-------
129463-------
130407-------
131362-------
132405-------
133417360294.4865421.03160.03360.07420.50.0742
134391342274.9139404.15910.06120.0090.50.0235
135419406343.9676464.43860.33140.69260.50.5134
136461396333.2678454.97040.01540.22230.50.3824
137472420358.9015477.72070.03870.08190.50.6947
138535472413.974527.29580.01280.50.50.9912
139622548493.6148600.30340.00280.68690.51
140606559505.0773610.91450.0380.00870.51
141508463404.4818518.69070.056600.50.9794
142461407345.0361465.38630.03493e-040.50.5268
143390362296.6531422.91060.18387e-040.50.0832
144432405342.8989463.4910.18280.69240.50.5

\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 & 360 & 294.4865 & 421.0316 & 0.0336 & 0.0742 & 0.5 & 0.0742 \tabularnewline
134 & 391 & 342 & 274.9139 & 404.1591 & 0.0612 & 0.009 & 0.5 & 0.0235 \tabularnewline
135 & 419 & 406 & 343.9676 & 464.4386 & 0.3314 & 0.6926 & 0.5 & 0.5134 \tabularnewline
136 & 461 & 396 & 333.2678 & 454.9704 & 0.0154 & 0.2223 & 0.5 & 0.3824 \tabularnewline
137 & 472 & 420 & 358.9015 & 477.7207 & 0.0387 & 0.0819 & 0.5 & 0.6947 \tabularnewline
138 & 535 & 472 & 413.974 & 527.2958 & 0.0128 & 0.5 & 0.5 & 0.9912 \tabularnewline
139 & 622 & 548 & 493.6148 & 600.3034 & 0.0028 & 0.6869 & 0.5 & 1 \tabularnewline
140 & 606 & 559 & 505.0773 & 610.9145 & 0.038 & 0.0087 & 0.5 & 1 \tabularnewline
141 & 508 & 463 & 404.4818 & 518.6907 & 0.0566 & 0 & 0.5 & 0.9794 \tabularnewline
142 & 461 & 407 & 345.0361 & 465.3863 & 0.0349 & 3e-04 & 0.5 & 0.5268 \tabularnewline
143 & 390 & 362 & 296.6531 & 422.9106 & 0.1838 & 7e-04 & 0.5 & 0.0832 \tabularnewline
144 & 432 & 405 & 342.8989 & 463.491 & 0.1828 & 0.6924 & 0.5 & 0.5 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=227528&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]360[/C][C]294.4865[/C][C]421.0316[/C][C]0.0336[/C][C]0.0742[/C][C]0.5[/C][C]0.0742[/C][/ROW]
[ROW][C]134[/C][C]391[/C][C]342[/C][C]274.9139[/C][C]404.1591[/C][C]0.0612[/C][C]0.009[/C][C]0.5[/C][C]0.0235[/C][/ROW]
[ROW][C]135[/C][C]419[/C][C]406[/C][C]343.9676[/C][C]464.4386[/C][C]0.3314[/C][C]0.6926[/C][C]0.5[/C][C]0.5134[/C][/ROW]
[ROW][C]136[/C][C]461[/C][C]396[/C][C]333.2678[/C][C]454.9704[/C][C]0.0154[/C][C]0.2223[/C][C]0.5[/C][C]0.3824[/C][/ROW]
[ROW][C]137[/C][C]472[/C][C]420[/C][C]358.9015[/C][C]477.7207[/C][C]0.0387[/C][C]0.0819[/C][C]0.5[/C][C]0.6947[/C][/ROW]
[ROW][C]138[/C][C]535[/C][C]472[/C][C]413.974[/C][C]527.2958[/C][C]0.0128[/C][C]0.5[/C][C]0.5[/C][C]0.9912[/C][/ROW]
[ROW][C]139[/C][C]622[/C][C]548[/C][C]493.6148[/C][C]600.3034[/C][C]0.0028[/C][C]0.6869[/C][C]0.5[/C][C]1[/C][/ROW]
[ROW][C]140[/C][C]606[/C][C]559[/C][C]505.0773[/C][C]610.9145[/C][C]0.038[/C][C]0.0087[/C][C]0.5[/C][C]1[/C][/ROW]
[ROW][C]141[/C][C]508[/C][C]463[/C][C]404.4818[/C][C]518.6907[/C][C]0.0566[/C][C]0[/C][C]0.5[/C][C]0.9794[/C][/ROW]
[ROW][C]142[/C][C]461[/C][C]407[/C][C]345.0361[/C][C]465.3863[/C][C]0.0349[/C][C]3e-04[/C][C]0.5[/C][C]0.5268[/C][/ROW]
[ROW][C]143[/C][C]390[/C][C]362[/C][C]296.6531[/C][C]422.9106[/C][C]0.1838[/C][C]7e-04[/C][C]0.5[/C][C]0.0832[/C][/ROW]
[ROW][C]144[/C][C]432[/C][C]405[/C][C]342.8989[/C][C]463.491[/C][C]0.1828[/C][C]0.6924[/C][C]0.5[/C][C]0.5[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=227528&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=227528&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-------
133417360294.4865421.03160.03360.07420.50.0742
134391342274.9139404.15910.06120.0090.50.0235
135419406343.9676464.43860.33140.69260.50.5134
136461396333.2678454.97040.01540.22230.50.3824
137472420358.9015477.72070.03870.08190.50.6947
138535472413.974527.29580.01280.50.50.9912
139622548493.6148600.30340.00280.68690.51
140606559505.0773610.91450.0380.00870.51
141508463404.4818518.69070.056600.50.9794
142461407345.0361465.38630.03493e-040.50.5268
143390362296.6531422.91060.18387e-040.50.0832
144432405342.8989463.4910.18280.69240.50.5







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1330.08650.13670.13670.14673249001.18081.1808
1340.09270.12530.1310.14022401282553.15071.01511.0979
1350.07340.0310.09770.1041691939.666744.04160.26930.8217
1360.0760.1410.10850.11594225251150.10991.34650.9529
1370.07010.11020.10880.11627042549.650.49361.07720.9778
1380.05980.11780.11030.117639692786.166752.78421.30511.0323
1390.04870.1190.11160.118854763170.428656.30661.5331.1038
1400.04740.07760.10730.114122093050.2555.22910.97361.0876
1410.06140.08860.10520.111720252936.333354.18790.93221.0703
1420.07320.11710.10640.11329162934.354.16921.11861.0751
1430.08580.07180.10330.10957842738.818252.33370.581.0301
1440.07370.06250.09990.10577292571.333350.70830.55930.9909

\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.0865 & 0.1367 & 0.1367 & 0.1467 & 3249 & 0 & 0 & 1.1808 & 1.1808 \tabularnewline
134 & 0.0927 & 0.1253 & 0.131 & 0.1402 & 2401 & 2825 & 53.1507 & 1.0151 & 1.0979 \tabularnewline
135 & 0.0734 & 0.031 & 0.0977 & 0.104 & 169 & 1939.6667 & 44.0416 & 0.2693 & 0.8217 \tabularnewline
136 & 0.076 & 0.141 & 0.1085 & 0.1159 & 4225 & 2511 & 50.1099 & 1.3465 & 0.9529 \tabularnewline
137 & 0.0701 & 0.1102 & 0.1088 & 0.116 & 2704 & 2549.6 & 50.4936 & 1.0772 & 0.9778 \tabularnewline
138 & 0.0598 & 0.1178 & 0.1103 & 0.1176 & 3969 & 2786.1667 & 52.7842 & 1.3051 & 1.0323 \tabularnewline
139 & 0.0487 & 0.119 & 0.1116 & 0.1188 & 5476 & 3170.4286 & 56.3066 & 1.533 & 1.1038 \tabularnewline
140 & 0.0474 & 0.0776 & 0.1073 & 0.1141 & 2209 & 3050.25 & 55.2291 & 0.9736 & 1.0876 \tabularnewline
141 & 0.0614 & 0.0886 & 0.1052 & 0.1117 & 2025 & 2936.3333 & 54.1879 & 0.9322 & 1.0703 \tabularnewline
142 & 0.0732 & 0.1171 & 0.1064 & 0.113 & 2916 & 2934.3 & 54.1692 & 1.1186 & 1.0751 \tabularnewline
143 & 0.0858 & 0.0718 & 0.1033 & 0.1095 & 784 & 2738.8182 & 52.3337 & 0.58 & 1.0301 \tabularnewline
144 & 0.0737 & 0.0625 & 0.0999 & 0.1057 & 729 & 2571.3333 & 50.7083 & 0.5593 & 0.9909 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=227528&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.0865[/C][C]0.1367[/C][C]0.1367[/C][C]0.1467[/C][C]3249[/C][C]0[/C][C]0[/C][C]1.1808[/C][C]1.1808[/C][/ROW]
[ROW][C]134[/C][C]0.0927[/C][C]0.1253[/C][C]0.131[/C][C]0.1402[/C][C]2401[/C][C]2825[/C][C]53.1507[/C][C]1.0151[/C][C]1.0979[/C][/ROW]
[ROW][C]135[/C][C]0.0734[/C][C]0.031[/C][C]0.0977[/C][C]0.104[/C][C]169[/C][C]1939.6667[/C][C]44.0416[/C][C]0.2693[/C][C]0.8217[/C][/ROW]
[ROW][C]136[/C][C]0.076[/C][C]0.141[/C][C]0.1085[/C][C]0.1159[/C][C]4225[/C][C]2511[/C][C]50.1099[/C][C]1.3465[/C][C]0.9529[/C][/ROW]
[ROW][C]137[/C][C]0.0701[/C][C]0.1102[/C][C]0.1088[/C][C]0.116[/C][C]2704[/C][C]2549.6[/C][C]50.4936[/C][C]1.0772[/C][C]0.9778[/C][/ROW]
[ROW][C]138[/C][C]0.0598[/C][C]0.1178[/C][C]0.1103[/C][C]0.1176[/C][C]3969[/C][C]2786.1667[/C][C]52.7842[/C][C]1.3051[/C][C]1.0323[/C][/ROW]
[ROW][C]139[/C][C]0.0487[/C][C]0.119[/C][C]0.1116[/C][C]0.1188[/C][C]5476[/C][C]3170.4286[/C][C]56.3066[/C][C]1.533[/C][C]1.1038[/C][/ROW]
[ROW][C]140[/C][C]0.0474[/C][C]0.0776[/C][C]0.1073[/C][C]0.1141[/C][C]2209[/C][C]3050.25[/C][C]55.2291[/C][C]0.9736[/C][C]1.0876[/C][/ROW]
[ROW][C]141[/C][C]0.0614[/C][C]0.0886[/C][C]0.1052[/C][C]0.1117[/C][C]2025[/C][C]2936.3333[/C][C]54.1879[/C][C]0.9322[/C][C]1.0703[/C][/ROW]
[ROW][C]142[/C][C]0.0732[/C][C]0.1171[/C][C]0.1064[/C][C]0.113[/C][C]2916[/C][C]2934.3[/C][C]54.1692[/C][C]1.1186[/C][C]1.0751[/C][/ROW]
[ROW][C]143[/C][C]0.0858[/C][C]0.0718[/C][C]0.1033[/C][C]0.1095[/C][C]784[/C][C]2738.8182[/C][C]52.3337[/C][C]0.58[/C][C]1.0301[/C][/ROW]
[ROW][C]144[/C][C]0.0737[/C][C]0.0625[/C][C]0.0999[/C][C]0.1057[/C][C]729[/C][C]2571.3333[/C][C]50.7083[/C][C]0.5593[/C][C]0.9909[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=227528&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=227528&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.08650.13670.13670.14673249001.18081.1808
1340.09270.12530.1310.14022401282553.15071.01511.0979
1350.07340.0310.09770.1041691939.666744.04160.26930.8217
1360.0760.1410.10850.11594225251150.10991.34650.9529
1370.07010.11020.10880.11627042549.650.49361.07720.9778
1380.05980.11780.11030.117639692786.166752.78421.30511.0323
1390.04870.1190.11160.118854763170.428656.30661.5331.1038
1400.04740.07760.10730.114122093050.2555.22910.97361.0876
1410.06140.08860.10520.111720252936.333354.18790.93221.0703
1420.07320.11710.10640.11329162934.354.16921.11861.0751
1430.08580.07180.10330.10957842738.818252.33370.581.0301
1440.07370.06250.09990.10577292571.333350.70830.55930.9909



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