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 computationFri, 18 Dec 2009 07:20:16 -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/18/t12611461819o6l957r25qa2ch.htm/, Retrieved Sat, 27 Apr 2024 10:41:02 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69366, Retrieved Sat, 27 Apr 2024 10:41:02 +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)
-     [Standard Deviation-Mean Plot] [deel1 st dev mean...] [2009-12-16 19:13:20] [95cead3ebb75668735f848316249436a]
- RMP   [(Partial) Autocorrelation Function] [deel1 acf D=d=0] [2009-12-16 19:17:58] [95cead3ebb75668735f848316249436a]
-         [(Partial) Autocorrelation Function] [deel1 acf D=d=1] [2009-12-16 19:21:27] [95cead3ebb75668735f848316249436a]
- RM        [Variance Reduction Matrix] [deel1 vrm] [2009-12-16 19:23:09] [95cead3ebb75668735f848316249436a]
- RM          [Spectral Analysis] [deel1 spectrum D=d=1] [2009-12-16 19:31:03] [95cead3ebb75668735f848316249436a]
- RMP           [ARIMA Backward Selection] [deel1 arima] [2009-12-18 11:30:34] [95cead3ebb75668735f848316249436a]
- RM D              [ARIMA Forecasting] [ARIMA forcasting] [2009-12-18 14:20:16] [95523ebdb89b97dbf680ec91e0b4bca2] [Current]
Feedback Forum

Post a new message
Dataseries X:
696
641
695
638
762
635
721
854
418
367
824
687
601
676
740
691
683
594
729
731
386
331
707
715
657
653
642
643
718
654
632
731
392
344
792
852
649
629
685
617
715
715
629
916
531
357
917
828
708
858
775
785
1006
789
734
906
532
387
991
841




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69366&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])
36852-------
37649-------
38629-------
39685-------
40617-------
41715-------
42715-------
43629-------
44916-------
45531-------
46357-------
47917-------
48828-------
49708715.0637588.0911888.07880.46810.10040.77290.1004
50858707.0253579.1905882.37230.04570.49570.80840.0882
51775752.7526609.8872952.39480.41360.15070.7470.23
52785697.7439566.8776879.76870.17370.20270.80770.0804
531006792.8695632.78161022.38730.03440.52680.7470.3821
54789749.3934598.8782964.69790.35920.00970.62290.2371
55734713.2117570.4116917.20640.42080.23330.79080.135
56906935.4675722.1961259.30750.42920.88860.54690.7423
57532503.4428413.5775626.1280.324100.32990
58387377.3305316.938456.7850.40571e-040.6920
59991950.4261722.11231306.98770.41180.9990.57290.7495
60841902.2038686.99341236.9890.36010.30160.6680.668

