Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 11 Dec 2009 08:41:40 -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/11/t12605461442fj4v1qutwg8hxu.htm/, Retrieved Sun, 28 Apr 2024 20:37:15 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66392, Retrieved Sun, 28 Apr 2024 20:37:15 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact121
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima Forecasting...] [2009-12-11 15:41:40] [f340d7563d07b81b9aae66c73f3e92ac] [Current]
Feedback Forum

Post a new message
Dataseries X:
581
597
587
536
524
537
536
533
528
516
502
506
518
534
528
478
469
490
493
508
517
514
510
527
542
565
555
499
511
526
532
549
561
557
566
588
620
626
620
573
573
574
580
590
593
597
595
612
628
629
621
569
567
573
584
589
591
595
594
611




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66392&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]1 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=66392&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66392&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 time1 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[48])
36588-------
37620-------
38626-------
39620-------
40573-------
41573-------
42574-------
43580-------
44590-------
45593-------
46597-------
47595-------
48612-------
49628632.265609.2962655.23380.35790.95810.85240.9581
50629626.2544590.3151662.19370.44050.46210.50550.7815
51621625.4166582.4688668.36440.42010.4350.59760.7298
52569610.9573564.2471657.66740.03920.33670.94440.4826
53567602.7806552.9068652.65450.07980.90780.87910.3586
54573600.7744547.3906654.15820.15390.89250.83720.3401
55584603.5606546.4544660.66690.2510.85290.79060.386
56589608.0304547.4041668.65660.26920.78140.720.4489
57591607.7936543.9772671.610.3030.71810.67520.4486
58595614.2397547.4819680.99760.28610.75250.69360.5262
59594607.8389538.3165677.36130.34820.64130.64130.4533
60611614.2735542.1035686.44340.46460.7090.52460.5246

