Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationMon, 21 Dec 2009 09:10:42 -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/21/t126141190549u5espjwheyu2s.htm/, Retrieved Sun, 05 May 2024 19:52:41 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70318, Retrieved Sun, 05 May 2024 19:52:41 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact102
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2009-12-21 16:10:42] [f340d7563d07b81b9aae66c73f3e92ac] [Current]
Feedback Forum

Post a new message
Dataseries X:
103.5
104.6
118.6
106.3
110.7
121.6
107
107.6
125.6
113.5
129.2
130.9
104.7
115.2
124.5
112.3
127.5
120.6
117.5
117.7
120.4
125
131.6
121.1
114.2
112.1
127
116.8
112
129.7
113.6
115.7
119.5
125.8
129.6
128
112.8
101.6
123.9
118.8
109.1
130.6
112.4
111
116.2
119.8
117.2
127.3
107.7
97.5
120.1
110.6
111.3
119.8
105.5
108.7
128.7
119.5
121.1
128.4




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70318&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'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])
36128-------
37112.8-------
38101.6-------
39123.9-------
40118.8-------
41109.1-------
42130.6-------
43112.4-------
44111-------
45116.2-------
46119.8-------
47117.2-------
48127.3-------
49107.7104.521394.8193114.22330.260400.04720
5097.599.405189.5391109.27120.35250.04970.33140
51120.1124.6884114.1539135.2230.196610.55830.3135
52110.6109.789698.0171121.56210.44630.0430.06680.0018
53111.3107.075395.2764118.87420.24140.27910.36834e-04
54119.8127.5613114.9534140.16930.11380.99430.31830.5162
55105.5106.74393.8894119.59670.42480.02320.19429e-04
56108.7110.905798.0377123.77370.36840.79490.49430.0063
57128.7113.9995100.5961127.40280.01580.78080.37380.0259
58119.5118.0738104.6113131.53620.41780.06090.40080.0896
59121.1120.4882106.9416134.03490.46470.55680.68290.1622
60128.4124.0259110.2127137.83910.26740.6610.32110.3211

