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, 28 Dec 2010 00:31:44 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/28/t1293496164qshx89vxi8zkcpn.htm/, Retrieved Sat, 04 May 2024 21:50:59 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=116204, Retrieved Sat, 04 May 2024 21:50:59 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact159
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2010-12-14 14:53:43] [c91278f1cd2d8b4eeb874e50bb706c21]
-   PD  [ARIMA Forecasting] [] [2010-12-19 14:50:11] [2e1e44f0ae3cb9513dc28781dfdb387b]
-   P       [ARIMA Forecasting] [] [2010-12-28 00:31:44] [4dbe485270073769796ed1462cddce37] [Current]
Feedback Forum

Post a new message
Dataseries X:
364
351
380
319
322
386
221
187
343
342
365
313
356
337
389
326
343
357
220
218
391
425
332
298
360
336
325
393
301
426
265
210
429
440
357
431
442
422
544
420
396
482
261
211
448
468
464
425
415
433
531
457
380
481
302
216
509
417
370




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 3 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116204&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116204&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116204&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 time3 seconds
R Server'George Udny Yule' @ 72.249.76.132







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[47])
35357-------
36431-------
37442-------
38422-------
39544-------
40420-------
41396-------
42482-------
43261-------
44211-------
45448-------
46468-------
47464-------
48425383.762346.4419428.47220.03532e-040.01922e-04
49415460.5037408.8064524.39020.08140.8620.71490.4573
50433423.0767375.9716481.17560.36890.60740.51450.0837
51531479.8052414.2953565.10570.11970.85890.07010.6418
52457424.1216368.5288495.64620.18380.00170.5450.1372
53380422.1157364.5332497.0740.13540.18080.75270.1367
54481467.5444395.955564.30760.39260.96190.38480.5286
55302269.0392238.8215306.38580.041800.66350
56216258.8637229.4804295.27020.01050.01010.9950
57509517.7254424.7625651.48670.449110.84650.7844
58417566.9728456.7225731.58770.03710.7550.88070.8899
59370414.9517346.087510.85590.17910.48330.15810.1581