\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[48]) \tabularnewline
36 & 588 & - & - & - & - & - & - & - \tabularnewline
37 & 620 & - & - & - & - & - & - & - \tabularnewline
38 & 626 & - & - & - & - & - & - & - \tabularnewline
39 & 620 & - & - & - & - & - & - & - \tabularnewline
40 & 573 & - & - & - & - & - & - & - \tabularnewline
41 & 573 & - & - & - & - & - & - & - \tabularnewline
42 & 574 & - & - & - & - & - & - & - \tabularnewline
43 & 580 & - & - & - & - & - & - & - \tabularnewline
44 & 590 & - & - & - & - & - & - & - \tabularnewline
45 & 593 & - & - & - & - & - & - & - \tabularnewline
46 & 597 & - & - & - & - & - & - & - \tabularnewline
47 & 595 & - & - & - & - & - & - & - \tabularnewline
48 & 612 & - & - & - & - & - & - & - \tabularnewline
49 & 628 & 632.265 & 609.2962 & 655.2338 & 0.3579 & 0.9581 & 0.8524 & 0.9581 \tabularnewline
50 & 629 & 626.2544 & 590.3151 & 662.1937 & 0.4405 & 0.4621 & 0.5055 & 0.7815 \tabularnewline
51 & 621 & 625.4166 & 582.4688 & 668.3644 & 0.4201 & 0.435 & 0.5976 & 0.7298 \tabularnewline
52 & 569 & 610.9573 & 564.2471 & 657.6674 & 0.0392 & 0.3367 & 0.9444 & 0.4826 \tabularnewline
53 & 567 & 602.7806 & 552.9068 & 652.6545 & 0.0798 & 0.9078 & 0.8791 & 0.3586 \tabularnewline
54 & 573 & 600.7744 & 547.3906 & 654.1582 & 0.1539 & 0.8925 & 0.8372 & 0.3401 \tabularnewline
55 & 584 & 603.5606 & 546.4544 & 660.6669 & 0.251 & 0.8529 & 0.7906 & 0.386 \tabularnewline
56 & 589 & 608.0304 & 547.4041 & 668.6566 & 0.2692 & 0.7814 & 0.72 & 0.4489 \tabularnewline
57 & 591 & 607.7936 & 543.9772 & 671.61 & 0.303 & 0.7181 & 0.6752 & 0.4486 \tabularnewline
58 & 595 & 614.2397 & 547.4819 & 680.9976 & 0.2861 & 0.7525 & 0.6936 & 0.5262 \tabularnewline
59 & 594 & 607.8389 & 538.3165 & 677.3613 & 0.3482 & 0.6413 & 0.6413 & 0.4533 \tabularnewline
60 & 611 & 614.2735 & 542.1035 & 686.4434 & 0.4646 & 0.709 & 0.5246 & 0.5246 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66392&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[48])[/C][/ROW]
[ROW][C]36[/C][C]588[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]620[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]626[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]620[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]573[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]573[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]574[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]580[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]590[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]593[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]597[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]595[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]612[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]628[/C][C]632.265[/C][C]609.2962[/C][C]655.2338[/C][C]0.3579[/C][C]0.9581[/C][C]0.8524[/C][C]0.9581[/C][/ROW]
[ROW][C]50[/C][C]629[/C][C]626.2544[/C][C]590.3151[/C][C]662.1937[/C][C]0.4405[/C][C]0.4621[/C][C]0.5055[/C][C]0.7815[/C][/ROW]
[ROW][C]51[/C][C]621[/C][C]625.4166[/C][C]582.4688[/C][C]668.3644[/C][C]0.4201[/C][C]0.435[/C][C]0.5976[/C][C]0.7298[/C][/ROW]
[ROW][C]52[/C][C]569[/C][C]610.9573[/C][C]564.2471[/C][C]657.6674[/C][C]0.0392[/C][C]0.3367[/C][C]0.9444[/C][C]0.4826[/C][/ROW]
[ROW][C]53[/C][C]567[/C][C]602.7806[/C][C]552.9068[/C][C]652.6545[/C][C]0.0798[/C][C]0.9078[/C][C]0.8791[/C][C]0.3586[/C][/ROW]
[ROW][C]54[/C][C]573[/C][C]600.7744[/C][C]547.3906[/C][C]654.1582[/C][C]0.1539[/C][C]0.8925[/C][C]0.8372[/C][C]0.3401[/C][/ROW]
[ROW][C]55[/C][C]584[/C][C]603.5606[/C][C]546.4544[/C][C]660.6669[/C][C]0.251[/C][C]0.8529[/C][C]0.7906[/C][C]0.386[/C][/ROW]
[ROW][C]56[/C][C]589[/C][C]608.0304[/C][C]547.4041[/C][C]668.6566[/C][C]0.2692[/C][C]0.7814[/C][C]0.72[/C][C]0.4489[/C][/ROW]
[ROW][C]57[/C][C]591[/C][C]607.7936[/C][C]543.9772[/C][C]671.61[/C][C]0.303[/C][C]0.7181[/C][C]0.6752[/C][C]0.4486[/C][/ROW]
[ROW][C]58[/C][C]595[/C][C]614.2397[/C][C]547.4819[/C][C]680.9976[/C][C]0.2861[/C][C]0.7525[/C][C]0.6936[/C][C]0.5262[/C][/ROW]
[ROW][C]59[/C][C]594[/C][C]607.8389[/C][C]538.3165[/C][C]677.3613[/C][C]0.3482[/C][C]0.6413[/C][C]0.6413[/C][C]0.4533[/C][/ROW]
[ROW][C]60[/C][C]611[/C][C]614.2735[/C][C]542.1035[/C][C]686.4434[/C][C]0.4646[/C][C]0.709[/C][C]0.5246[/C][C]0.5246[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66392&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66392&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[48])
36588-------
37620-------
38626-------
39620-------
40573-------
41573-------
42574-------
43580-------
44590-------
45593-------
46597-------
47595-------
48612-------
49628632.265609.2962655.23380.35790.95810.85240.9581
50629626.2544590.3151662.19370.44050.46210.50550.7815
51621625.4166582.4688668.36440.42010.4350.59760.7298
52569610.9573564.2471657.66740.03920.33670.94440.4826
53567602.7806552.9068652.65450.07980.90780.87910.3586
54573600.7744547.3906654.15820.15390.89250.83720.3401
55584603.5606546.4544660.66690.2510.85290.79060.386
56589608.0304547.4041668.65660.26920.78140.720.4489
57591607.7936543.9772671.610.3030.71810.67520.4486
58595614.2397547.4819680.99760.28610.75250.69360.5262
59594607.8389538.3165677.36130.34820.64130.64130.4533
60611614.2735542.1035686.44340.46460.7090.52460.5246







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0185-0.0067018.190200
500.02930.00440.00567.538212.86423.5867
510.035-0.00710.006119.506515.07833.8831
520.039-0.06870.02171760.4141451.412221.2465
530.0422-0.05940.02921280.2545617.180724.8431
540.0453-0.04620.0321771.417642.886725.3552
550.0483-0.03240.0321382.6185605.705624.6111
560.0509-0.03130.032362.1546575.261723.9846
570.0536-0.02760.0315282.0249542.679823.2955
580.0555-0.03130.0315370.1667525.428522.9222
590.0584-0.02280.0307191.5152495.072822.2502
600.0599-0.00530.028610.7155454.709721.3239

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0185 & -0.0067 & 0 & 18.1902 & 0 & 0 \tabularnewline
50 & 0.0293 & 0.0044 & 0.0056 & 7.5382 & 12.8642 & 3.5867 \tabularnewline
51 & 0.035 & -0.0071 & 0.0061 & 19.5065 & 15.0783 & 3.8831 \tabularnewline
52 & 0.039 & -0.0687 & 0.0217 & 1760.4141 & 451.4122 & 21.2465 \tabularnewline
53 & 0.0422 & -0.0594 & 0.0292 & 1280.2545 & 617.1807 & 24.8431 \tabularnewline
54 & 0.0453 & -0.0462 & 0.0321 & 771.417 & 642.8867 & 25.3552 \tabularnewline
55 & 0.0483 & -0.0324 & 0.0321 & 382.6185 & 605.7056 & 24.6111 \tabularnewline
56 & 0.0509 & -0.0313 & 0.032 & 362.1546 & 575.2617 & 23.9846 \tabularnewline
57 & 0.0536 & -0.0276 & 0.0315 & 282.0249 & 542.6798 & 23.2955 \tabularnewline
58 & 0.0555 & -0.0313 & 0.0315 & 370.1667 & 525.4285 & 22.9222 \tabularnewline
59 & 0.0584 & -0.0228 & 0.0307 & 191.5152 & 495.0728 & 22.2502 \tabularnewline
60 & 0.0599 & -0.0053 & 0.0286 & 10.7155 & 454.7097 & 21.3239 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66392&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]49[/C][C]0.0185[/C][C]-0.0067[/C][C]0[/C][C]18.1902[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0293[/C][C]0.0044[/C][C]0.0056[/C][C]7.5382[/C][C]12.8642[/C][C]3.5867[/C][/ROW]
[ROW][C]51[/C][C]0.035[/C][C]-0.0071[/C][C]0.0061[/C][C]19.5065[/C][C]15.0783[/C][C]3.8831[/C][/ROW]
[ROW][C]52[/C][C]0.039[/C][C]-0.0687[/C][C]0.0217[/C][C]1760.4141[/C][C]451.4122[/C][C]21.2465[/C][/ROW]
[ROW][C]53[/C][C]0.0422[/C][C]-0.0594[/C][C]0.0292[/C][C]1280.2545[/C][C]617.1807[/C][C]24.8431[/C][/ROW]
[ROW][C]54[/C][C]0.0453[/C][C]-0.0462[/C][C]0.0321[/C][C]771.417[/C][C]642.8867[/C][C]25.3552[/C][/ROW]
[ROW][C]55[/C][C]0.0483[/C][C]-0.0324[/C][C]0.0321[/C][C]382.6185[/C][C]605.7056[/C][C]24.6111[/C][/ROW]
[ROW][C]56[/C][C]0.0509[/C][C]-0.0313[/C][C]0.032[/C][C]362.1546[/C][C]575.2617[/C][C]23.9846[/C][/ROW]
[ROW][C]57[/C][C]0.0536[/C][C]-0.0276[/C][C]0.0315[/C][C]282.0249[/C][C]542.6798[/C][C]23.2955[/C][/ROW]
[ROW][C]58[/C][C]0.0555[/C][C]-0.0313[/C][C]0.0315[/C][C]370.1667[/C][C]525.4285[/C][C]22.9222[/C][/ROW]
[ROW][C]59[/C][C]0.0584[/C][C]-0.0228[/C][C]0.0307[/C][C]191.5152[/C][C]495.0728[/C][C]22.2502[/C][/ROW]
[ROW][C]60[/C][C]0.0599[/C][C]-0.0053[/C][C]0.0286[/C][C]10.7155[/C][C]454.7097[/C][C]21.3239[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66392&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66392&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
490.0185-0.0067018.190200
500.02930.00440.00567.538212.86423.5867
510.035-0.00710.006119.506515.07833.8831
520.039-0.06870.02171760.4141451.412221.2465
530.0422-0.05940.02921280.2545617.180724.8431
540.0453-0.04620.0321771.417642.886725.3552
550.0483-0.03240.0321382.6185605.705624.6111
560.0509-0.03130.032362.1546575.261723.9846
570.0536-0.02760.0315282.0249542.679823.2955
580.0555-0.03130.0315370.1667525.428522.9222
590.0584-0.02280.0307191.5152495.072822.2502
600.0599-0.00530.028610.7155454.709721.3239



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