Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 13 Dec 2007 12:18:34 -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/2007/Dec/13/t1197572604ag1r198481v14r2.htm/, Retrieved Sun, 05 May 2024 11:59:56 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3696, Retrieved Sun, 05 May 2024 11:59:56 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact194
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [workshop 5 - vraag 1] [2007-12-13 19:18:34] [bad81931077d8a4f1668ce1551154583] [Current]
Feedback Forum

Post a new message
Dataseries X:
98,8
100,5
110,4
96,4
101,9
106,2
81,0
94,7
101,0
109,4
102,3
90,7
96,2
96,1
106,0
103,1
102,0
104,7
86,0
92,1
106,9
112,6
101,7
92,0
97,4
97,0
105,4
102,7
98,1
104,5
87,4
89,9
109,8
111,7
98,6
96,9
95,1
97,0
112,7
102,9
97,4
111,4
87,4
96,8
114,1
110,3
103,9
101,6
94,6
95,9
104,7
102,8
98,1
113,9
80,9
95,7
113,2
105,9
108,8
102,3
99,0
100,7
115,5
100,7
109,9
114,6
85,4
100,5
114,8
116,5
112,9
102,0
106,0
105,3
118,8
106,1
109,3
117,2
91,9
103,9
115,9




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 3 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3696&T=0

[TABLE]
[ROW][C]Summary of compuational 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]3 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=3696&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3696&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 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[69])
57113.2-------
58105.9-------
59108.8-------
60102.3-------
6199-------
62100.7-------
63115.5-------
64100.7-------
65109.9-------
66114.6-------
6785.4-------
68100.5-------
69114.8-------
70116.5111.5792104.9454118.2130.0730.17060.95330.1706
71112.9110.269103.6294116.90870.21870.03290.66770.0905
72102102.529595.6291109.42990.44020.00160.5262e-04
73106101.322193.7748108.86950.11220.43010.72682e-04
74105.3102.998695.4461110.55110.27520.2180.72460.0011
75118.8115.2457107.4652123.02620.18530.99390.47450.5447
76106.1104.222196.2697112.17450.32172e-040.80730.0046
77109.3108.4484100.4582116.43850.41730.71770.36090.0596
78117.2114.6237106.4957122.75180.26720.90040.50230.483
7991.988.104679.897196.31210.182400.74080
80103.9100.659892.3968108.92290.22110.98110.51514e-04
81115.9114.8364106.4911123.18180.40140.99490.50340.5034

