Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 19 Dec 2007 12:46:49 -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/19/t1198092565ztsc8ov9kkczr1o.htm/, Retrieved Mon, 06 May 2024 16:20:12 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=4700, Retrieved Mon, 06 May 2024 16:20:12 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact186
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [pap 8] [2007-12-19 19:46:49] [6bae8369195607c4cbc8a8485fed7b2f] [Current]
Feedback Forum

Post a new message
Dataseries X:
106,7
110,2
125,9
100,1
106,4
114,8
81,3
87
104,2
108
105
94,5
92
95,9
108,8
103,4
102,1
110,1
83,2
82,7
106,8
113,7
102,5
96,6
92,1
95,6
102,3
98,6
98,2
104,5
84
73,8
103,9
106
97,2
102,6
89
93,8
116,7
106,8
98,5
118,7
90
91,9
113,3
113,1
104,1
108,7
96,7
101
116,9
105,8
99
129,4
83
88,9
115,9
104,2
113,4
112,2
100,8
107,3
126,6
102,9
117,9
128,8
87,5
93,8
122,7
126,2
124,6
116,7
115,2
111,1
129,9
113,3
118,5
133,5
102,1
102,4




Summary of compuational 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 compuational 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=4700&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]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=4700&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4700&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 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[68])
5688.9-------
57115.9-------
58104.2-------
59113.4-------
60112.2-------
61100.8-------
62107.3-------
63126.6-------
64102.9-------
65117.9-------
66128.8-------
6787.5-------
6893.8-------
69122.7118.1292104.0228138.96840.33360.98890.5830.9889
70126.2120.2821105.2947142.89410.3040.4170.91830.9891
71124.6116.648102.0285138.77110.24060.19870.61320.9785
72116.7110.203796.1124131.75270.27730.09520.4280.9322
73115.2101.767390.0819118.71740.06020.04210.54450.8215
74111.1106.678393.0613127.48270.33850.2110.47660.8875
75129.9123.3379103.5548158.34940.35670.75340.42750.9509
76113.3109.37394.3124133.38810.37430.04690.70140.8981
77118.5109.072993.7958133.68650.22640.36820.24110.888
78133.5124.7814103.5434164.24880.33250.62250.42090.938
79102.188.066478.769101.07870.017300.5340.1939
80102.488.836779.2306102.41260.02510.02780.23680.2368