\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 & 128 & - & - & - & - & - & - & - \tabularnewline
37 & 112.8 & - & - & - & - & - & - & - \tabularnewline
38 & 101.6 & - & - & - & - & - & - & - \tabularnewline
39 & 123.9 & - & - & - & - & - & - & - \tabularnewline
40 & 118.8 & - & - & - & - & - & - & - \tabularnewline
41 & 109.1 & - & - & - & - & - & - & - \tabularnewline
42 & 130.6 & - & - & - & - & - & - & - \tabularnewline
43 & 112.4 & - & - & - & - & - & - & - \tabularnewline
44 & 111 & - & - & - & - & - & - & - \tabularnewline
45 & 116.2 & - & - & - & - & - & - & - \tabularnewline
46 & 119.8 & - & - & - & - & - & - & - \tabularnewline
47 & 117.2 & - & - & - & - & - & - & - \tabularnewline
48 & 127.3 & - & - & - & - & - & - & - \tabularnewline
49 & 107.7 & 104.5213 & 94.8193 & 114.2233 & 0.2604 & 0 & 0.0472 & 0 \tabularnewline
50 & 97.5 & 99.4051 & 89.5391 & 109.2712 & 0.3525 & 0.0497 & 0.3314 & 0 \tabularnewline
51 & 120.1 & 124.6884 & 114.1539 & 135.223 & 0.1966 & 1 & 0.5583 & 0.3135 \tabularnewline
52 & 110.6 & 109.7896 & 98.0171 & 121.5621 & 0.4463 & 0.043 & 0.0668 & 0.0018 \tabularnewline
53 & 111.3 & 107.0753 & 95.2764 & 118.8742 & 0.2414 & 0.2791 & 0.3683 & 4e-04 \tabularnewline
54 & 119.8 & 127.5613 & 114.9534 & 140.1693 & 0.1138 & 0.9943 & 0.3183 & 0.5162 \tabularnewline
55 & 105.5 & 106.743 & 93.8894 & 119.5967 & 0.4248 & 0.0232 & 0.1942 & 9e-04 \tabularnewline
56 & 108.7 & 110.9057 & 98.0377 & 123.7737 & 0.3684 & 0.7949 & 0.4943 & 0.0063 \tabularnewline
57 & 128.7 & 113.9995 & 100.5961 & 127.4028 & 0.0158 & 0.7808 & 0.3738 & 0.0259 \tabularnewline
58 & 119.5 & 118.0738 & 104.6113 & 131.5362 & 0.4178 & 0.0609 & 0.4008 & 0.0896 \tabularnewline
59 & 121.1 & 120.4882 & 106.9416 & 134.0349 & 0.4647 & 0.5568 & 0.6829 & 0.1622 \tabularnewline
60 & 128.4 & 124.0259 & 110.2127 & 137.8391 & 0.2674 & 0.661 & 0.3211 & 0.3211 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70318&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]128[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]112.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]101.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]123.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]118.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]109.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]130.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]112.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]111[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]116.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]119.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]117.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]127.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]107.7[/C][C]104.5213[/C][C]94.8193[/C][C]114.2233[/C][C]0.2604[/C][C]0[/C][C]0.0472[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]97.5[/C][C]99.4051[/C][C]89.5391[/C][C]109.2712[/C][C]0.3525[/C][C]0.0497[/C][C]0.3314[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]120.1[/C][C]124.6884[/C][C]114.1539[/C][C]135.223[/C][C]0.1966[/C][C]1[/C][C]0.5583[/C][C]0.3135[/C][/ROW]
[ROW][C]52[/C][C]110.6[/C][C]109.7896[/C][C]98.0171[/C][C]121.5621[/C][C]0.4463[/C][C]0.043[/C][C]0.0668[/C][C]0.0018[/C][/ROW]
[ROW][C]53[/C][C]111.3[/C][C]107.0753[/C][C]95.2764[/C][C]118.8742[/C][C]0.2414[/C][C]0.2791[/C][C]0.3683[/C][C]4e-04[/C][/ROW]
[ROW][C]54[/C][C]119.8[/C][C]127.5613[/C][C]114.9534[/C][C]140.1693[/C][C]0.1138[/C][C]0.9943[/C][C]0.3183[/C][C]0.5162[/C][/ROW]
[ROW][C]55[/C][C]105.5[/C][C]106.743[/C][C]93.8894[/C][C]119.5967[/C][C]0.4248[/C][C]0.0232[/C][C]0.1942[/C][C]9e-04[/C][/ROW]
[ROW][C]56[/C][C]108.7[/C][C]110.9057[/C][C]98.0377[/C][C]123.7737[/C][C]0.3684[/C][C]0.7949[/C][C]0.4943[/C][C]0.0063[/C][/ROW]
[ROW][C]57[/C][C]128.7[/C][C]113.9995[/C][C]100.5961[/C][C]127.4028[/C][C]0.0158[/C][C]0.7808[/C][C]0.3738[/C][C]0.0259[/C][/ROW]
[ROW][C]58[/C][C]119.5[/C][C]118.0738[/C][C]104.6113[/C][C]131.5362[/C][C]0.4178[/C][C]0.0609[/C][C]0.4008[/C][C]0.0896[/C][/ROW]
[ROW][C]59[/C][C]121.1[/C][C]120.4882[/C][C]106.9416[/C][C]134.0349[/C][C]0.4647[/C][C]0.5568[/C][C]0.6829[/C][C]0.1622[/C][/ROW]
[ROW][C]60[/C][C]128.4[/C][C]124.0259[/C][C]110.2127[/C][C]137.8391[/C][C]0.2674[/C][C]0.661[/C][C]0.3211[/C][C]0.3211[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70318&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70318&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])
36128-------
37112.8-------
38101.6-------
39123.9-------
40118.8-------
41109.1-------
42130.6-------
43112.4-------
44111-------
45116.2-------
46119.8-------
47117.2-------
48127.3-------
49107.7104.521394.8193114.22330.260400.04720
5097.599.405189.5391109.27120.35250.04970.33140
51120.1124.6884114.1539135.2230.196610.55830.3135
52110.6109.789698.0171121.56210.44630.0430.06680.0018
53111.3107.075395.2764118.87420.24140.27910.36834e-04
54119.8127.5613114.9534140.16930.11380.99430.31830.5162
55105.5106.74393.8894119.59670.42480.02320.19429e-04
56108.7110.905798.0377123.77370.36840.79490.49430.0063
57128.7113.9995100.5961127.40280.01580.78080.37380.0259
58119.5118.0738104.6113131.53620.41780.06090.40080.0896
59121.1120.4882106.9416134.03490.46470.55680.68290.1622
60128.4124.0259110.2127137.83910.26740.6610.32110.3211







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.04740.0304010.103900
500.0506-0.01920.02483.62966.86672.6204
510.0431-0.03680.028821.053611.59573.4052
520.05470.00740.02340.65688.8612.9767
530.05620.03950.026617.84810.65843.2647
540.0504-0.06080.032360.238518.92174.3499
550.0614-0.01160.02941.545116.43944.0545
560.0592-0.01990.02824.865114.99263.872
570.060.1290.0394216.105637.33856.1105
580.05820.01210.03672.034133.8085.8145
590.05740.00510.03380.374230.76865.5469
600.05680.03530.033919.132529.79895.4588

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0474 & 0.0304 & 0 & 10.1039 & 0 & 0 \tabularnewline
50 & 0.0506 & -0.0192 & 0.0248 & 3.6296 & 6.8667 & 2.6204 \tabularnewline
51 & 0.0431 & -0.0368 & 0.0288 & 21.0536 & 11.5957 & 3.4052 \tabularnewline
52 & 0.0547 & 0.0074 & 0.0234 & 0.6568 & 8.861 & 2.9767 \tabularnewline
53 & 0.0562 & 0.0395 & 0.0266 & 17.848 & 10.6584 & 3.2647 \tabularnewline
54 & 0.0504 & -0.0608 & 0.0323 & 60.2385 & 18.9217 & 4.3499 \tabularnewline
55 & 0.0614 & -0.0116 & 0.0294 & 1.5451 & 16.4394 & 4.0545 \tabularnewline
56 & 0.0592 & -0.0199 & 0.0282 & 4.8651 & 14.9926 & 3.872 \tabularnewline
57 & 0.06 & 0.129 & 0.0394 & 216.1056 & 37.3385 & 6.1105 \tabularnewline
58 & 0.0582 & 0.0121 & 0.0367 & 2.0341 & 33.808 & 5.8145 \tabularnewline
59 & 0.0574 & 0.0051 & 0.0338 & 0.3742 & 30.7686 & 5.5469 \tabularnewline
60 & 0.0568 & 0.0353 & 0.0339 & 19.1325 & 29.7989 & 5.4588 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70318&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.0474[/C][C]0.0304[/C][C]0[/C][C]10.1039[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0506[/C][C]-0.0192[/C][C]0.0248[/C][C]3.6296[/C][C]6.8667[/C][C]2.6204[/C][/ROW]
[ROW][C]51[/C][C]0.0431[/C][C]-0.0368[/C][C]0.0288[/C][C]21.0536[/C][C]11.5957[/C][C]3.4052[/C][/ROW]
[ROW][C]52[/C][C]0.0547[/C][C]0.0074[/C][C]0.0234[/C][C]0.6568[/C][C]8.861[/C][C]2.9767[/C][/ROW]
[ROW][C]53[/C][C]0.0562[/C][C]0.0395[/C][C]0.0266[/C][C]17.848[/C][C]10.6584[/C][C]3.2647[/C][/ROW]
[ROW][C]54[/C][C]0.0504[/C][C]-0.0608[/C][C]0.0323[/C][C]60.2385[/C][C]18.9217[/C][C]4.3499[/C][/ROW]
[ROW][C]55[/C][C]0.0614[/C][C]-0.0116[/C][C]0.0294[/C][C]1.5451[/C][C]16.4394[/C][C]4.0545[/C][/ROW]
[ROW][C]56[/C][C]0.0592[/C][C]-0.0199[/C][C]0.0282[/C][C]4.8651[/C][C]14.9926[/C][C]3.872[/C][/ROW]
[ROW][C]57[/C][C]0.06[/C][C]0.129[/C][C]0.0394[/C][C]216.1056[/C][C]37.3385[/C][C]6.1105[/C][/ROW]
[ROW][C]58[/C][C]0.0582[/C][C]0.0121[/C][C]0.0367[/C][C]2.0341[/C][C]33.808[/C][C]5.8145[/C][/ROW]
[ROW][C]59[/C][C]0.0574[/C][C]0.0051[/C][C]0.0338[/C][C]0.3742[/C][C]30.7686[/C][C]5.5469[/C][/ROW]
[ROW][C]60[/C][C]0.0568[/C][C]0.0353[/C][C]0.0339[/C][C]19.1325[/C][C]29.7989[/C][C]5.4588[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70318&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70318&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.04740.0304010.103900
500.0506-0.01920.02483.62966.86672.6204
510.0431-0.03680.028821.053611.59573.4052
520.05470.00740.02340.65688.8612.9767
530.05620.03950.026617.84810.65843.2647
540.0504-0.06080.032360.238518.92174.3499
550.0614-0.01160.02941.545116.43944.0545
560.0592-0.01990.02824.865114.99263.872
570.060.1290.0394216.105637.33856.1105
580.05820.01210.03672.034133.8085.8145
590.05740.00510.03380.374230.76865.5469
600.05680.03530.033919.132529.79895.4588



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