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 computationTue, 08 Dec 2009 15:29:39 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2009/Dec/08/t1260311441a8n9b3ztxii3na4.htm/, Retrieved Sun, 28 Apr 2024 03:20:53 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=64875, Retrieved Sun, 28 Apr 2024 03:20:53 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact147
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [estimation of ARM...] [2007-12-06 10:08:23] [dc28704e2f48edede7e5c93fa6811a5e]
-  MPD    [ARIMA Forecasting] [ARIMA forecasting] [2009-12-08 22:29:39] [ea241b681aafed79da4b5b99fad98471] [Current]
Feedback Forum

Post a new message
Dataseries X:
216234
213587
209465
204045
200237
203666
241476
260307
243324
244460
233575
237217
235243
230354
227184
221678
217142
219452
256446
265845
248624
241114
229245
231805
219277
219313
212610
214771
211142
211457
240048
240636
230580
208795
197922
194596
194581
185686
178106
172608
167302
168053
202300
202388
182516
173476
166444
171297
169701
164182
161914
159612
151001
158114
186530
187069
174330
169362
166827
178037
186412
189226
191563
188906
186005
195309
223532
226899
214126




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time9 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 9 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=64875&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]9 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=64875&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64875&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 time9 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







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[57])
45182516-------
46173476-------
47166444-------
48171297-------
49169701-------
50164182-------
51161914-------
52159612-------
53151001-------
54158114-------
55186530-------
56187069-------
57174330-------
58169362161911.6759151768.8156172054.53620.0750.00820.01270.0082
59166827154160.358140580.3447167740.37130.03380.01410.03810.0018
60178037155959.5371137709.9248174209.14930.00890.12160.04980.0242
61186412153647.4941132070.6024175224.38570.00150.01340.07240.0301
62189226147966.2384123019.6132172912.86366e-040.00130.10130.0192
63191563143794.7633116022.5982171566.92854e-047e-040.10050.0156
64188906140812.0779110337.6607171286.49520.0015e-040.11330.0156
65186005134244.3285101338.549167150.1080.0016e-040.15910.0085
66195309138336.7725103126.0003173547.54488e-040.0040.13550.0226
67223532169308.4773131952.0929206664.86160.00220.08630.18310.3961
68226899171209.4508131811.3649210607.53670.00280.00460.21510.4383
69214126156510.2753115177.2014197843.34920.00314e-040.19910.1991