\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[68]) \tabularnewline
56 & 88.9 & - & - & - & - & - & - & - \tabularnewline
57 & 115.9 & - & - & - & - & - & - & - \tabularnewline
58 & 104.2 & - & - & - & - & - & - & - \tabularnewline
59 & 113.4 & - & - & - & - & - & - & - \tabularnewline
60 & 112.2 & - & - & - & - & - & - & - \tabularnewline
61 & 100.8 & - & - & - & - & - & - & - \tabularnewline
62 & 107.3 & - & - & - & - & - & - & - \tabularnewline
63 & 126.6 & - & - & - & - & - & - & - \tabularnewline
64 & 102.9 & - & - & - & - & - & - & - \tabularnewline
65 & 117.9 & - & - & - & - & - & - & - \tabularnewline
66 & 128.8 & - & - & - & - & - & - & - \tabularnewline
67 & 87.5 & - & - & - & - & - & - & - \tabularnewline
68 & 93.8 & - & - & - & - & - & - & - \tabularnewline
69 & 122.7 & 118.1292 & 104.0228 & 138.9684 & 0.3336 & 0.9889 & 0.583 & 0.9889 \tabularnewline
70 & 126.2 & 120.2821 & 105.2947 & 142.8941 & 0.304 & 0.417 & 0.9183 & 0.9891 \tabularnewline
71 & 124.6 & 116.648 & 102.0285 & 138.7711 & 0.2406 & 0.1987 & 0.6132 & 0.9785 \tabularnewline
72 & 116.7 & 110.2037 & 96.1124 & 131.7527 & 0.2773 & 0.0952 & 0.428 & 0.9322 \tabularnewline
73 & 115.2 & 101.7673 & 90.0819 & 118.7174 & 0.0602 & 0.0421 & 0.5445 & 0.8215 \tabularnewline
74 & 111.1 & 106.6783 & 93.0613 & 127.4827 & 0.3385 & 0.211 & 0.4766 & 0.8875 \tabularnewline
75 & 129.9 & 123.3379 & 103.5548 & 158.3494 & 0.3567 & 0.7534 & 0.4275 & 0.9509 \tabularnewline
76 & 113.3 & 109.373 & 94.3124 & 133.3881 & 0.3743 & 0.0469 & 0.7014 & 0.8981 \tabularnewline
77 & 118.5 & 109.0729 & 93.7958 & 133.6865 & 0.2264 & 0.3682 & 0.2411 & 0.888 \tabularnewline
78 & 133.5 & 124.7814 & 103.5434 & 164.2488 & 0.3325 & 0.6225 & 0.4209 & 0.938 \tabularnewline
79 & 102.1 & 88.0664 & 78.769 & 101.0787 & 0.0173 & 0 & 0.534 & 0.1939 \tabularnewline
80 & 102.4 & 88.8367 & 79.2306 & 102.4126 & 0.0251 & 0.0278 & 0.2368 & 0.2368 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4700&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[68])[/C][/ROW]
[ROW][C]56[/C][C]88.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]115.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]104.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]113.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]112.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]100.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]107.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]126.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]102.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]117.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]128.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]87.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]93.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]122.7[/C][C]118.1292[/C][C]104.0228[/C][C]138.9684[/C][C]0.3336[/C][C]0.9889[/C][C]0.583[/C][C]0.9889[/C][/ROW]
[ROW][C]70[/C][C]126.2[/C][C]120.2821[/C][C]105.2947[/C][C]142.8941[/C][C]0.304[/C][C]0.417[/C][C]0.9183[/C][C]0.9891[/C][/ROW]
[ROW][C]71[/C][C]124.6[/C][C]116.648[/C][C]102.0285[/C][C]138.7711[/C][C]0.2406[/C][C]0.1987[/C][C]0.6132[/C][C]0.9785[/C][/ROW]
[ROW][C]72[/C][C]116.7[/C][C]110.2037[/C][C]96.1124[/C][C]131.7527[/C][C]0.2773[/C][C]0.0952[/C][C]0.428[/C][C]0.9322[/C][/ROW]
[ROW][C]73[/C][C]115.2[/C][C]101.7673[/C][C]90.0819[/C][C]118.7174[/C][C]0.0602[/C][C]0.0421[/C][C]0.5445[/C][C]0.8215[/C][/ROW]
[ROW][C]74[/C][C]111.1[/C][C]106.6783[/C][C]93.0613[/C][C]127.4827[/C][C]0.3385[/C][C]0.211[/C][C]0.4766[/C][C]0.8875[/C][/ROW]
[ROW][C]75[/C][C]129.9[/C][C]123.3379[/C][C]103.5548[/C][C]158.3494[/C][C]0.3567[/C][C]0.7534[/C][C]0.4275[/C][C]0.9509[/C][/ROW]
[ROW][C]76[/C][C]113.3[/C][C]109.373[/C][C]94.3124[/C][C]133.3881[/C][C]0.3743[/C][C]0.0469[/C][C]0.7014[/C][C]0.8981[/C][/ROW]
[ROW][C]77[/C][C]118.5[/C][C]109.0729[/C][C]93.7958[/C][C]133.6865[/C][C]0.2264[/C][C]0.3682[/C][C]0.2411[/C][C]0.888[/C][/ROW]
[ROW][C]78[/C][C]133.5[/C][C]124.7814[/C][C]103.5434[/C][C]164.2488[/C][C]0.3325[/C][C]0.6225[/C][C]0.4209[/C][C]0.938[/C][/ROW]
[ROW][C]79[/C][C]102.1[/C][C]88.0664[/C][C]78.769[/C][C]101.0787[/C][C]0.0173[/C][C]0[/C][C]0.534[/C][C]0.1939[/C][/ROW]
[ROW][C]80[/C][C]102.4[/C][C]88.8367[/C][C]79.2306[/C][C]102.4126[/C][C]0.0251[/C][C]0.0278[/C][C]0.2368[/C][C]0.2368[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4700&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4700&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[68])
5688.9-------
57115.9-------
58104.2-------
59113.4-------
60112.2-------
61100.8-------
62107.3-------
63126.6-------
64102.9-------
65117.9-------
66128.8-------
6787.5-------
6893.8-------
69122.7118.1292104.0228138.96840.33360.98890.5830.9889
70126.2120.2821105.2947142.89410.3040.4170.91830.9891
71124.6116.648102.0285138.77110.24060.19870.61320.9785
72116.7110.203796.1124131.75270.27730.09520.4280.9322
73115.2101.767390.0819118.71740.06020.04210.54450.8215
74111.1106.678393.0613127.48270.33850.2110.47660.8875
75129.9123.3379103.5548158.34940.35670.75340.42750.9509
76113.3109.37394.3124133.38810.37430.04690.70140.8981
77118.5109.072993.7958133.68650.22640.36820.24110.888
78133.5124.7814103.5434164.24880.33250.62250.42090.938
79102.188.066478.769101.07870.017300.5340.1939
80102.488.836779.2306102.41260.02510.02780.23680.2368







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
690.090.03870.003220.89231.7411.3195
700.09590.04920.004135.02142.91851.7083
710.09680.06820.005763.23375.26952.2955
720.09980.05890.004942.20163.51681.8753
730.0850.1320.011180.438515.03653.8777
740.09950.04140.003519.55131.62931.2764
750.14480.05320.004443.06073.58841.8943
760.1120.03590.00315.42141.28511.1336
770.11510.08640.007288.877.40582.7214
780.16140.06990.005876.01396.33452.5168
790.07540.15940.0133196.941216.41184.0511
800.0780.15270.0127183.964315.33043.9154

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
69 & 0.09 & 0.0387 & 0.0032 & 20.8923 & 1.741 & 1.3195 \tabularnewline
70 & 0.0959 & 0.0492 & 0.0041 & 35.0214 & 2.9185 & 1.7083 \tabularnewline
71 & 0.0968 & 0.0682 & 0.0057 & 63.2337 & 5.2695 & 2.2955 \tabularnewline
72 & 0.0998 & 0.0589 & 0.0049 & 42.2016 & 3.5168 & 1.8753 \tabularnewline
73 & 0.085 & 0.132 & 0.011 & 180.4385 & 15.0365 & 3.8777 \tabularnewline
74 & 0.0995 & 0.0414 & 0.0035 & 19.5513 & 1.6293 & 1.2764 \tabularnewline
75 & 0.1448 & 0.0532 & 0.0044 & 43.0607 & 3.5884 & 1.8943 \tabularnewline
76 & 0.112 & 0.0359 & 0.003 & 15.4214 & 1.2851 & 1.1336 \tabularnewline
77 & 0.1151 & 0.0864 & 0.0072 & 88.87 & 7.4058 & 2.7214 \tabularnewline
78 & 0.1614 & 0.0699 & 0.0058 & 76.0139 & 6.3345 & 2.5168 \tabularnewline
79 & 0.0754 & 0.1594 & 0.0133 & 196.9412 & 16.4118 & 4.0511 \tabularnewline
80 & 0.078 & 0.1527 & 0.0127 & 183.9643 & 15.3304 & 3.9154 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4700&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]69[/C][C]0.09[/C][C]0.0387[/C][C]0.0032[/C][C]20.8923[/C][C]1.741[/C][C]1.3195[/C][/ROW]
[ROW][C]70[/C][C]0.0959[/C][C]0.0492[/C][C]0.0041[/C][C]35.0214[/C][C]2.9185[/C][C]1.7083[/C][/ROW]
[ROW][C]71[/C][C]0.0968[/C][C]0.0682[/C][C]0.0057[/C][C]63.2337[/C][C]5.2695[/C][C]2.2955[/C][/ROW]
[ROW][C]72[/C][C]0.0998[/C][C]0.0589[/C][C]0.0049[/C][C]42.2016[/C][C]3.5168[/C][C]1.8753[/C][/ROW]
[ROW][C]73[/C][C]0.085[/C][C]0.132[/C][C]0.011[/C][C]180.4385[/C][C]15.0365[/C][C]3.8777[/C][/ROW]
[ROW][C]74[/C][C]0.0995[/C][C]0.0414[/C][C]0.0035[/C][C]19.5513[/C][C]1.6293[/C][C]1.2764[/C][/ROW]
[ROW][C]75[/C][C]0.1448[/C][C]0.0532[/C][C]0.0044[/C][C]43.0607[/C][C]3.5884[/C][C]1.8943[/C][/ROW]
[ROW][C]76[/C][C]0.112[/C][C]0.0359[/C][C]0.003[/C][C]15.4214[/C][C]1.2851[/C][C]1.1336[/C][/ROW]
[ROW][C]77[/C][C]0.1151[/C][C]0.0864[/C][C]0.0072[/C][C]88.87[/C][C]7.4058[/C][C]2.7214[/C][/ROW]
[ROW][C]78[/C][C]0.1614[/C][C]0.0699[/C][C]0.0058[/C][C]76.0139[/C][C]6.3345[/C][C]2.5168[/C][/ROW]
[ROW][C]79[/C][C]0.0754[/C][C]0.1594[/C][C]0.0133[/C][C]196.9412[/C][C]16.4118[/C][C]4.0511[/C][/ROW]
[ROW][C]80[/C][C]0.078[/C][C]0.1527[/C][C]0.0127[/C][C]183.9643[/C][C]15.3304[/C][C]3.9154[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4700&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4700&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
690.090.03870.003220.89231.7411.3195
700.09590.04920.004135.02142.91851.7083
710.09680.06820.005763.23375.26952.2955
720.09980.05890.004942.20163.51681.8753
730.0850.1320.011180.438515.03653.8777
740.09950.04140.003519.55131.62931.2764
750.14480.05320.004443.06073.58841.8943
760.1120.03590.00315.42141.28511.1336
770.11510.08640.007288.877.40582.7214
780.16140.06990.005876.01396.33452.5168
790.07540.15940.0133196.941216.41184.0511
800.0780.15270.0127183.964315.33043.9154



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