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 computationSun, 20 Dec 2009 07:13:12 -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/20/t12613184691v3xyqlfakz9dnm.htm/, Retrieved Sat, 27 Apr 2024 07:43:10 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69897, Retrieved Sat, 27 Apr 2024 07:43:10 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact114
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [ARIMA Forecasting] [2008-12-21 20:05:20] [005278dde49cfd8c32bf201feaeb19d6]
- RM D  [ARIMA Forecasting] [] [2009-12-15 16:50:46] [1c68450965e88b7c1ed117c35898acdf]
-   PD      [ARIMA Forecasting] [] [2009-12-20 14:13:12] [cb3e966d7bf80cd999a0432e97d174a7] [Current]
Feedback Forum

Post a new message
Dataseries X:
558
564
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




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=69897&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=69897&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69897&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])
36557-------
37566-------
38588-------
39620-------
40626-------
41620-------
42573-------
43573-------
44574-------
45580-------
46590-------
47593-------
48597-------
49595602.2766585.7771618.77610.19370.734610.7346
50612622.4804598.9061646.05470.19180.98880.99790.9829
51628656.5398625.8764687.20310.03410.99780.99020.9999
52629661.0152621.2417700.78880.05730.94810.95780.9992
53621654.7182607.1851702.25130.08220.85550.92390.9913
54569608.1569553.0188663.29510.0820.3240.89430.6542
55567607.5979544.8054670.39040.10250.88590.85990.6296
56573608.5589538.6873678.43050.15930.87810.83380.6271
57584614.6136537.9035691.32380.2170.85620.81180.6737
58589624.4181541.1085707.72780.20230.82920.7910.7406
59591627.41537.8437716.97640.21280.79970.77430.7471
60595631.3957535.8109726.98060.22770.79630.75970.7597

