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 computationMon, 13 Dec 2010 19:41:37 +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/13/t1292269377iahgalnwmd2qohp.htm/, Retrieved Tue, 07 May 2024 00:35:09 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=109120, Retrieved Tue, 07 May 2024 00:35:09 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact126
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [W9] [2010-12-04 22:46:17] [48146708a479232c43a8f6e52fbf83b4]
-   P     [ARIMA Forecasting] [] [2010-12-13 19:41:37] [6b67b7c8c7d0a997c30f007387afbdb8] [Current]
Feedback Forum

Post a new message
Dataseries X:
612
595
597
593
590
580
574
573
573
620
626
620
588
566
557
561
549
532
526
511
499
555
565
542
527
510
514
517
508
493
490
469
478
528
534
518
506
502
516
528
533
536
537
524
536
587
597
581
564
558
575
580
575
563
552
537
545
601
604
586
564




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109120&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]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109120&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109120&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'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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[49])
37506-------
38502-------
39516-------
40528-------
41533-------
42536-------
43537-------
44524-------
45536-------
46587-------
47597-------
48581-------
49564-------
50558561.502545.0985577.90540.33780.382710.3827
51575574.6054551.4323597.77850.48670.919910.8151
52580585.0116554.8546615.16870.37230.74240.99990.914
53575590.4148550.985629.84460.22180.69770.99780.9054
54563592.7949545.6199639.970.10790.77010.99090.8842
55552593.2741538.3738648.17440.07030.86010.97770.852
56537580.3148517.5399643.08970.08810.81170.96070.6948
57545591.9906521.9737662.00750.09420.93810.94150.7833
58601642.8044565.7194719.88930.14390.99360.9220.9774
59604652.762568.8221736.70190.12740.88660.90350.9809
60586636.6079546.1727727.04320.13640.76010.88590.9422
61564619.5313522.814716.24860.13020.75160.86980.8698

