Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 18 Dec 2007 01:16:03 -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/18/t1197964817i1k3u6jea78p0ch.htm/, Retrieved Sat, 04 May 2024 06:38:13 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=4459, Retrieved Sat, 04 May 2024 06:38:13 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordstijdreeks zonder outliers en met lambda=-0.2 ; D=0 en d=1
Estimated Impact228
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima forecasting...] [2007-12-18 08:16:03] [bebbf4ab6ac77d61a56e6916ab0650f9] [Current]
Feedback Forum

Post a new message
Dataseries X:
79.55
84.6
86.9
90.7
91
89.5
92.5
94.1
98.5
96.8
91.2
97.1
104.9
110.9
104.8
94.1
95.8
99.3
101.1
104
99
105.4
107.1
110.7
117.1
118.7
126.5
127.5
134.6
131.8
135.9
142.7
141.7
153.4
145
137.7
148.3
152.2
169.4
168.6
161.1
174.1
179
190.6
190
181.6
174.8
180.5
196.8
193.8
197
216.3
221.4
217.9
229.7
227.4
204.2
196.6
198.8
207.5
190.7
201.6
210.5
223.5
223.8
231.2
234.4




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4459&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[55])
43179-------
44190.6-------
45190-------
46181.6-------
47174.8-------
48180.5-------
49196.8-------
50193.8-------
51197-------
52216.3-------
53221.4-------
54217.9-------
55229.7-------
56227.4231.7201208.1761258.53270.37610.55870.99870.5587
57204.2231.6187199.1867270.59850.0840.5840.98180.5384
58196.6230.1643191.4995278.58550.08710.85340.97530.5075
59198.8228.9351185.2852285.52440.14830.86860.96960.4894
60207.5229.9687181.5997294.65040.2480.82750.93310.5032
61190.7232.7483179.6926305.7560.12950.75110.83270.5326
62201.6232.255175.7531312.01620.22560.84640.82770.525
63210.5232.7809172.8677319.41970.30710.75970.79090.5278
64223.5235.7763171.9213330.31120.39950.69990.65680.5501
65223.8236.5216169.603337.75690.40270.59950.61510.5525
66231.2236.012166.6289343.11280.46490.58840.62990.546
67234.4237.6972165.2493351.79910.47740.54440.55460.5546