\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[57]) \tabularnewline
45 & 182516 & - & - & - & - & - & - & - \tabularnewline
46 & 173476 & - & - & - & - & - & - & - \tabularnewline
47 & 166444 & - & - & - & - & - & - & - \tabularnewline
48 & 171297 & - & - & - & - & - & - & - \tabularnewline
49 & 169701 & - & - & - & - & - & - & - \tabularnewline
50 & 164182 & - & - & - & - & - & - & - \tabularnewline
51 & 161914 & - & - & - & - & - & - & - \tabularnewline
52 & 159612 & - & - & - & - & - & - & - \tabularnewline
53 & 151001 & - & - & - & - & - & - & - \tabularnewline
54 & 158114 & - & - & - & - & - & - & - \tabularnewline
55 & 186530 & - & - & - & - & - & - & - \tabularnewline
56 & 187069 & - & - & - & - & - & - & - \tabularnewline
57 & 174330 & - & - & - & - & - & - & - \tabularnewline
58 & 169362 & 161911.6759 & 151768.8156 & 172054.5362 & 0.075 & 0.0082 & 0.0127 & 0.0082 \tabularnewline
59 & 166827 & 154160.358 & 140580.3447 & 167740.3713 & 0.0338 & 0.0141 & 0.0381 & 0.0018 \tabularnewline
60 & 178037 & 155959.5371 & 137709.9248 & 174209.1493 & 0.0089 & 0.1216 & 0.0498 & 0.0242 \tabularnewline
61 & 186412 & 153647.4941 & 132070.6024 & 175224.3857 & 0.0015 & 0.0134 & 0.0724 & 0.0301 \tabularnewline
62 & 189226 & 147966.2384 & 123019.6132 & 172912.8636 & 6e-04 & 0.0013 & 0.1013 & 0.0192 \tabularnewline
63 & 191563 & 143794.7633 & 116022.5982 & 171566.9285 & 4e-04 & 7e-04 & 0.1005 & 0.0156 \tabularnewline
64 & 188906 & 140812.0779 & 110337.6607 & 171286.4952 & 0.001 & 5e-04 & 0.1133 & 0.0156 \tabularnewline
65 & 186005 & 134244.3285 & 101338.549 & 167150.108 & 0.001 & 6e-04 & 0.1591 & 0.0085 \tabularnewline
66 & 195309 & 138336.7725 & 103126.0003 & 173547.5448 & 8e-04 & 0.004 & 0.1355 & 0.0226 \tabularnewline
67 & 223532 & 169308.4773 & 131952.0929 & 206664.8616 & 0.0022 & 0.0863 & 0.1831 & 0.3961 \tabularnewline
68 & 226899 & 171209.4508 & 131811.3649 & 210607.5367 & 0.0028 & 0.0046 & 0.2151 & 0.4383 \tabularnewline
69 & 214126 & 156510.2753 & 115177.2014 & 197843.3492 & 0.0031 & 4e-04 & 0.1991 & 0.1991 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=64875&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[57])[/C][/ROW]
[ROW][C]45[/C][C]182516[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]173476[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]166444[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]171297[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]169701[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]164182[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]161914[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]159612[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]151001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]158114[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]186530[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]187069[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]174330[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]169362[/C][C]161911.6759[/C][C]151768.8156[/C][C]172054.5362[/C][C]0.075[/C][C]0.0082[/C][C]0.0127[/C][C]0.0082[/C][/ROW]
[ROW][C]59[/C][C]166827[/C][C]154160.358[/C][C]140580.3447[/C][C]167740.3713[/C][C]0.0338[/C][C]0.0141[/C][C]0.0381[/C][C]0.0018[/C][/ROW]
[ROW][C]60[/C][C]178037[/C][C]155959.5371[/C][C]137709.9248[/C][C]174209.1493[/C][C]0.0089[/C][C]0.1216[/C][C]0.0498[/C][C]0.0242[/C][/ROW]
[ROW][C]61[/C][C]186412[/C][C]153647.4941[/C][C]132070.6024[/C][C]175224.3857[/C][C]0.0015[/C][C]0.0134[/C][C]0.0724[/C][C]0.0301[/C][/ROW]
[ROW][C]62[/C][C]189226[/C][C]147966.2384[/C][C]123019.6132[/C][C]172912.8636[/C][C]6e-04[/C][C]0.0013[/C][C]0.1013[/C][C]0.0192[/C][/ROW]
[ROW][C]63[/C][C]191563[/C][C]143794.7633[/C][C]116022.5982[/C][C]171566.9285[/C][C]4e-04[/C][C]7e-04[/C][C]0.1005[/C][C]0.0156[/C][/ROW]
[ROW][C]64[/C][C]188906[/C][C]140812.0779[/C][C]110337.6607[/C][C]171286.4952[/C][C]0.001[/C][C]5e-04[/C][C]0.1133[/C][C]0.0156[/C][/ROW]
[ROW][C]65[/C][C]186005[/C][C]134244.3285[/C][C]101338.549[/C][C]167150.108[/C][C]0.001[/C][C]6e-04[/C][C]0.1591[/C][C]0.0085[/C][/ROW]
[ROW][C]66[/C][C]195309[/C][C]138336.7725[/C][C]103126.0003[/C][C]173547.5448[/C][C]8e-04[/C][C]0.004[/C][C]0.1355[/C][C]0.0226[/C][/ROW]
[ROW][C]67[/C][C]223532[/C][C]169308.4773[/C][C]131952.0929[/C][C]206664.8616[/C][C]0.0022[/C][C]0.0863[/C][C]0.1831[/C][C]0.3961[/C][/ROW]
[ROW][C]68[/C][C]226899[/C][C]171209.4508[/C][C]131811.3649[/C][C]210607.5367[/C][C]0.0028[/C][C]0.0046[/C][C]0.2151[/C][C]0.4383[/C][/ROW]
[ROW][C]69[/C][C]214126[/C][C]156510.2753[/C][C]115177.2014[/C][C]197843.3492[/C][C]0.0031[/C][C]4e-04[/C][C]0.1991[/C][C]0.1991[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=64875&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64875&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[57])
45182516-------
46173476-------
47166444-------
48171297-------
49169701-------
50164182-------
51161914-------
52159612-------
53151001-------
54158114-------
55186530-------
56187069-------
57174330-------
58169362161911.6759151768.8156172054.53620.0750.00820.01270.0082
59166827154160.358140580.3447167740.37130.03380.01410.03810.0018
60178037155959.5371137709.9248174209.14930.00890.12160.04980.0242
61186412153647.4941132070.6024175224.38570.00150.01340.07240.0301
62189226147966.2384123019.6132172912.86366e-040.00130.10130.0192
63191563143794.7633116022.5982171566.92854e-047e-040.10050.0156
64188906140812.0779110337.6607171286.49520.0015e-040.11330.0156
65186005134244.3285101338.549167150.1080.0016e-040.15910.0085
66195309138336.7725103126.0003173547.54488e-040.0040.13550.0226
67223532169308.4773131952.0929206664.86160.00220.08630.18310.3961
68226899171209.4508131811.3649210607.53670.00280.00460.21510.4383
69214126156510.2753115177.2014197843.34920.00314e-040.19910.1991







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
580.0320.0460.003855507329.92084625610.82672150.7233
590.04490.08220.0068160443820.240713370318.35343656.5446
600.05970.14160.0118487414370.017640617864.16816373.2146
610.07160.21320.01781073512849.467589459404.12239458.2982
620.0860.27880.02321702367930.7292141863994.227411910.6672
630.09850.33220.02772281804433.2195190150369.43513789.5021
640.11040.34150.02852313025339.851192752111.654213883.5194
650.12510.38560.03212679167114.6497223263926.220814942.0188
660.12990.41180.03433245834701.7672270486225.147316446.4654
670.11260.32030.02672940190418.4688245015868.205715652.9827
680.11740.32530.02713101325888.5226258443824.043516076.1881
690.13470.36810.03073319571733.8306276630977.819216632.2271

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
58 & 0.032 & 0.046 & 0.0038 & 55507329.9208 & 4625610.8267 & 2150.7233 \tabularnewline
59 & 0.0449 & 0.0822 & 0.0068 & 160443820.2407 & 13370318.3534 & 3656.5446 \tabularnewline
60 & 0.0597 & 0.1416 & 0.0118 & 487414370.0176 & 40617864.1681 & 6373.2146 \tabularnewline
61 & 0.0716 & 0.2132 & 0.0178 & 1073512849.4675 & 89459404.1223 & 9458.2982 \tabularnewline
62 & 0.086 & 0.2788 & 0.0232 & 1702367930.7292 & 141863994.2274 & 11910.6672 \tabularnewline
63 & 0.0985 & 0.3322 & 0.0277 & 2281804433.2195 & 190150369.435 & 13789.5021 \tabularnewline
64 & 0.1104 & 0.3415 & 0.0285 & 2313025339.851 & 192752111.6542 & 13883.5194 \tabularnewline
65 & 0.1251 & 0.3856 & 0.0321 & 2679167114.6497 & 223263926.2208 & 14942.0188 \tabularnewline
66 & 0.1299 & 0.4118 & 0.0343 & 3245834701.7672 & 270486225.1473 & 16446.4654 \tabularnewline
67 & 0.1126 & 0.3203 & 0.0267 & 2940190418.4688 & 245015868.2057 & 15652.9827 \tabularnewline
68 & 0.1174 & 0.3253 & 0.0271 & 3101325888.5226 & 258443824.0435 & 16076.1881 \tabularnewline
69 & 0.1347 & 0.3681 & 0.0307 & 3319571733.8306 & 276630977.8192 & 16632.2271 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=64875&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]58[/C][C]0.032[/C][C]0.046[/C][C]0.0038[/C][C]55507329.9208[/C][C]4625610.8267[/C][C]2150.7233[/C][/ROW]
[ROW][C]59[/C][C]0.0449[/C][C]0.0822[/C][C]0.0068[/C][C]160443820.2407[/C][C]13370318.3534[/C][C]3656.5446[/C][/ROW]
[ROW][C]60[/C][C]0.0597[/C][C]0.1416[/C][C]0.0118[/C][C]487414370.0176[/C][C]40617864.1681[/C][C]6373.2146[/C][/ROW]
[ROW][C]61[/C][C]0.0716[/C][C]0.2132[/C][C]0.0178[/C][C]1073512849.4675[/C][C]89459404.1223[/C][C]9458.2982[/C][/ROW]
[ROW][C]62[/C][C]0.086[/C][C]0.2788[/C][C]0.0232[/C][C]1702367930.7292[/C][C]141863994.2274[/C][C]11910.6672[/C][/ROW]
[ROW][C]63[/C][C]0.0985[/C][C]0.3322[/C][C]0.0277[/C][C]2281804433.2195[/C][C]190150369.435[/C][C]13789.5021[/C][/ROW]
[ROW][C]64[/C][C]0.1104[/C][C]0.3415[/C][C]0.0285[/C][C]2313025339.851[/C][C]192752111.6542[/C][C]13883.5194[/C][/ROW]
[ROW][C]65[/C][C]0.1251[/C][C]0.3856[/C][C]0.0321[/C][C]2679167114.6497[/C][C]223263926.2208[/C][C]14942.0188[/C][/ROW]
[ROW][C]66[/C][C]0.1299[/C][C]0.4118[/C][C]0.0343[/C][C]3245834701.7672[/C][C]270486225.1473[/C][C]16446.4654[/C][/ROW]
[ROW][C]67[/C][C]0.1126[/C][C]0.3203[/C][C]0.0267[/C][C]2940190418.4688[/C][C]245015868.2057[/C][C]15652.9827[/C][/ROW]
[ROW][C]68[/C][C]0.1174[/C][C]0.3253[/C][C]0.0271[/C][C]3101325888.5226[/C][C]258443824.0435[/C][C]16076.1881[/C][/ROW]
[ROW][C]69[/C][C]0.1347[/C][C]0.3681[/C][C]0.0307[/C][C]3319571733.8306[/C][C]276630977.8192[/C][C]16632.2271[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=64875&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64875&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
580.0320.0460.003855507329.92084625610.82672150.7233
590.04490.08220.0068160443820.240713370318.35343656.5446
600.05970.14160.0118487414370.017640617864.16816373.2146
610.07160.21320.01781073512849.467589459404.12239458.2982
620.0860.27880.02321702367930.7292141863994.227411910.6672
630.09850.33220.02772281804433.2195190150369.43513789.5021
640.11040.34150.02852313025339.851192752111.654213883.5194
650.12510.38560.03212679167114.6497223263926.220814942.0188
660.12990.41180.03433245834701.7672270486225.147316446.4654
670.11260.32030.02672940190418.4688245015868.205715652.9827
680.11740.32530.02713101325888.5226258443824.043516076.1881
690.13470.36810.03073319571733.8306276630977.819216632.2271



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; 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
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)
}
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')