\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[49]) \tabularnewline
37 & 506 & - & - & - & - & - & - & - \tabularnewline
38 & 502 & - & - & - & - & - & - & - \tabularnewline
39 & 516 & - & - & - & - & - & - & - \tabularnewline
40 & 528 & - & - & - & - & - & - & - \tabularnewline
41 & 533 & - & - & - & - & - & - & - \tabularnewline
42 & 536 & - & - & - & - & - & - & - \tabularnewline
43 & 537 & - & - & - & - & - & - & - \tabularnewline
44 & 524 & - & - & - & - & - & - & - \tabularnewline
45 & 536 & - & - & - & - & - & - & - \tabularnewline
46 & 587 & - & - & - & - & - & - & - \tabularnewline
47 & 597 & - & - & - & - & - & - & - \tabularnewline
48 & 581 & - & - & - & - & - & - & - \tabularnewline
49 & 564 & - & - & - & - & - & - & - \tabularnewline
50 & 558 & 561.502 & 545.0985 & 577.9054 & 0.3378 & 0.3827 & 1 & 0.3827 \tabularnewline
51 & 575 & 574.6054 & 551.4323 & 597.7785 & 0.4867 & 0.9199 & 1 & 0.8151 \tabularnewline
52 & 580 & 585.0116 & 554.8546 & 615.1687 & 0.3723 & 0.7424 & 0.9999 & 0.914 \tabularnewline
53 & 575 & 590.4148 & 550.985 & 629.8446 & 0.2218 & 0.6977 & 0.9978 & 0.9054 \tabularnewline
54 & 563 & 592.7949 & 545.6199 & 639.97 & 0.1079 & 0.7701 & 0.9909 & 0.8842 \tabularnewline
55 & 552 & 593.2741 & 538.3738 & 648.1744 & 0.0703 & 0.8601 & 0.9777 & 0.852 \tabularnewline
56 & 537 & 580.3148 & 517.5399 & 643.0897 & 0.0881 & 0.8117 & 0.9607 & 0.6948 \tabularnewline
57 & 545 & 591.9906 & 521.9737 & 662.0075 & 0.0942 & 0.9381 & 0.9415 & 0.7833 \tabularnewline
58 & 601 & 642.8044 & 565.7194 & 719.8893 & 0.1439 & 0.9936 & 0.922 & 0.9774 \tabularnewline
59 & 604 & 652.762 & 568.8221 & 736.7019 & 0.1274 & 0.8866 & 0.9035 & 0.9809 \tabularnewline
60 & 586 & 636.6079 & 546.1727 & 727.0432 & 0.1364 & 0.7601 & 0.8859 & 0.9422 \tabularnewline
61 & 564 & 619.5313 & 522.814 & 716.2486 & 0.1302 & 0.7516 & 0.8698 & 0.8698 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109120&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[49])[/C][/ROW]
[ROW][C]37[/C][C]506[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]502[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]516[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]528[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]533[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]536[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]537[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]524[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]536[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]587[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]597[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]581[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]564[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]558[/C][C]561.502[/C][C]545.0985[/C][C]577.9054[/C][C]0.3378[/C][C]0.3827[/C][C]1[/C][C]0.3827[/C][/ROW]
[ROW][C]51[/C][C]575[/C][C]574.6054[/C][C]551.4323[/C][C]597.7785[/C][C]0.4867[/C][C]0.9199[/C][C]1[/C][C]0.8151[/C][/ROW]
[ROW][C]52[/C][C]580[/C][C]585.0116[/C][C]554.8546[/C][C]615.1687[/C][C]0.3723[/C][C]0.7424[/C][C]0.9999[/C][C]0.914[/C][/ROW]
[ROW][C]53[/C][C]575[/C][C]590.4148[/C][C]550.985[/C][C]629.8446[/C][C]0.2218[/C][C]0.6977[/C][C]0.9978[/C][C]0.9054[/C][/ROW]
[ROW][C]54[/C][C]563[/C][C]592.7949[/C][C]545.6199[/C][C]639.97[/C][C]0.1079[/C][C]0.7701[/C][C]0.9909[/C][C]0.8842[/C][/ROW]
[ROW][C]55[/C][C]552[/C][C]593.2741[/C][C]538.3738[/C][C]648.1744[/C][C]0.0703[/C][C]0.8601[/C][C]0.9777[/C][C]0.852[/C][/ROW]
[ROW][C]56[/C][C]537[/C][C]580.3148[/C][C]517.5399[/C][C]643.0897[/C][C]0.0881[/C][C]0.8117[/C][C]0.9607[/C][C]0.6948[/C][/ROW]
[ROW][C]57[/C][C]545[/C][C]591.9906[/C][C]521.9737[/C][C]662.0075[/C][C]0.0942[/C][C]0.9381[/C][C]0.9415[/C][C]0.7833[/C][/ROW]
[ROW][C]58[/C][C]601[/C][C]642.8044[/C][C]565.7194[/C][C]719.8893[/C][C]0.1439[/C][C]0.9936[/C][C]0.922[/C][C]0.9774[/C][/ROW]
[ROW][C]59[/C][C]604[/C][C]652.762[/C][C]568.8221[/C][C]736.7019[/C][C]0.1274[/C][C]0.8866[/C][C]0.9035[/C][C]0.9809[/C][/ROW]
[ROW][C]60[/C][C]586[/C][C]636.6079[/C][C]546.1727[/C][C]727.0432[/C][C]0.1364[/C][C]0.7601[/C][C]0.8859[/C][C]0.9422[/C][/ROW]
[ROW][C]61[/C][C]564[/C][C]619.5313[/C][C]522.814[/C][C]716.2486[/C][C]0.1302[/C][C]0.7516[/C][C]0.8698[/C][C]0.8698[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109120&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109120&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[49])
37506-------
38502-------
39516-------
40528-------
41533-------
42536-------
43537-------
44524-------
45536-------
46587-------
47597-------
48581-------
49564-------
50558561.502545.0985577.90540.33780.382710.3827
51575574.6054551.4323597.77850.48670.919910.8151
52580585.0116554.8546615.16870.37230.74240.99990.914
53575590.4148550.985629.84460.22180.69770.99780.9054
54563592.7949545.6199639.970.10790.77010.99090.8842
55552593.2741538.3738648.17440.07030.86010.97770.852
56537580.3148517.5399643.08970.08810.81170.96070.6948
57545591.9906521.9737662.00750.09420.93810.94150.7833
58601642.8044565.7194719.88930.14390.99360.9220.9774
59604652.762568.8221736.70190.12740.88660.90350.9809
60586636.6079546.1727727.04320.13640.76010.88590.9422
61564619.5313522.814716.24860.13020.75160.86980.8698







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0149-0.0062012.263700
510.02067e-040.00350.15576.20972.4919
520.0263-0.00860.005225.116412.51193.5372
530.0341-0.02610.0104237.616368.7888.2939
540.0406-0.05030.0184887.7389232.578215.2505
550.0472-0.06960.02691703.5531477.740721.8573
560.0552-0.07460.03371876.1721677.516626.0291
570.0603-0.07940.03942208.1137868.841229.4761
580.0612-0.0650.04231747.6047966.481631.0883
590.0656-0.07470.04552377.73251107.606733.2807
600.0725-0.07950.04862561.16381239.748335.2101
610.0796-0.08960.0523083.72341393.412937.3284

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0149 & -0.0062 & 0 & 12.2637 & 0 & 0 \tabularnewline
51 & 0.0206 & 7e-04 & 0.0035 & 0.1557 & 6.2097 & 2.4919 \tabularnewline
52 & 0.0263 & -0.0086 & 0.0052 & 25.1164 & 12.5119 & 3.5372 \tabularnewline
53 & 0.0341 & -0.0261 & 0.0104 & 237.6163 & 68.788 & 8.2939 \tabularnewline
54 & 0.0406 & -0.0503 & 0.0184 & 887.7389 & 232.5782 & 15.2505 \tabularnewline
55 & 0.0472 & -0.0696 & 0.0269 & 1703.5531 & 477.7407 & 21.8573 \tabularnewline
56 & 0.0552 & -0.0746 & 0.0337 & 1876.1721 & 677.5166 & 26.0291 \tabularnewline
57 & 0.0603 & -0.0794 & 0.0394 & 2208.1137 & 868.8412 & 29.4761 \tabularnewline
58 & 0.0612 & -0.065 & 0.0423 & 1747.6047 & 966.4816 & 31.0883 \tabularnewline
59 & 0.0656 & -0.0747 & 0.0455 & 2377.7325 & 1107.6067 & 33.2807 \tabularnewline
60 & 0.0725 & -0.0795 & 0.0486 & 2561.1638 & 1239.7483 & 35.2101 \tabularnewline
61 & 0.0796 & -0.0896 & 0.052 & 3083.7234 & 1393.4129 & 37.3284 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109120&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]50[/C][C]0.0149[/C][C]-0.0062[/C][C]0[/C][C]12.2637[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.0206[/C][C]7e-04[/C][C]0.0035[/C][C]0.1557[/C][C]6.2097[/C][C]2.4919[/C][/ROW]
[ROW][C]52[/C][C]0.0263[/C][C]-0.0086[/C][C]0.0052[/C][C]25.1164[/C][C]12.5119[/C][C]3.5372[/C][/ROW]
[ROW][C]53[/C][C]0.0341[/C][C]-0.0261[/C][C]0.0104[/C][C]237.6163[/C][C]68.788[/C][C]8.2939[/C][/ROW]
[ROW][C]54[/C][C]0.0406[/C][C]-0.0503[/C][C]0.0184[/C][C]887.7389[/C][C]232.5782[/C][C]15.2505[/C][/ROW]
[ROW][C]55[/C][C]0.0472[/C][C]-0.0696[/C][C]0.0269[/C][C]1703.5531[/C][C]477.7407[/C][C]21.8573[/C][/ROW]
[ROW][C]56[/C][C]0.0552[/C][C]-0.0746[/C][C]0.0337[/C][C]1876.1721[/C][C]677.5166[/C][C]26.0291[/C][/ROW]
[ROW][C]57[/C][C]0.0603[/C][C]-0.0794[/C][C]0.0394[/C][C]2208.1137[/C][C]868.8412[/C][C]29.4761[/C][/ROW]
[ROW][C]58[/C][C]0.0612[/C][C]-0.065[/C][C]0.0423[/C][C]1747.6047[/C][C]966.4816[/C][C]31.0883[/C][/ROW]
[ROW][C]59[/C][C]0.0656[/C][C]-0.0747[/C][C]0.0455[/C][C]2377.7325[/C][C]1107.6067[/C][C]33.2807[/C][/ROW]
[ROW][C]60[/C][C]0.0725[/C][C]-0.0795[/C][C]0.0486[/C][C]2561.1638[/C][C]1239.7483[/C][C]35.2101[/C][/ROW]
[ROW][C]61[/C][C]0.0796[/C][C]-0.0896[/C][C]0.052[/C][C]3083.7234[/C][C]1393.4129[/C][C]37.3284[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109120&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109120&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
500.0149-0.0062012.263700
510.02067e-040.00350.15576.20972.4919
520.0263-0.00860.005225.116412.51193.5372
530.0341-0.02610.0104237.616368.7888.2939
540.0406-0.05030.0184887.7389232.578215.2505
550.0472-0.06960.02691703.5531477.740721.8573
560.0552-0.07460.03371876.1721677.516626.0291
570.0603-0.07940.03942208.1137868.841229.4761
580.0612-0.0650.04231747.6047966.481631.0883
590.0656-0.07470.04552377.73251107.606733.2807
600.0725-0.07950.04862561.16381239.748335.2101
610.0796-0.08960.0523083.72341393.412937.3284



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