\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[55]) \tabularnewline
43 & 179 & - & - & - & - & - & - & - \tabularnewline
44 & 190.6 & - & - & - & - & - & - & - \tabularnewline
45 & 190 & - & - & - & - & - & - & - \tabularnewline
46 & 181.6 & - & - & - & - & - & - & - \tabularnewline
47 & 174.8 & - & - & - & - & - & - & - \tabularnewline
48 & 180.5 & - & - & - & - & - & - & - \tabularnewline
49 & 196.8 & - & - & - & - & - & - & - \tabularnewline
50 & 193.8 & - & - & - & - & - & - & - \tabularnewline
51 & 197 & - & - & - & - & - & - & - \tabularnewline
52 & 216.3 & - & - & - & - & - & - & - \tabularnewline
53 & 221.4 & - & - & - & - & - & - & - \tabularnewline
54 & 217.9 & - & - & - & - & - & - & - \tabularnewline
55 & 229.7 & - & - & - & - & - & - & - \tabularnewline
56 & 227.4 & 231.7201 & 208.1761 & 258.5327 & 0.3761 & 0.5587 & 0.9987 & 0.5587 \tabularnewline
57 & 204.2 & 231.6187 & 199.1867 & 270.5985 & 0.084 & 0.584 & 0.9818 & 0.5384 \tabularnewline
58 & 196.6 & 230.1643 & 191.4995 & 278.5855 & 0.0871 & 0.8534 & 0.9753 & 0.5075 \tabularnewline
59 & 198.8 & 228.9351 & 185.2852 & 285.5244 & 0.1483 & 0.8686 & 0.9696 & 0.4894 \tabularnewline
60 & 207.5 & 229.9687 & 181.5997 & 294.6504 & 0.248 & 0.8275 & 0.9331 & 0.5032 \tabularnewline
61 & 190.7 & 232.7483 & 179.6926 & 305.756 & 0.1295 & 0.7511 & 0.8327 & 0.5326 \tabularnewline
62 & 201.6 & 232.255 & 175.7531 & 312.0162 & 0.2256 & 0.8464 & 0.8277 & 0.525 \tabularnewline
63 & 210.5 & 232.7809 & 172.8677 & 319.4197 & 0.3071 & 0.7597 & 0.7909 & 0.5278 \tabularnewline
64 & 223.5 & 235.7763 & 171.9213 & 330.3112 & 0.3995 & 0.6999 & 0.6568 & 0.5501 \tabularnewline
65 & 223.8 & 236.5216 & 169.603 & 337.7569 & 0.4027 & 0.5995 & 0.6151 & 0.5525 \tabularnewline
66 & 231.2 & 236.012 & 166.6289 & 343.1128 & 0.4649 & 0.5884 & 0.6299 & 0.546 \tabularnewline
67 & 234.4 & 237.6972 & 165.2493 & 351.7991 & 0.4774 & 0.5444 & 0.5546 & 0.5546 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4459&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[55])[/C][/ROW]
[ROW][C]43[/C][C]179[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]190.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]190[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]181.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]174.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]180.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]196.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]193.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]197[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]216.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]221.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]217.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]229.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]227.4[/C][C]231.7201[/C][C]208.1761[/C][C]258.5327[/C][C]0.3761[/C][C]0.5587[/C][C]0.9987[/C][C]0.5587[/C][/ROW]
[ROW][C]57[/C][C]204.2[/C][C]231.6187[/C][C]199.1867[/C][C]270.5985[/C][C]0.084[/C][C]0.584[/C][C]0.9818[/C][C]0.5384[/C][/ROW]
[ROW][C]58[/C][C]196.6[/C][C]230.1643[/C][C]191.4995[/C][C]278.5855[/C][C]0.0871[/C][C]0.8534[/C][C]0.9753[/C][C]0.5075[/C][/ROW]
[ROW][C]59[/C][C]198.8[/C][C]228.9351[/C][C]185.2852[/C][C]285.5244[/C][C]0.1483[/C][C]0.8686[/C][C]0.9696[/C][C]0.4894[/C][/ROW]
[ROW][C]60[/C][C]207.5[/C][C]229.9687[/C][C]181.5997[/C][C]294.6504[/C][C]0.248[/C][C]0.8275[/C][C]0.9331[/C][C]0.5032[/C][/ROW]
[ROW][C]61[/C][C]190.7[/C][C]232.7483[/C][C]179.6926[/C][C]305.756[/C][C]0.1295[/C][C]0.7511[/C][C]0.8327[/C][C]0.5326[/C][/ROW]
[ROW][C]62[/C][C]201.6[/C][C]232.255[/C][C]175.7531[/C][C]312.0162[/C][C]0.2256[/C][C]0.8464[/C][C]0.8277[/C][C]0.525[/C][/ROW]
[ROW][C]63[/C][C]210.5[/C][C]232.7809[/C][C]172.8677[/C][C]319.4197[/C][C]0.3071[/C][C]0.7597[/C][C]0.7909[/C][C]0.5278[/C][/ROW]
[ROW][C]64[/C][C]223.5[/C][C]235.7763[/C][C]171.9213[/C][C]330.3112[/C][C]0.3995[/C][C]0.6999[/C][C]0.6568[/C][C]0.5501[/C][/ROW]
[ROW][C]65[/C][C]223.8[/C][C]236.5216[/C][C]169.603[/C][C]337.7569[/C][C]0.4027[/C][C]0.5995[/C][C]0.6151[/C][C]0.5525[/C][/ROW]
[ROW][C]66[/C][C]231.2[/C][C]236.012[/C][C]166.6289[/C][C]343.1128[/C][C]0.4649[/C][C]0.5884[/C][C]0.6299[/C][C]0.546[/C][/ROW]
[ROW][C]67[/C][C]234.4[/C][C]237.6972[/C][C]165.2493[/C][C]351.7991[/C][C]0.4774[/C][C]0.5444[/C][C]0.5546[/C][C]0.5546[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4459&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4459&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[55])
43179-------
44190.6-------
45190-------
46181.6-------
47174.8-------
48180.5-------
49196.8-------
50193.8-------
51197-------
52216.3-------
53221.4-------
54217.9-------
55229.7-------
56227.4231.7201208.1761258.53270.37610.55870.99870.5587
57204.2231.6187199.1867270.59850.0840.5840.98180.5384
58196.6230.1643191.4995278.58550.08710.85340.97530.5075
59198.8228.9351185.2852285.52440.14830.86860.96960.4894
60207.5229.9687181.5997294.65040.2480.82750.93310.5032
61190.7232.7483179.6926305.7560.12950.75110.83270.5326
62201.6232.255175.7531312.01620.22560.84640.82770.525
63210.5232.7809172.8677319.41970.30710.75970.79090.5278
64223.5235.7763171.9213330.31120.39950.69990.65680.5501
65223.8236.5216169.603337.75690.40270.59950.61510.5525
66231.2236.012166.6289343.11280.46490.58840.62990.546
67234.4237.6972165.2493351.79910.47740.54440.55460.5546







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
560.059-0.01860.001618.66311.55531.2471
570.0859-0.11840.0099751.787662.6497.9151
580.1073-0.14580.01221126.562193.88029.6892
590.1261-0.13160.011908.123175.67698.6992
600.1435-0.09770.0081504.842842.07026.4862
610.16-0.18070.01511768.059147.338312.1383
620.1752-0.1320.011939.730278.31088.8493
630.1899-0.09570.008496.438641.36996.4319
640.2046-0.05210.0043150.70712.55893.5439
650.2184-0.05380.0045161.838613.48663.6724
660.2315-0.02040.001723.15581.92961.3891
670.2449-0.01390.001210.87170.9060.9518

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
56 & 0.059 & -0.0186 & 0.0016 & 18.6631 & 1.5553 & 1.2471 \tabularnewline
57 & 0.0859 & -0.1184 & 0.0099 & 751.7876 & 62.649 & 7.9151 \tabularnewline
58 & 0.1073 & -0.1458 & 0.0122 & 1126.5621 & 93.8802 & 9.6892 \tabularnewline
59 & 0.1261 & -0.1316 & 0.011 & 908.1231 & 75.6769 & 8.6992 \tabularnewline
60 & 0.1435 & -0.0977 & 0.0081 & 504.8428 & 42.0702 & 6.4862 \tabularnewline
61 & 0.16 & -0.1807 & 0.0151 & 1768.059 & 147.3383 & 12.1383 \tabularnewline
62 & 0.1752 & -0.132 & 0.011 & 939.7302 & 78.3108 & 8.8493 \tabularnewline
63 & 0.1899 & -0.0957 & 0.008 & 496.4386 & 41.3699 & 6.4319 \tabularnewline
64 & 0.2046 & -0.0521 & 0.0043 & 150.707 & 12.5589 & 3.5439 \tabularnewline
65 & 0.2184 & -0.0538 & 0.0045 & 161.8386 & 13.4866 & 3.6724 \tabularnewline
66 & 0.2315 & -0.0204 & 0.0017 & 23.1558 & 1.9296 & 1.3891 \tabularnewline
67 & 0.2449 & -0.0139 & 0.0012 & 10.8717 & 0.906 & 0.9518 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4459&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]56[/C][C]0.059[/C][C]-0.0186[/C][C]0.0016[/C][C]18.6631[/C][C]1.5553[/C][C]1.2471[/C][/ROW]
[ROW][C]57[/C][C]0.0859[/C][C]-0.1184[/C][C]0.0099[/C][C]751.7876[/C][C]62.649[/C][C]7.9151[/C][/ROW]
[ROW][C]58[/C][C]0.1073[/C][C]-0.1458[/C][C]0.0122[/C][C]1126.5621[/C][C]93.8802[/C][C]9.6892[/C][/ROW]
[ROW][C]59[/C][C]0.1261[/C][C]-0.1316[/C][C]0.011[/C][C]908.1231[/C][C]75.6769[/C][C]8.6992[/C][/ROW]
[ROW][C]60[/C][C]0.1435[/C][C]-0.0977[/C][C]0.0081[/C][C]504.8428[/C][C]42.0702[/C][C]6.4862[/C][/ROW]
[ROW][C]61[/C][C]0.16[/C][C]-0.1807[/C][C]0.0151[/C][C]1768.059[/C][C]147.3383[/C][C]12.1383[/C][/ROW]
[ROW][C]62[/C][C]0.1752[/C][C]-0.132[/C][C]0.011[/C][C]939.7302[/C][C]78.3108[/C][C]8.8493[/C][/ROW]
[ROW][C]63[/C][C]0.1899[/C][C]-0.0957[/C][C]0.008[/C][C]496.4386[/C][C]41.3699[/C][C]6.4319[/C][/ROW]
[ROW][C]64[/C][C]0.2046[/C][C]-0.0521[/C][C]0.0043[/C][C]150.707[/C][C]12.5589[/C][C]3.5439[/C][/ROW]
[ROW][C]65[/C][C]0.2184[/C][C]-0.0538[/C][C]0.0045[/C][C]161.8386[/C][C]13.4866[/C][C]3.6724[/C][/ROW]
[ROW][C]66[/C][C]0.2315[/C][C]-0.0204[/C][C]0.0017[/C][C]23.1558[/C][C]1.9296[/C][C]1.3891[/C][/ROW]
[ROW][C]67[/C][C]0.2449[/C][C]-0.0139[/C][C]0.0012[/C][C]10.8717[/C][C]0.906[/C][C]0.9518[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4459&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4459&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
560.059-0.01860.001618.66311.55531.2471
570.0859-0.11840.0099751.787662.6497.9151
580.1073-0.14580.01221126.562193.88029.6892
590.1261-0.13160.011908.123175.67698.6992
600.1435-0.09770.0081504.842842.07026.4862
610.16-0.18070.01511768.059147.338312.1383
620.1752-0.1320.011939.730278.31088.8493
630.1899-0.09570.008496.438641.36996.4319
640.2046-0.05210.0043150.70712.55893.5439
650.2184-0.05380.0045161.838613.48663.6724
660.2315-0.02040.001723.15581.92961.3891
670.2449-0.01390.001210.87170.9060.9518



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