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 03:36:58 -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/t1197541303n9dqde933ofs7qq.htm/, Retrieved Sun, 05 May 2024 19:38:23 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3408, Retrieved Sun, 05 May 2024 19:38:23 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsPaper G 29
Estimated Impact211
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Forecast Suiker] [2007-12-13 10:36:58] [7a600ca82a81f1b71fd92dcbb183f5b4] [Current]
Feedback Forum

Post a new message
Dataseries X:
145,9
158,5
152,2
153,7
157,9
154,4
150,7
151,2
147,3
146,6
145,2
139,3
145,7
163,3
181,8
188,1
222,9
206,3
184,9
183,6
186,6
176,5
173,9
184,9
182,5
183,6
172,4
168,9
163,3
152,4
145,8
148,6
143,4
141,2
144,6
144,5
140,8
133,3
127,3
119,6
120,2
121,9
112,4
111
107,8
110,5
118,3
123
112,1
104,2
102,4
100,3
102,6
101,5
103,4
99,4
97,9
98
90,2
87,1
91,8
94,8
91,8
89,3
91,7
86,2
82,8
82,3
79,8
79,4
85,3
87,5
88,3
88,6
94,9
94,7
92,6
91,8
96,4
96,4
107,1
111,9
107,8
109,2
115,3
119,2
107,8
106,8
104,2
94,8
97,5
98,3
100,6
94,9
93,6
98
104,3
103,9
105,3
102,6
103,3
107,9
107,8
109,8
110,6
110,8
119,3
128,1
127,6
137,9
151,4
143,6
143,4
141,9
135,2
133,1
129,6
134,1
136,8
143,5
162,5
163,1
157,2
158,8
155,4
148,5
154,2
153,3
149,4
147,9
156
163
159,1
159,5
157,3
156,4
156,6
162,4
166,8
162,6
168,1




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3408&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 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[129])
117129.6-------
118134.1-------
119136.8-------
120143.5-------
121162.5-------
122163.1-------
123157.2-------
124158.8-------
125155.4-------
126148.5-------
127154.2-------
128153.3-------
129149.4-------
130147.9148.545135.5524162.78310.46460.45320.97660.4532
131156148.545127.9855172.40730.27020.52110.83270.472
132163148.545122.8707179.58410.18070.31890.6250.4785
133159.1148.545118.8284185.69330.28880.22280.23080.482
134159.5148.545115.4255191.16770.30720.31370.25160.4843
135157.3148.545112.4589196.21070.35940.32620.3610.486
136156.4148.545109.8137200.93690.38440.37160.35060.4872
137156.6148.545107.4179205.41860.39070.39330.40660.4882
138162.4148.545105.2224209.70470.32850.39810.50060.4891
139166.8148.545103.1923213.83020.29180.33870.43260.4898
140162.6148.545101.3016217.82110.34540.30280.44650.4904
141168.1148.54599.5305221.69720.30020.35320.49090.4909