\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 & 852 & - & - & - & - & - & - & - \tabularnewline
37 & 649 & - & - & - & - & - & - & - \tabularnewline
38 & 629 & - & - & - & - & - & - & - \tabularnewline
39 & 685 & - & - & - & - & - & - & - \tabularnewline
40 & 617 & - & - & - & - & - & - & - \tabularnewline
41 & 715 & - & - & - & - & - & - & - \tabularnewline
42 & 715 & - & - & - & - & - & - & - \tabularnewline
43 & 629 & - & - & - & - & - & - & - \tabularnewline
44 & 916 & - & - & - & - & - & - & - \tabularnewline
45 & 531 & - & - & - & - & - & - & - \tabularnewline
46 & 357 & - & - & - & - & - & - & - \tabularnewline
47 & 917 & - & - & - & - & - & - & - \tabularnewline
48 & 828 & - & - & - & - & - & - & - \tabularnewline
49 & 708 & 715.0637 & 588.0911 & 888.0788 & 0.4681 & 0.1004 & 0.7729 & 0.1004 \tabularnewline
50 & 858 & 707.0253 & 579.1905 & 882.3723 & 0.0457 & 0.4957 & 0.8084 & 0.0882 \tabularnewline
51 & 775 & 752.7526 & 609.8872 & 952.3948 & 0.4136 & 0.1507 & 0.747 & 0.23 \tabularnewline
52 & 785 & 697.7439 & 566.8776 & 879.7687 & 0.1737 & 0.2027 & 0.8077 & 0.0804 \tabularnewline
53 & 1006 & 792.8695 & 632.7816 & 1022.3873 & 0.0344 & 0.5268 & 0.747 & 0.3821 \tabularnewline
54 & 789 & 749.3934 & 598.8782 & 964.6979 & 0.3592 & 0.0097 & 0.6229 & 0.2371 \tabularnewline
55 & 734 & 713.2117 & 570.4116 & 917.2064 & 0.4208 & 0.2333 & 0.7908 & 0.135 \tabularnewline
56 & 906 & 935.4675 & 722.196 & 1259.3075 & 0.4292 & 0.8886 & 0.5469 & 0.7423 \tabularnewline
57 & 532 & 503.4428 & 413.5775 & 626.128 & 0.3241 & 0 & 0.3299 & 0 \tabularnewline
58 & 387 & 377.3305 & 316.938 & 456.785 & 0.4057 & 1e-04 & 0.692 & 0 \tabularnewline
59 & 991 & 950.4261 & 722.1123 & 1306.9877 & 0.4118 & 0.999 & 0.5729 & 0.7495 \tabularnewline
60 & 841 & 902.2038 & 686.9934 & 1236.989 & 0.3601 & 0.3016 & 0.668 & 0.668 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69366&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]852[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]649[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]629[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]685[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]617[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]715[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]715[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]629[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]916[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]531[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]917[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]828[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]708[/C][C]715.0637[/C][C]588.0911[/C][C]888.0788[/C][C]0.4681[/C][C]0.1004[/C][C]0.7729[/C][C]0.1004[/C][/ROW]
[ROW][C]50[/C][C]858[/C][C]707.0253[/C][C]579.1905[/C][C]882.3723[/C][C]0.0457[/C][C]0.4957[/C][C]0.8084[/C][C]0.0882[/C][/ROW]
[ROW][C]51[/C][C]775[/C][C]752.7526[/C][C]609.8872[/C][C]952.3948[/C][C]0.4136[/C][C]0.1507[/C][C]0.747[/C][C]0.23[/C][/ROW]
[ROW][C]52[/C][C]785[/C][C]697.7439[/C][C]566.8776[/C][C]879.7687[/C][C]0.1737[/C][C]0.2027[/C][C]0.8077[/C][C]0.0804[/C][/ROW]
[ROW][C]53[/C][C]1006[/C][C]792.8695[/C][C]632.7816[/C][C]1022.3873[/C][C]0.0344[/C][C]0.5268[/C][C]0.747[/C][C]0.3821[/C][/ROW]
[ROW][C]54[/C][C]789[/C][C]749.3934[/C][C]598.8782[/C][C]964.6979[/C][C]0.3592[/C][C]0.0097[/C][C]0.6229[/C][C]0.2371[/C][/ROW]
[ROW][C]55[/C][C]734[/C][C]713.2117[/C][C]570.4116[/C][C]917.2064[/C][C]0.4208[/C][C]0.2333[/C][C]0.7908[/C][C]0.135[/C][/ROW]
[ROW][C]56[/C][C]906[/C][C]935.4675[/C][C]722.196[/C][C]1259.3075[/C][C]0.4292[/C][C]0.8886[/C][C]0.5469[/C][C]0.7423[/C][/ROW]
[ROW][C]57[/C][C]532[/C][C]503.4428[/C][C]413.5775[/C][C]626.128[/C][C]0.3241[/C][C]0[/C][C]0.3299[/C][C]0[/C][/ROW]
[ROW][C]58[/C][C]387[/C][C]377.3305[/C][C]316.938[/C][C]456.785[/C][C]0.4057[/C][C]1e-04[/C][C]0.692[/C][C]0[/C][/ROW]
[ROW][C]59[/C][C]991[/C][C]950.4261[/C][C]722.1123[/C][C]1306.9877[/C][C]0.4118[/C][C]0.999[/C][C]0.5729[/C][C]0.7495[/C][/ROW]
[ROW][C]60[/C][C]841[/C][C]902.2038[/C][C]686.9934[/C][C]1236.989[/C][C]0.3601[/C][C]0.3016[/C][C]0.668[/C][C]0.668[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69366&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69366&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])
36852-------
37649-------
38629-------
39685-------
40617-------
41715-------
42715-------
43629-------
44916-------
45531-------
46357-------
47917-------
48828-------
49708715.0637588.0911888.07880.46810.10040.77290.1004
50858707.0253579.1905882.37230.04570.49570.80840.0882
51775752.7526609.8872952.39480.41360.15070.7470.23
52785697.7439566.8776879.76870.17370.20270.80770.0804
531006792.8695632.78161022.38730.03440.52680.7470.3821
54789749.3934598.8782964.69790.35920.00970.62290.2371
55734713.2117570.4116917.20640.42080.23330.79080.135
56906935.4675722.1961259.30750.42920.88860.54690.7423
57532503.4428413.5775626.1280.324100.32990
58387377.3305316.938456.7850.40571e-040.6920
59991950.4261722.11231306.98770.41180.9990.57290.7495
60841902.2038686.99341236.9890.36010.30160.6680.668







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.1234-0.0099049.896400
500.12650.21350.111722793.359211421.6278106.872
510.13530.02960.0843494.9497779.401588.2009
520.13310.12510.09457613.63417737.959787.9657
530.14770.26880.129445424.620415275.2918123.5933
540.14660.05290.11661568.685112990.8574113.9774
550.14590.02910.1041432.153311196.7568105.8147
560.1766-0.03150.095868.33429905.70499.5274
570.12430.05670.0908815.51368895.682894.3169
580.10740.02560.084393.49928015.464489.5291
590.19140.04270.08051646.24247436.444386.2348
600.1893-0.06780.07943745.89997128.898984.4328

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1234 & -0.0099 & 0 & 49.8964 & 0 & 0 \tabularnewline
50 & 0.1265 & 0.2135 & 0.1117 & 22793.3592 & 11421.6278 & 106.872 \tabularnewline
51 & 0.1353 & 0.0296 & 0.0843 & 494.949 & 7779.4015 & 88.2009 \tabularnewline
52 & 0.1331 & 0.1251 & 0.0945 & 7613.6341 & 7737.9597 & 87.9657 \tabularnewline
53 & 0.1477 & 0.2688 & 0.1294 & 45424.6204 & 15275.2918 & 123.5933 \tabularnewline
54 & 0.1466 & 0.0529 & 0.1166 & 1568.6851 & 12990.8574 & 113.9774 \tabularnewline
55 & 0.1459 & 0.0291 & 0.1041 & 432.1533 & 11196.7568 & 105.8147 \tabularnewline
56 & 0.1766 & -0.0315 & 0.095 & 868.3342 & 9905.704 & 99.5274 \tabularnewline
57 & 0.1243 & 0.0567 & 0.0908 & 815.5136 & 8895.6828 & 94.3169 \tabularnewline
58 & 0.1074 & 0.0256 & 0.0843 & 93.4992 & 8015.4644 & 89.5291 \tabularnewline
59 & 0.1914 & 0.0427 & 0.0805 & 1646.2424 & 7436.4443 & 86.2348 \tabularnewline
60 & 0.1893 & -0.0678 & 0.0794 & 3745.8999 & 7128.8989 & 84.4328 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69366&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.1234[/C][C]-0.0099[/C][C]0[/C][C]49.8964[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.1265[/C][C]0.2135[/C][C]0.1117[/C][C]22793.3592[/C][C]11421.6278[/C][C]106.872[/C][/ROW]
[ROW][C]51[/C][C]0.1353[/C][C]0.0296[/C][C]0.0843[/C][C]494.949[/C][C]7779.4015[/C][C]88.2009[/C][/ROW]
[ROW][C]52[/C][C]0.1331[/C][C]0.1251[/C][C]0.0945[/C][C]7613.6341[/C][C]7737.9597[/C][C]87.9657[/C][/ROW]
[ROW][C]53[/C][C]0.1477[/C][C]0.2688[/C][C]0.1294[/C][C]45424.6204[/C][C]15275.2918[/C][C]123.5933[/C][/ROW]
[ROW][C]54[/C][C]0.1466[/C][C]0.0529[/C][C]0.1166[/C][C]1568.6851[/C][C]12990.8574[/C][C]113.9774[/C][/ROW]
[ROW][C]55[/C][C]0.1459[/C][C]0.0291[/C][C]0.1041[/C][C]432.1533[/C][C]11196.7568[/C][C]105.8147[/C][/ROW]
[ROW][C]56[/C][C]0.1766[/C][C]-0.0315[/C][C]0.095[/C][C]868.3342[/C][C]9905.704[/C][C]99.5274[/C][/ROW]
[ROW][C]57[/C][C]0.1243[/C][C]0.0567[/C][C]0.0908[/C][C]815.5136[/C][C]8895.6828[/C][C]94.3169[/C][/ROW]
[ROW][C]58[/C][C]0.1074[/C][C]0.0256[/C][C]0.0843[/C][C]93.4992[/C][C]8015.4644[/C][C]89.5291[/C][/ROW]
[ROW][C]59[/C][C]0.1914[/C][C]0.0427[/C][C]0.0805[/C][C]1646.2424[/C][C]7436.4443[/C][C]86.2348[/C][/ROW]
[ROW][C]60[/C][C]0.1893[/C][C]-0.0678[/C][C]0.0794[/C][C]3745.8999[/C][C]7128.8989[/C][C]84.4328[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69366&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69366&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.1234-0.0099049.896400
500.12650.21350.111722793.359211421.6278106.872
510.13530.02960.0843494.9497779.401588.2009
520.13310.12510.09457613.63417737.959787.9657
530.14770.26880.129445424.620415275.2918123.5933
540.14660.05290.11661568.685112990.8574113.9774
550.14590.02910.1041432.153311196.7568105.8147
560.1766-0.03150.095868.33429905.70499.5274
570.12430.05670.0908815.51368895.682894.3169
580.10740.02560.084393.49928015.464489.5291
590.19140.04270.08051646.24247436.444386.2348
600.1893-0.06780.07943745.89997128.898984.4328



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