\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[47]) \tabularnewline
35 & 357 & - & - & - & - & - & - & - \tabularnewline
36 & 431 & - & - & - & - & - & - & - \tabularnewline
37 & 442 & - & - & - & - & - & - & - \tabularnewline
38 & 422 & - & - & - & - & - & - & - \tabularnewline
39 & 544 & - & - & - & - & - & - & - \tabularnewline
40 & 420 & - & - & - & - & - & - & - \tabularnewline
41 & 396 & - & - & - & - & - & - & - \tabularnewline
42 & 482 & - & - & - & - & - & - & - \tabularnewline
43 & 261 & - & - & - & - & - & - & - \tabularnewline
44 & 211 & - & - & - & - & - & - & - \tabularnewline
45 & 448 & - & - & - & - & - & - & - \tabularnewline
46 & 468 & - & - & - & - & - & - & - \tabularnewline
47 & 464 & - & - & - & - & - & - & - \tabularnewline
48 & 425 & 383.762 & 346.4419 & 428.4722 & 0.0353 & 2e-04 & 0.0192 & 2e-04 \tabularnewline
49 & 415 & 460.5037 & 408.8064 & 524.3902 & 0.0814 & 0.862 & 0.7149 & 0.4573 \tabularnewline
50 & 433 & 423.0767 & 375.9716 & 481.1756 & 0.3689 & 0.6074 & 0.5145 & 0.0837 \tabularnewline
51 & 531 & 479.8052 & 414.2953 & 565.1057 & 0.1197 & 0.8589 & 0.0701 & 0.6418 \tabularnewline
52 & 457 & 424.1216 & 368.5288 & 495.6462 & 0.1838 & 0.0017 & 0.545 & 0.1372 \tabularnewline
53 & 380 & 422.1157 & 364.5332 & 497.074 & 0.1354 & 0.1808 & 0.7527 & 0.1367 \tabularnewline
54 & 481 & 467.5444 & 395.955 & 564.3076 & 0.3926 & 0.9619 & 0.3848 & 0.5286 \tabularnewline
55 & 302 & 269.0392 & 238.8215 & 306.3858 & 0.0418 & 0 & 0.6635 & 0 \tabularnewline
56 & 216 & 258.8637 & 229.4804 & 295.2702 & 0.0105 & 0.0101 & 0.995 & 0 \tabularnewline
57 & 509 & 517.7254 & 424.7625 & 651.4867 & 0.4491 & 1 & 0.8465 & 0.7844 \tabularnewline
58 & 417 & 566.9728 & 456.7225 & 731.5877 & 0.0371 & 0.755 & 0.8807 & 0.8899 \tabularnewline
59 & 370 & 414.9517 & 346.087 & 510.8559 & 0.1791 & 0.4833 & 0.1581 & 0.1581 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116204&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[47])[/C][/ROW]
[ROW][C]35[/C][C]357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]431[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]442[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]422[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]544[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]420[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]396[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]482[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]261[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]211[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]448[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]468[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]464[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]425[/C][C]383.762[/C][C]346.4419[/C][C]428.4722[/C][C]0.0353[/C][C]2e-04[/C][C]0.0192[/C][C]2e-04[/C][/ROW]
[ROW][C]49[/C][C]415[/C][C]460.5037[/C][C]408.8064[/C][C]524.3902[/C][C]0.0814[/C][C]0.862[/C][C]0.7149[/C][C]0.4573[/C][/ROW]
[ROW][C]50[/C][C]433[/C][C]423.0767[/C][C]375.9716[/C][C]481.1756[/C][C]0.3689[/C][C]0.6074[/C][C]0.5145[/C][C]0.0837[/C][/ROW]
[ROW][C]51[/C][C]531[/C][C]479.8052[/C][C]414.2953[/C][C]565.1057[/C][C]0.1197[/C][C]0.8589[/C][C]0.0701[/C][C]0.6418[/C][/ROW]
[ROW][C]52[/C][C]457[/C][C]424.1216[/C][C]368.5288[/C][C]495.6462[/C][C]0.1838[/C][C]0.0017[/C][C]0.545[/C][C]0.1372[/C][/ROW]
[ROW][C]53[/C][C]380[/C][C]422.1157[/C][C]364.5332[/C][C]497.074[/C][C]0.1354[/C][C]0.1808[/C][C]0.7527[/C][C]0.1367[/C][/ROW]
[ROW][C]54[/C][C]481[/C][C]467.5444[/C][C]395.955[/C][C]564.3076[/C][C]0.3926[/C][C]0.9619[/C][C]0.3848[/C][C]0.5286[/C][/ROW]
[ROW][C]55[/C][C]302[/C][C]269.0392[/C][C]238.8215[/C][C]306.3858[/C][C]0.0418[/C][C]0[/C][C]0.6635[/C][C]0[/C][/ROW]
[ROW][C]56[/C][C]216[/C][C]258.8637[/C][C]229.4804[/C][C]295.2702[/C][C]0.0105[/C][C]0.0101[/C][C]0.995[/C][C]0[/C][/ROW]
[ROW][C]57[/C][C]509[/C][C]517.7254[/C][C]424.7625[/C][C]651.4867[/C][C]0.4491[/C][C]1[/C][C]0.8465[/C][C]0.7844[/C][/ROW]
[ROW][C]58[/C][C]417[/C][C]566.9728[/C][C]456.7225[/C][C]731.5877[/C][C]0.0371[/C][C]0.755[/C][C]0.8807[/C][C]0.8899[/C][/ROW]
[ROW][C]59[/C][C]370[/C][C]414.9517[/C][C]346.087[/C][C]510.8559[/C][C]0.1791[/C][C]0.4833[/C][C]0.1581[/C][C]0.1581[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116204&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116204&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[47])
35357-------
36431-------
37442-------
38422-------
39544-------
40420-------
41396-------
42482-------
43261-------
44211-------
45448-------
46468-------
47464-------
48425383.762346.4419428.47220.03532e-040.01922e-04
49415460.5037408.8064524.39020.08140.8620.71490.4573
50433423.0767375.9716481.17560.36890.60740.51450.0837
51531479.8052414.2953565.10570.11970.85890.07010.6418
52457424.1216368.5288495.64620.18380.00170.5450.1372
53380422.1157364.5332497.0740.13540.18080.75270.1367
54481467.5444395.955564.30760.39260.96190.38480.5286
55302269.0392238.8215306.38580.041800.66350
56216258.8637229.4804295.27020.01050.01010.9950
57509517.7254424.7625651.48670.449110.84650.7844
58417566.9728456.7225731.58770.03710.7550.88070.8899
59370414.9517346.087510.85590.17910.48330.15810.1581







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
480.05940.107501700.575800
490.0708-0.09880.10312070.58531885.580643.4233
500.07010.02350.076698.47261289.877935.9149
510.09070.10670.08412620.90841622.635540.282
520.0860.07750.08281080.98981514.306438.9141
530.0906-0.09980.08561773.73211557.54439.4657
540.10560.02880.0775181.05241360.902336.8904
550.07080.12250.08311086.41591326.591536.4224
560.0718-0.16560.09231837.29281383.336137.1932
570.1318-0.01690.084776.13191252.615735.3923
580.1481-0.26450.101122491.82713183.453156.4221
590.1179-0.10830.10172020.65413086.553255.5568

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
48 & 0.0594 & 0.1075 & 0 & 1700.5758 & 0 & 0 \tabularnewline
49 & 0.0708 & -0.0988 & 0.1031 & 2070.5853 & 1885.5806 & 43.4233 \tabularnewline
50 & 0.0701 & 0.0235 & 0.0766 & 98.4726 & 1289.8779 & 35.9149 \tabularnewline
51 & 0.0907 & 0.1067 & 0.0841 & 2620.9084 & 1622.6355 & 40.282 \tabularnewline
52 & 0.086 & 0.0775 & 0.0828 & 1080.9898 & 1514.3064 & 38.9141 \tabularnewline
53 & 0.0906 & -0.0998 & 0.0856 & 1773.7321 & 1557.544 & 39.4657 \tabularnewline
54 & 0.1056 & 0.0288 & 0.0775 & 181.0524 & 1360.9023 & 36.8904 \tabularnewline
55 & 0.0708 & 0.1225 & 0.0831 & 1086.4159 & 1326.5915 & 36.4224 \tabularnewline
56 & 0.0718 & -0.1656 & 0.0923 & 1837.2928 & 1383.3361 & 37.1932 \tabularnewline
57 & 0.1318 & -0.0169 & 0.0847 & 76.1319 & 1252.6157 & 35.3923 \tabularnewline
58 & 0.1481 & -0.2645 & 0.1011 & 22491.8271 & 3183.4531 & 56.4221 \tabularnewline
59 & 0.1179 & -0.1083 & 0.1017 & 2020.6541 & 3086.5532 & 55.5568 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116204&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]48[/C][C]0.0594[/C][C]0.1075[/C][C]0[/C][C]1700.5758[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]49[/C][C]0.0708[/C][C]-0.0988[/C][C]0.1031[/C][C]2070.5853[/C][C]1885.5806[/C][C]43.4233[/C][/ROW]
[ROW][C]50[/C][C]0.0701[/C][C]0.0235[/C][C]0.0766[/C][C]98.4726[/C][C]1289.8779[/C][C]35.9149[/C][/ROW]
[ROW][C]51[/C][C]0.0907[/C][C]0.1067[/C][C]0.0841[/C][C]2620.9084[/C][C]1622.6355[/C][C]40.282[/C][/ROW]
[ROW][C]52[/C][C]0.086[/C][C]0.0775[/C][C]0.0828[/C][C]1080.9898[/C][C]1514.3064[/C][C]38.9141[/C][/ROW]
[ROW][C]53[/C][C]0.0906[/C][C]-0.0998[/C][C]0.0856[/C][C]1773.7321[/C][C]1557.544[/C][C]39.4657[/C][/ROW]
[ROW][C]54[/C][C]0.1056[/C][C]0.0288[/C][C]0.0775[/C][C]181.0524[/C][C]1360.9023[/C][C]36.8904[/C][/ROW]
[ROW][C]55[/C][C]0.0708[/C][C]0.1225[/C][C]0.0831[/C][C]1086.4159[/C][C]1326.5915[/C][C]36.4224[/C][/ROW]
[ROW][C]56[/C][C]0.0718[/C][C]-0.1656[/C][C]0.0923[/C][C]1837.2928[/C][C]1383.3361[/C][C]37.1932[/C][/ROW]
[ROW][C]57[/C][C]0.1318[/C][C]-0.0169[/C][C]0.0847[/C][C]76.1319[/C][C]1252.6157[/C][C]35.3923[/C][/ROW]
[ROW][C]58[/C][C]0.1481[/C][C]-0.2645[/C][C]0.1011[/C][C]22491.8271[/C][C]3183.4531[/C][C]56.4221[/C][/ROW]
[ROW][C]59[/C][C]0.1179[/C][C]-0.1083[/C][C]0.1017[/C][C]2020.6541[/C][C]3086.5532[/C][C]55.5568[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116204&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116204&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
480.05940.107501700.575800
490.0708-0.09880.10312070.58531885.580643.4233
500.07010.02350.076698.47261289.877935.9149
510.09070.10670.08412620.90841622.635540.282
520.0860.07750.08281080.98981514.306438.9141
530.0906-0.09980.08561773.73211557.54439.4657
540.10560.02880.0775181.05241360.902336.8904
550.07080.12250.08311086.41591326.591536.4224
560.0718-0.16560.09231837.29281383.336137.1932
570.1318-0.01690.084776.13191252.615735.3923
580.1481-0.26450.101122491.82713183.453156.4221
590.1179-0.10830.10172020.65413086.553255.5568



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