\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 & 557 & - & - & - & - & - & - & - \tabularnewline
37 & 566 & - & - & - & - & - & - & - \tabularnewline
38 & 588 & - & - & - & - & - & - & - \tabularnewline
39 & 620 & - & - & - & - & - & - & - \tabularnewline
40 & 626 & - & - & - & - & - & - & - \tabularnewline
41 & 620 & - & - & - & - & - & - & - \tabularnewline
42 & 573 & - & - & - & - & - & - & - \tabularnewline
43 & 573 & - & - & - & - & - & - & - \tabularnewline
44 & 574 & - & - & - & - & - & - & - \tabularnewline
45 & 580 & - & - & - & - & - & - & - \tabularnewline
46 & 590 & - & - & - & - & - & - & - \tabularnewline
47 & 593 & - & - & - & - & - & - & - \tabularnewline
48 & 597 & - & - & - & - & - & - & - \tabularnewline
49 & 595 & 602.2766 & 585.7771 & 618.7761 & 0.1937 & 0.7346 & 1 & 0.7346 \tabularnewline
50 & 612 & 622.4804 & 598.9061 & 646.0547 & 0.1918 & 0.9888 & 0.9979 & 0.9829 \tabularnewline
51 & 628 & 656.5398 & 625.8764 & 687.2031 & 0.0341 & 0.9978 & 0.9902 & 0.9999 \tabularnewline
52 & 629 & 661.0152 & 621.2417 & 700.7888 & 0.0573 & 0.9481 & 0.9578 & 0.9992 \tabularnewline
53 & 621 & 654.7182 & 607.1851 & 702.2513 & 0.0822 & 0.8555 & 0.9239 & 0.9913 \tabularnewline
54 & 569 & 608.1569 & 553.0188 & 663.2951 & 0.082 & 0.324 & 0.8943 & 0.6542 \tabularnewline
55 & 567 & 607.5979 & 544.8054 & 670.3904 & 0.1025 & 0.8859 & 0.8599 & 0.6296 \tabularnewline
56 & 573 & 608.5589 & 538.6873 & 678.4305 & 0.1593 & 0.8781 & 0.8338 & 0.6271 \tabularnewline
57 & 584 & 614.6136 & 537.9035 & 691.3238 & 0.217 & 0.8562 & 0.8118 & 0.6737 \tabularnewline
58 & 589 & 624.4181 & 541.1085 & 707.7278 & 0.2023 & 0.8292 & 0.791 & 0.7406 \tabularnewline
59 & 591 & 627.41 & 537.8437 & 716.9764 & 0.2128 & 0.7997 & 0.7743 & 0.7471 \tabularnewline
60 & 595 & 631.3957 & 535.8109 & 726.9806 & 0.2277 & 0.7963 & 0.7597 & 0.7597 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69897&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]557[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]566[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]588[/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]626[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]620[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]573[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]573[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]574[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]580[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]590[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]593[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]597[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]595[/C][C]602.2766[/C][C]585.7771[/C][C]618.7761[/C][C]0.1937[/C][C]0.7346[/C][C]1[/C][C]0.7346[/C][/ROW]
[ROW][C]50[/C][C]612[/C][C]622.4804[/C][C]598.9061[/C][C]646.0547[/C][C]0.1918[/C][C]0.9888[/C][C]0.9979[/C][C]0.9829[/C][/ROW]
[ROW][C]51[/C][C]628[/C][C]656.5398[/C][C]625.8764[/C][C]687.2031[/C][C]0.0341[/C][C]0.9978[/C][C]0.9902[/C][C]0.9999[/C][/ROW]
[ROW][C]52[/C][C]629[/C][C]661.0152[/C][C]621.2417[/C][C]700.7888[/C][C]0.0573[/C][C]0.9481[/C][C]0.9578[/C][C]0.9992[/C][/ROW]
[ROW][C]53[/C][C]621[/C][C]654.7182[/C][C]607.1851[/C][C]702.2513[/C][C]0.0822[/C][C]0.8555[/C][C]0.9239[/C][C]0.9913[/C][/ROW]
[ROW][C]54[/C][C]569[/C][C]608.1569[/C][C]553.0188[/C][C]663.2951[/C][C]0.082[/C][C]0.324[/C][C]0.8943[/C][C]0.6542[/C][/ROW]
[ROW][C]55[/C][C]567[/C][C]607.5979[/C][C]544.8054[/C][C]670.3904[/C][C]0.1025[/C][C]0.8859[/C][C]0.8599[/C][C]0.6296[/C][/ROW]
[ROW][C]56[/C][C]573[/C][C]608.5589[/C][C]538.6873[/C][C]678.4305[/C][C]0.1593[/C][C]0.8781[/C][C]0.8338[/C][C]0.6271[/C][/ROW]
[ROW][C]57[/C][C]584[/C][C]614.6136[/C][C]537.9035[/C][C]691.3238[/C][C]0.217[/C][C]0.8562[/C][C]0.8118[/C][C]0.6737[/C][/ROW]
[ROW][C]58[/C][C]589[/C][C]624.4181[/C][C]541.1085[/C][C]707.7278[/C][C]0.2023[/C][C]0.8292[/C][C]0.791[/C][C]0.7406[/C][/ROW]
[ROW][C]59[/C][C]591[/C][C]627.41[/C][C]537.8437[/C][C]716.9764[/C][C]0.2128[/C][C]0.7997[/C][C]0.7743[/C][C]0.7471[/C][/ROW]
[ROW][C]60[/C][C]595[/C][C]631.3957[/C][C]535.8109[/C][C]726.9806[/C][C]0.2277[/C][C]0.7963[/C][C]0.7597[/C][C]0.7597[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69897&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69897&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])
36557-------
37566-------
38588-------
39620-------
40626-------
41620-------
42573-------
43573-------
44574-------
45580-------
46590-------
47593-------
48597-------
49595602.2766585.7771618.77610.19370.734610.7346
50612622.4804598.9061646.05470.19180.98880.99790.9829
51628656.5398625.8764687.20310.03410.99780.99020.9999
52629661.0152621.2417700.78880.05730.94810.95780.9992
53621654.7182607.1851702.25130.08220.85550.92390.9913
54569608.1569553.0188663.29510.0820.3240.89430.6542
55567607.5979544.8054670.39040.10250.88590.85990.6296
56573608.5589538.6873678.43050.15930.87810.83380.6271
57584614.6136537.9035691.32380.2170.85620.81180.6737
58589624.4181541.1085707.72780.20230.82920.7910.7406
59591627.41537.8437716.97640.21280.79970.77430.7471
60595631.3957535.8109726.98060.22770.79630.75970.7597







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.014-0.0121052.949400
500.0193-0.01680.0145109.838381.39389.0219
510.0238-0.04350.0241814.5195325.769118.0491
520.0307-0.04840.03021024.9758500.570822.3734
530.037-0.05150.03451136.9185627.840325.0567
540.0463-0.06440.03951533.2665778.744727.906
550.0527-0.06680.04341648.1866902.950730.0491
560.0586-0.05840.04521264.4354948.136330.7918
570.0637-0.04980.0458937.1936946.920430.7721
580.0681-0.05670.04681254.444977.672831.2678
590.0728-0.0580.04791325.6911009.310831.7697
600.0772-0.05760.04871324.64941035.58932.1806

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.014 & -0.0121 & 0 & 52.9494 & 0 & 0 \tabularnewline
50 & 0.0193 & -0.0168 & 0.0145 & 109.8383 & 81.3938 & 9.0219 \tabularnewline
51 & 0.0238 & -0.0435 & 0.0241 & 814.5195 & 325.7691 & 18.0491 \tabularnewline
52 & 0.0307 & -0.0484 & 0.0302 & 1024.9758 & 500.5708 & 22.3734 \tabularnewline
53 & 0.037 & -0.0515 & 0.0345 & 1136.9185 & 627.8403 & 25.0567 \tabularnewline
54 & 0.0463 & -0.0644 & 0.0395 & 1533.2665 & 778.7447 & 27.906 \tabularnewline
55 & 0.0527 & -0.0668 & 0.0434 & 1648.1866 & 902.9507 & 30.0491 \tabularnewline
56 & 0.0586 & -0.0584 & 0.0452 & 1264.4354 & 948.1363 & 30.7918 \tabularnewline
57 & 0.0637 & -0.0498 & 0.0458 & 937.1936 & 946.9204 & 30.7721 \tabularnewline
58 & 0.0681 & -0.0567 & 0.0468 & 1254.444 & 977.6728 & 31.2678 \tabularnewline
59 & 0.0728 & -0.058 & 0.0479 & 1325.691 & 1009.3108 & 31.7697 \tabularnewline
60 & 0.0772 & -0.0576 & 0.0487 & 1324.6494 & 1035.589 & 32.1806 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69897&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.014[/C][C]-0.0121[/C][C]0[/C][C]52.9494[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0193[/C][C]-0.0168[/C][C]0.0145[/C][C]109.8383[/C][C]81.3938[/C][C]9.0219[/C][/ROW]
[ROW][C]51[/C][C]0.0238[/C][C]-0.0435[/C][C]0.0241[/C][C]814.5195[/C][C]325.7691[/C][C]18.0491[/C][/ROW]
[ROW][C]52[/C][C]0.0307[/C][C]-0.0484[/C][C]0.0302[/C][C]1024.9758[/C][C]500.5708[/C][C]22.3734[/C][/ROW]
[ROW][C]53[/C][C]0.037[/C][C]-0.0515[/C][C]0.0345[/C][C]1136.9185[/C][C]627.8403[/C][C]25.0567[/C][/ROW]
[ROW][C]54[/C][C]0.0463[/C][C]-0.0644[/C][C]0.0395[/C][C]1533.2665[/C][C]778.7447[/C][C]27.906[/C][/ROW]
[ROW][C]55[/C][C]0.0527[/C][C]-0.0668[/C][C]0.0434[/C][C]1648.1866[/C][C]902.9507[/C][C]30.0491[/C][/ROW]
[ROW][C]56[/C][C]0.0586[/C][C]-0.0584[/C][C]0.0452[/C][C]1264.4354[/C][C]948.1363[/C][C]30.7918[/C][/ROW]
[ROW][C]57[/C][C]0.0637[/C][C]-0.0498[/C][C]0.0458[/C][C]937.1936[/C][C]946.9204[/C][C]30.7721[/C][/ROW]
[ROW][C]58[/C][C]0.0681[/C][C]-0.0567[/C][C]0.0468[/C][C]1254.444[/C][C]977.6728[/C][C]31.2678[/C][/ROW]
[ROW][C]59[/C][C]0.0728[/C][C]-0.058[/C][C]0.0479[/C][C]1325.691[/C][C]1009.3108[/C][C]31.7697[/C][/ROW]
[ROW][C]60[/C][C]0.0772[/C][C]-0.0576[/C][C]0.0487[/C][C]1324.6494[/C][C]1035.589[/C][C]32.1806[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69897&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69897&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.014-0.0121052.949400
500.0193-0.01680.0145109.838381.39389.0219
510.0238-0.04350.0241814.5195325.769118.0491
520.0307-0.04840.03021024.9758500.570822.3734
530.037-0.05150.03451136.9185627.840325.0567
540.0463-0.06440.03951533.2665778.744727.906
550.0527-0.06680.04341648.1866902.950730.0491
560.0586-0.05840.04521264.4354948.136330.7918
570.0637-0.04980.0458937.1936946.920430.7721
580.0681-0.05670.04681254.444977.672831.2678
590.0728-0.0580.04791325.6911009.310831.7697
600.0772-0.05760.04871324.64941035.58932.1806



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')