\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[69]) \tabularnewline
57 & 113.2 & - & - & - & - & - & - & - \tabularnewline
58 & 105.9 & - & - & - & - & - & - & - \tabularnewline
59 & 108.8 & - & - & - & - & - & - & - \tabularnewline
60 & 102.3 & - & - & - & - & - & - & - \tabularnewline
61 & 99 & - & - & - & - & - & - & - \tabularnewline
62 & 100.7 & - & - & - & - & - & - & - \tabularnewline
63 & 115.5 & - & - & - & - & - & - & - \tabularnewline
64 & 100.7 & - & - & - & - & - & - & - \tabularnewline
65 & 109.9 & - & - & - & - & - & - & - \tabularnewline
66 & 114.6 & - & - & - & - & - & - & - \tabularnewline
67 & 85.4 & - & - & - & - & - & - & - \tabularnewline
68 & 100.5 & - & - & - & - & - & - & - \tabularnewline
69 & 114.8 & - & - & - & - & - & - & - \tabularnewline
70 & 116.5 & 111.5792 & 104.9454 & 118.213 & 0.073 & 0.1706 & 0.9533 & 0.1706 \tabularnewline
71 & 112.9 & 110.269 & 103.6294 & 116.9087 & 0.2187 & 0.0329 & 0.6677 & 0.0905 \tabularnewline
72 & 102 & 102.5295 & 95.6291 & 109.4299 & 0.4402 & 0.0016 & 0.526 & 2e-04 \tabularnewline
73 & 106 & 101.3221 & 93.7748 & 108.8695 & 0.1122 & 0.4301 & 0.7268 & 2e-04 \tabularnewline
74 & 105.3 & 102.9986 & 95.4461 & 110.5511 & 0.2752 & 0.218 & 0.7246 & 0.0011 \tabularnewline
75 & 118.8 & 115.2457 & 107.4652 & 123.0262 & 0.1853 & 0.9939 & 0.4745 & 0.5447 \tabularnewline
76 & 106.1 & 104.2221 & 96.2697 & 112.1745 & 0.3217 & 2e-04 & 0.8073 & 0.0046 \tabularnewline
77 & 109.3 & 108.4484 & 100.4582 & 116.4385 & 0.4173 & 0.7177 & 0.3609 & 0.0596 \tabularnewline
78 & 117.2 & 114.6237 & 106.4957 & 122.7518 & 0.2672 & 0.9004 & 0.5023 & 0.483 \tabularnewline
79 & 91.9 & 88.1046 & 79.8971 & 96.3121 & 0.1824 & 0 & 0.7408 & 0 \tabularnewline
80 & 103.9 & 100.6598 & 92.3968 & 108.9229 & 0.2211 & 0.9811 & 0.5151 & 4e-04 \tabularnewline
81 & 115.9 & 114.8364 & 106.4911 & 123.1818 & 0.4014 & 0.9949 & 0.5034 & 0.5034 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3696&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[69])[/C][/ROW]
[ROW][C]57[/C][C]113.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]105.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]108.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]102.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]99[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]100.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]115.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]100.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]109.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]114.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]85.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]100.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]114.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]116.5[/C][C]111.5792[/C][C]104.9454[/C][C]118.213[/C][C]0.073[/C][C]0.1706[/C][C]0.9533[/C][C]0.1706[/C][/ROW]
[ROW][C]71[/C][C]112.9[/C][C]110.269[/C][C]103.6294[/C][C]116.9087[/C][C]0.2187[/C][C]0.0329[/C][C]0.6677[/C][C]0.0905[/C][/ROW]
[ROW][C]72[/C][C]102[/C][C]102.5295[/C][C]95.6291[/C][C]109.4299[/C][C]0.4402[/C][C]0.0016[/C][C]0.526[/C][C]2e-04[/C][/ROW]
[ROW][C]73[/C][C]106[/C][C]101.3221[/C][C]93.7748[/C][C]108.8695[/C][C]0.1122[/C][C]0.4301[/C][C]0.7268[/C][C]2e-04[/C][/ROW]
[ROW][C]74[/C][C]105.3[/C][C]102.9986[/C][C]95.4461[/C][C]110.5511[/C][C]0.2752[/C][C]0.218[/C][C]0.7246[/C][C]0.0011[/C][/ROW]
[ROW][C]75[/C][C]118.8[/C][C]115.2457[/C][C]107.4652[/C][C]123.0262[/C][C]0.1853[/C][C]0.9939[/C][C]0.4745[/C][C]0.5447[/C][/ROW]
[ROW][C]76[/C][C]106.1[/C][C]104.2221[/C][C]96.2697[/C][C]112.1745[/C][C]0.3217[/C][C]2e-04[/C][C]0.8073[/C][C]0.0046[/C][/ROW]
[ROW][C]77[/C][C]109.3[/C][C]108.4484[/C][C]100.4582[/C][C]116.4385[/C][C]0.4173[/C][C]0.7177[/C][C]0.3609[/C][C]0.0596[/C][/ROW]
[ROW][C]78[/C][C]117.2[/C][C]114.6237[/C][C]106.4957[/C][C]122.7518[/C][C]0.2672[/C][C]0.9004[/C][C]0.5023[/C][C]0.483[/C][/ROW]
[ROW][C]79[/C][C]91.9[/C][C]88.1046[/C][C]79.8971[/C][C]96.3121[/C][C]0.1824[/C][C]0[/C][C]0.7408[/C][C]0[/C][/ROW]
[ROW][C]80[/C][C]103.9[/C][C]100.6598[/C][C]92.3968[/C][C]108.9229[/C][C]0.2211[/C][C]0.9811[/C][C]0.5151[/C][C]4e-04[/C][/ROW]
[ROW][C]81[/C][C]115.9[/C][C]114.8364[/C][C]106.4911[/C][C]123.1818[/C][C]0.4014[/C][C]0.9949[/C][C]0.5034[/C][C]0.5034[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3696&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3696&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[69])
57113.2-------
58105.9-------
59108.8-------
60102.3-------
6199-------
62100.7-------
63115.5-------
64100.7-------
65109.9-------
66114.6-------
6785.4-------
68100.5-------
69114.8-------
70116.5111.5792104.9454118.2130.0730.17060.95330.1706
71112.9110.269103.6294116.90870.21870.03290.66770.0905
72102102.529595.6291109.42990.44020.00160.5262e-04
73106101.322193.7748108.86950.11220.43010.72682e-04
74105.3102.998695.4461110.55110.27520.2180.72460.0011
75118.8115.2457107.4652123.02620.18530.99390.47450.5447
76106.1104.222196.2697112.17450.32172e-040.80730.0046
77109.3108.4484100.4582116.43850.41730.71770.36090.0596
78117.2114.6237106.4957122.75180.26720.90040.50230.483
7991.988.104679.897196.31210.182400.74080
80103.9100.659892.3968108.92290.22110.98110.51514e-04
81115.9114.8364106.4911123.18180.40140.99490.50340.5034







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
700.03030.04410.003724.21422.01791.4205
710.03070.02390.0026.92190.57680.7595
720.0343-0.00524e-040.28040.02340.1528
730.0380.04620.003821.88251.82351.3504
740.03740.02230.00195.29640.44140.6644
750.03440.03080.002612.63331.05281.026
760.03890.0180.00153.52650.29390.5421
770.03760.00797e-040.72530.06040.2458
780.03620.02250.00196.63710.55310.7437
790.04750.04310.003614.40521.20041.0956
800.04190.03220.002710.49860.87490.9354
810.03710.00938e-041.13120.09430.307

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
70 & 0.0303 & 0.0441 & 0.0037 & 24.2142 & 2.0179 & 1.4205 \tabularnewline
71 & 0.0307 & 0.0239 & 0.002 & 6.9219 & 0.5768 & 0.7595 \tabularnewline
72 & 0.0343 & -0.0052 & 4e-04 & 0.2804 & 0.0234 & 0.1528 \tabularnewline
73 & 0.038 & 0.0462 & 0.0038 & 21.8825 & 1.8235 & 1.3504 \tabularnewline
74 & 0.0374 & 0.0223 & 0.0019 & 5.2964 & 0.4414 & 0.6644 \tabularnewline
75 & 0.0344 & 0.0308 & 0.0026 & 12.6333 & 1.0528 & 1.026 \tabularnewline
76 & 0.0389 & 0.018 & 0.0015 & 3.5265 & 0.2939 & 0.5421 \tabularnewline
77 & 0.0376 & 0.0079 & 7e-04 & 0.7253 & 0.0604 & 0.2458 \tabularnewline
78 & 0.0362 & 0.0225 & 0.0019 & 6.6371 & 0.5531 & 0.7437 \tabularnewline
79 & 0.0475 & 0.0431 & 0.0036 & 14.4052 & 1.2004 & 1.0956 \tabularnewline
80 & 0.0419 & 0.0322 & 0.0027 & 10.4986 & 0.8749 & 0.9354 \tabularnewline
81 & 0.0371 & 0.0093 & 8e-04 & 1.1312 & 0.0943 & 0.307 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3696&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]70[/C][C]0.0303[/C][C]0.0441[/C][C]0.0037[/C][C]24.2142[/C][C]2.0179[/C][C]1.4205[/C][/ROW]
[ROW][C]71[/C][C]0.0307[/C][C]0.0239[/C][C]0.002[/C][C]6.9219[/C][C]0.5768[/C][C]0.7595[/C][/ROW]
[ROW][C]72[/C][C]0.0343[/C][C]-0.0052[/C][C]4e-04[/C][C]0.2804[/C][C]0.0234[/C][C]0.1528[/C][/ROW]
[ROW][C]73[/C][C]0.038[/C][C]0.0462[/C][C]0.0038[/C][C]21.8825[/C][C]1.8235[/C][C]1.3504[/C][/ROW]
[ROW][C]74[/C][C]0.0374[/C][C]0.0223[/C][C]0.0019[/C][C]5.2964[/C][C]0.4414[/C][C]0.6644[/C][/ROW]
[ROW][C]75[/C][C]0.0344[/C][C]0.0308[/C][C]0.0026[/C][C]12.6333[/C][C]1.0528[/C][C]1.026[/C][/ROW]
[ROW][C]76[/C][C]0.0389[/C][C]0.018[/C][C]0.0015[/C][C]3.5265[/C][C]0.2939[/C][C]0.5421[/C][/ROW]
[ROW][C]77[/C][C]0.0376[/C][C]0.0079[/C][C]7e-04[/C][C]0.7253[/C][C]0.0604[/C][C]0.2458[/C][/ROW]
[ROW][C]78[/C][C]0.0362[/C][C]0.0225[/C][C]0.0019[/C][C]6.6371[/C][C]0.5531[/C][C]0.7437[/C][/ROW]
[ROW][C]79[/C][C]0.0475[/C][C]0.0431[/C][C]0.0036[/C][C]14.4052[/C][C]1.2004[/C][C]1.0956[/C][/ROW]
[ROW][C]80[/C][C]0.0419[/C][C]0.0322[/C][C]0.0027[/C][C]10.4986[/C][C]0.8749[/C][C]0.9354[/C][/ROW]
[ROW][C]81[/C][C]0.0371[/C][C]0.0093[/C][C]8e-04[/C][C]1.1312[/C][C]0.0943[/C][C]0.307[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3696&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3696&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
700.03030.04410.003724.21422.01791.4205
710.03070.02390.0026.92190.57680.7595
720.0343-0.00524e-040.28040.02340.1528
730.0380.04620.003821.88251.82351.3504
740.03740.02230.00195.29640.44140.6644
750.03440.03080.002612.63331.05281.026
760.03890.0180.00153.52650.29390.5421
770.03760.00797e-040.72530.06040.2458
780.03620.02250.00196.63710.55310.7437
790.04750.04310.003614.40521.20041.0956
800.04190.03220.002710.49860.87490.9354
810.03710.00938e-041.13120.09430.307



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 1 ; 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,fx))
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')