\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[129]) \tabularnewline
117 & 129.6 & - & - & - & - & - & - & - \tabularnewline
118 & 134.1 & - & - & - & - & - & - & - \tabularnewline
119 & 136.8 & - & - & - & - & - & - & - \tabularnewline
120 & 143.5 & - & - & - & - & - & - & - \tabularnewline
121 & 162.5 & - & - & - & - & - & - & - \tabularnewline
122 & 163.1 & - & - & - & - & - & - & - \tabularnewline
123 & 157.2 & - & - & - & - & - & - & - \tabularnewline
124 & 158.8 & - & - & - & - & - & - & - \tabularnewline
125 & 155.4 & - & - & - & - & - & - & - \tabularnewline
126 & 148.5 & - & - & - & - & - & - & - \tabularnewline
127 & 154.2 & - & - & - & - & - & - & - \tabularnewline
128 & 153.3 & - & - & - & - & - & - & - \tabularnewline
129 & 149.4 & - & - & - & - & - & - & - \tabularnewline
130 & 147.9 & 148.545 & 135.5524 & 162.7831 & 0.4646 & 0.4532 & 0.9766 & 0.4532 \tabularnewline
131 & 156 & 148.545 & 127.9855 & 172.4073 & 0.2702 & 0.5211 & 0.8327 & 0.472 \tabularnewline
132 & 163 & 148.545 & 122.8707 & 179.5841 & 0.1807 & 0.3189 & 0.625 & 0.4785 \tabularnewline
133 & 159.1 & 148.545 & 118.8284 & 185.6933 & 0.2888 & 0.2228 & 0.2308 & 0.482 \tabularnewline
134 & 159.5 & 148.545 & 115.4255 & 191.1677 & 0.3072 & 0.3137 & 0.2516 & 0.4843 \tabularnewline
135 & 157.3 & 148.545 & 112.4589 & 196.2107 & 0.3594 & 0.3262 & 0.361 & 0.486 \tabularnewline
136 & 156.4 & 148.545 & 109.8137 & 200.9369 & 0.3844 & 0.3716 & 0.3506 & 0.4872 \tabularnewline
137 & 156.6 & 148.545 & 107.4179 & 205.4186 & 0.3907 & 0.3933 & 0.4066 & 0.4882 \tabularnewline
138 & 162.4 & 148.545 & 105.2224 & 209.7047 & 0.3285 & 0.3981 & 0.5006 & 0.4891 \tabularnewline
139 & 166.8 & 148.545 & 103.1923 & 213.8302 & 0.2918 & 0.3387 & 0.4326 & 0.4898 \tabularnewline
140 & 162.6 & 148.545 & 101.3016 & 217.8211 & 0.3454 & 0.3028 & 0.4465 & 0.4904 \tabularnewline
141 & 168.1 & 148.545 & 99.5305 & 221.6972 & 0.3002 & 0.3532 & 0.4909 & 0.4909 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3408&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[129])[/C][/ROW]
[ROW][C]117[/C][C]129.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]134.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]136.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]143.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]162.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]163.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]157.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]158.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]155.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]148.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]154.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]153.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]149.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]147.9[/C][C]148.545[/C][C]135.5524[/C][C]162.7831[/C][C]0.4646[/C][C]0.4532[/C][C]0.9766[/C][C]0.4532[/C][/ROW]
[ROW][C]131[/C][C]156[/C][C]148.545[/C][C]127.9855[/C][C]172.4073[/C][C]0.2702[/C][C]0.5211[/C][C]0.8327[/C][C]0.472[/C][/ROW]
[ROW][C]132[/C][C]163[/C][C]148.545[/C][C]122.8707[/C][C]179.5841[/C][C]0.1807[/C][C]0.3189[/C][C]0.625[/C][C]0.4785[/C][/ROW]
[ROW][C]133[/C][C]159.1[/C][C]148.545[/C][C]118.8284[/C][C]185.6933[/C][C]0.2888[/C][C]0.2228[/C][C]0.2308[/C][C]0.482[/C][/ROW]
[ROW][C]134[/C][C]159.5[/C][C]148.545[/C][C]115.4255[/C][C]191.1677[/C][C]0.3072[/C][C]0.3137[/C][C]0.2516[/C][C]0.4843[/C][/ROW]
[ROW][C]135[/C][C]157.3[/C][C]148.545[/C][C]112.4589[/C][C]196.2107[/C][C]0.3594[/C][C]0.3262[/C][C]0.361[/C][C]0.486[/C][/ROW]
[ROW][C]136[/C][C]156.4[/C][C]148.545[/C][C]109.8137[/C][C]200.9369[/C][C]0.3844[/C][C]0.3716[/C][C]0.3506[/C][C]0.4872[/C][/ROW]
[ROW][C]137[/C][C]156.6[/C][C]148.545[/C][C]107.4179[/C][C]205.4186[/C][C]0.3907[/C][C]0.3933[/C][C]0.4066[/C][C]0.4882[/C][/ROW]
[ROW][C]138[/C][C]162.4[/C][C]148.545[/C][C]105.2224[/C][C]209.7047[/C][C]0.3285[/C][C]0.3981[/C][C]0.5006[/C][C]0.4891[/C][/ROW]
[ROW][C]139[/C][C]166.8[/C][C]148.545[/C][C]103.1923[/C][C]213.8302[/C][C]0.2918[/C][C]0.3387[/C][C]0.4326[/C][C]0.4898[/C][/ROW]
[ROW][C]140[/C][C]162.6[/C][C]148.545[/C][C]101.3016[/C][C]217.8211[/C][C]0.3454[/C][C]0.3028[/C][C]0.4465[/C][C]0.4904[/C][/ROW]
[ROW][C]141[/C][C]168.1[/C][C]148.545[/C][C]99.5305[/C][C]221.6972[/C][C]0.3002[/C][C]0.3532[/C][C]0.4909[/C][C]0.4909[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3408&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3408&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[129])
117129.6-------
118134.1-------
119136.8-------
120143.5-------
121162.5-------
122163.1-------
123157.2-------
124158.8-------
125155.4-------
126148.5-------
127154.2-------
128153.3-------
129149.4-------
130147.9148.545135.5524162.78310.46460.45320.97660.4532
131156148.545127.9855172.40730.27020.52110.83270.472
132163148.545122.8707179.58410.18070.31890.6250.4785
133159.1148.545118.8284185.69330.28880.22280.23080.482
134159.5148.545115.4255191.16770.30720.31370.25160.4843
135157.3148.545112.4589196.21070.35940.32620.3610.486
136156.4148.545109.8137200.93690.38440.37160.35060.4872
137156.6148.545107.4179205.41860.39070.39330.40660.4882
138162.4148.545105.2224209.70470.32850.39810.50060.4891
139166.8148.545103.1923213.83020.29180.33870.43260.4898
140162.6148.545101.3016217.82110.34540.30280.44650.4904
141168.1148.54599.5305221.69720.30020.35320.49090.4909







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1300.0489-0.00434e-040.41610.03470.1862
1310.0820.05020.004255.57634.63142.1521
1320.10660.09730.0081208.945717.41214.1728
1330.12760.07110.0059111.4079.28393.047
1340.14640.07370.0061120.01110.00093.1624
1350.16370.05890.004976.64926.38742.5273
1360.17990.05290.004461.70035.14172.2675
1370.19530.05420.004564.88235.40692.3253
1380.21010.09330.0078191.959715.99663.9996
1390.22420.12290.0102333.243327.77035.2698
1400.23790.09460.0079197.541716.46184.0573
1410.25130.13160.011382.396231.86635.645

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
130 & 0.0489 & -0.0043 & 4e-04 & 0.4161 & 0.0347 & 0.1862 \tabularnewline
131 & 0.082 & 0.0502 & 0.0042 & 55.5763 & 4.6314 & 2.1521 \tabularnewline
132 & 0.1066 & 0.0973 & 0.0081 & 208.9457 & 17.4121 & 4.1728 \tabularnewline
133 & 0.1276 & 0.0711 & 0.0059 & 111.407 & 9.2839 & 3.047 \tabularnewline
134 & 0.1464 & 0.0737 & 0.0061 & 120.011 & 10.0009 & 3.1624 \tabularnewline
135 & 0.1637 & 0.0589 & 0.0049 & 76.6492 & 6.3874 & 2.5273 \tabularnewline
136 & 0.1799 & 0.0529 & 0.0044 & 61.7003 & 5.1417 & 2.2675 \tabularnewline
137 & 0.1953 & 0.0542 & 0.0045 & 64.8823 & 5.4069 & 2.3253 \tabularnewline
138 & 0.2101 & 0.0933 & 0.0078 & 191.9597 & 15.9966 & 3.9996 \tabularnewline
139 & 0.2242 & 0.1229 & 0.0102 & 333.2433 & 27.7703 & 5.2698 \tabularnewline
140 & 0.2379 & 0.0946 & 0.0079 & 197.5417 & 16.4618 & 4.0573 \tabularnewline
141 & 0.2513 & 0.1316 & 0.011 & 382.3962 & 31.8663 & 5.645 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3408&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]130[/C][C]0.0489[/C][C]-0.0043[/C][C]4e-04[/C][C]0.4161[/C][C]0.0347[/C][C]0.1862[/C][/ROW]
[ROW][C]131[/C][C]0.082[/C][C]0.0502[/C][C]0.0042[/C][C]55.5763[/C][C]4.6314[/C][C]2.1521[/C][/ROW]
[ROW][C]132[/C][C]0.1066[/C][C]0.0973[/C][C]0.0081[/C][C]208.9457[/C][C]17.4121[/C][C]4.1728[/C][/ROW]
[ROW][C]133[/C][C]0.1276[/C][C]0.0711[/C][C]0.0059[/C][C]111.407[/C][C]9.2839[/C][C]3.047[/C][/ROW]
[ROW][C]134[/C][C]0.1464[/C][C]0.0737[/C][C]0.0061[/C][C]120.011[/C][C]10.0009[/C][C]3.1624[/C][/ROW]
[ROW][C]135[/C][C]0.1637[/C][C]0.0589[/C][C]0.0049[/C][C]76.6492[/C][C]6.3874[/C][C]2.5273[/C][/ROW]
[ROW][C]136[/C][C]0.1799[/C][C]0.0529[/C][C]0.0044[/C][C]61.7003[/C][C]5.1417[/C][C]2.2675[/C][/ROW]
[ROW][C]137[/C][C]0.1953[/C][C]0.0542[/C][C]0.0045[/C][C]64.8823[/C][C]5.4069[/C][C]2.3253[/C][/ROW]
[ROW][C]138[/C][C]0.2101[/C][C]0.0933[/C][C]0.0078[/C][C]191.9597[/C][C]15.9966[/C][C]3.9996[/C][/ROW]
[ROW][C]139[/C][C]0.2242[/C][C]0.1229[/C][C]0.0102[/C][C]333.2433[/C][C]27.7703[/C][C]5.2698[/C][/ROW]
[ROW][C]140[/C][C]0.2379[/C][C]0.0946[/C][C]0.0079[/C][C]197.5417[/C][C]16.4618[/C][C]4.0573[/C][/ROW]
[ROW][C]141[/C][C]0.2513[/C][C]0.1316[/C][C]0.011[/C][C]382.3962[/C][C]31.8663[/C][C]5.645[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3408&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3408&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
1300.0489-0.00434e-040.41610.03470.1862
1310.0820.05020.004255.57634.63142.1521
1320.10660.09730.0081208.945717.41214.1728
1330.12760.07110.0059111.4079.28393.047
1340.14640.07370.0061120.01110.00093.1624
1350.16370.05890.004976.64926.38742.5273
1360.17990.05290.004461.70035.14172.2675
1370.19530.05420.004564.88235.40692.3253
1380.21010.09330.0078191.959715.99663.9996
1390.22420.12290.0102333.243327.77035.2698
1400.23790.09460.0079197.541716.46184.0573
1410.25130.13160.011382.396231.86635.645



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