Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 13 Dec 2016 13:49:00 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/13/t1481633468m0oflcuwf5atak6.htm/, Retrieved Sun, 05 May 2024 03:08:10 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=299094, Retrieved Sun, 05 May 2024 03:08:10 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact53
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-13 12:49:00] [1bf80170c5e6d32ce8f3ad7977dc404a] [Current]
Feedback Forum

Post a new message
Dataseries X:
1697.22
1782.58
1715.7
1923.82
1712.6
1754.8
1711.6
1916
1842.2
2010
2107.4
2298.2
2222.2
2498.6
2613
2788.8
2873.6
2999.6
2937.6
3068.2
3142.8
3170.4
3265.6
3522.2
3516.8
3798.8
3828.6
4198.8
4097.8
4244.8
4235
4627.8
4446.8
4747.2
4928.8
5202.2




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299094&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=299094&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299094&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







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[24])
203068.2-------
213142.8-------
223170.4-------
233265.6-------
243522.2-------
253516.83608.33423309.16423934.55110.29120.69760.99740.6976
263798.83646.25033226.17854121.01840.26440.70350.97530.6957
273828.63747.61683225.8944353.71770.39670.43430.94050.767
284198.84036.36213394.79254799.17960.33820.70330.90680.9068
294097.84135.073246.17295267.37310.47430.45610.85770.8556
304244.84178.52093110.1685613.85660.46390.54390.6980.8149
3142354294.68473055.91286035.61610.47320.52240.70010.8078
324627.84625.58033163.1846764.06840.49920.63980.65220.8441
334446.84738.69733003.90077475.36430.41720.53170.67690.8082
344747.24788.49112844.71748060.43060.49010.58110.62770.7759
354928.84921.61222759.97178776.27350.49850.53530.63650.7616
365202.25300.81112820.82469961.12940.48350.56220.61140.7728

\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[24]) \tabularnewline
20 & 3068.2 & - & - & - & - & - & - & - \tabularnewline
21 & 3142.8 & - & - & - & - & - & - & - \tabularnewline
22 & 3170.4 & - & - & - & - & - & - & - \tabularnewline
23 & 3265.6 & - & - & - & - & - & - & - \tabularnewline
24 & 3522.2 & - & - & - & - & - & - & - \tabularnewline
25 & 3516.8 & 3608.3342 & 3309.1642 & 3934.5511 & 0.2912 & 0.6976 & 0.9974 & 0.6976 \tabularnewline
26 & 3798.8 & 3646.2503 & 3226.1785 & 4121.0184 & 0.2644 & 0.7035 & 0.9753 & 0.6957 \tabularnewline
27 & 3828.6 & 3747.6168 & 3225.894 & 4353.7177 & 0.3967 & 0.4343 & 0.9405 & 0.767 \tabularnewline
28 & 4198.8 & 4036.3621 & 3394.7925 & 4799.1796 & 0.3382 & 0.7033 & 0.9068 & 0.9068 \tabularnewline
29 & 4097.8 & 4135.07 & 3246.1729 & 5267.3731 & 0.4743 & 0.4561 & 0.8577 & 0.8556 \tabularnewline
30 & 4244.8 & 4178.5209 & 3110.168 & 5613.8566 & 0.4639 & 0.5439 & 0.698 & 0.8149 \tabularnewline
31 & 4235 & 4294.6847 & 3055.9128 & 6035.6161 & 0.4732 & 0.5224 & 0.7001 & 0.8078 \tabularnewline
32 & 4627.8 & 4625.5803 & 3163.184 & 6764.0684 & 0.4992 & 0.6398 & 0.6522 & 0.8441 \tabularnewline
33 & 4446.8 & 4738.6973 & 3003.9007 & 7475.3643 & 0.4172 & 0.5317 & 0.6769 & 0.8082 \tabularnewline
34 & 4747.2 & 4788.4911 & 2844.7174 & 8060.4306 & 0.4901 & 0.5811 & 0.6277 & 0.7759 \tabularnewline
35 & 4928.8 & 4921.6122 & 2759.9717 & 8776.2735 & 0.4985 & 0.5353 & 0.6365 & 0.7616 \tabularnewline
36 & 5202.2 & 5300.8111 & 2820.8246 & 9961.1294 & 0.4835 & 0.5622 & 0.6114 & 0.7728 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299094&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[24])[/C][/ROW]
[ROW][C]20[/C][C]3068.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]21[/C][C]3142.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]22[/C][C]3170.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]23[/C][C]3265.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]24[/C][C]3522.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]25[/C][C]3516.8[/C][C]3608.3342[/C][C]3309.1642[/C][C]3934.5511[/C][C]0.2912[/C][C]0.6976[/C][C]0.9974[/C][C]0.6976[/C][/ROW]
[ROW][C]26[/C][C]3798.8[/C][C]3646.2503[/C][C]3226.1785[/C][C]4121.0184[/C][C]0.2644[/C][C]0.7035[/C][C]0.9753[/C][C]0.6957[/C][/ROW]
[ROW][C]27[/C][C]3828.6[/C][C]3747.6168[/C][C]3225.894[/C][C]4353.7177[/C][C]0.3967[/C][C]0.4343[/C][C]0.9405[/C][C]0.767[/C][/ROW]
[ROW][C]28[/C][C]4198.8[/C][C]4036.3621[/C][C]3394.7925[/C][C]4799.1796[/C][C]0.3382[/C][C]0.7033[/C][C]0.9068[/C][C]0.9068[/C][/ROW]
[ROW][C]29[/C][C]4097.8[/C][C]4135.07[/C][C]3246.1729[/C][C]5267.3731[/C][C]0.4743[/C][C]0.4561[/C][C]0.8577[/C][C]0.8556[/C][/ROW]
[ROW][C]30[/C][C]4244.8[/C][C]4178.5209[/C][C]3110.168[/C][C]5613.8566[/C][C]0.4639[/C][C]0.5439[/C][C]0.698[/C][C]0.8149[/C][/ROW]
[ROW][C]31[/C][C]4235[/C][C]4294.6847[/C][C]3055.9128[/C][C]6035.6161[/C][C]0.4732[/C][C]0.5224[/C][C]0.7001[/C][C]0.8078[/C][/ROW]
[ROW][C]32[/C][C]4627.8[/C][C]4625.5803[/C][C]3163.184[/C][C]6764.0684[/C][C]0.4992[/C][C]0.6398[/C][C]0.6522[/C][C]0.8441[/C][/ROW]
[ROW][C]33[/C][C]4446.8[/C][C]4738.6973[/C][C]3003.9007[/C][C]7475.3643[/C][C]0.4172[/C][C]0.5317[/C][C]0.6769[/C][C]0.8082[/C][/ROW]
[ROW][C]34[/C][C]4747.2[/C][C]4788.4911[/C][C]2844.7174[/C][C]8060.4306[/C][C]0.4901[/C][C]0.5811[/C][C]0.6277[/C][C]0.7759[/C][/ROW]
[ROW][C]35[/C][C]4928.8[/C][C]4921.6122[/C][C]2759.9717[/C][C]8776.2735[/C][C]0.4985[/C][C]0.5353[/C][C]0.6365[/C][C]0.7616[/C][/ROW]
[ROW][C]36[/C][C]5202.2[/C][C]5300.8111[/C][C]2820.8246[/C][C]9961.1294[/C][C]0.4835[/C][C]0.5622[/C][C]0.6114[/C][C]0.7728[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299094&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299094&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[24])
203068.2-------
213142.8-------
223170.4-------
233265.6-------
243522.2-------
253516.83608.33423309.16423934.55110.29120.69760.99740.6976
263798.83646.25033226.17854121.01840.26440.70350.97530.6957
273828.63747.61683225.8944353.71770.39670.43430.94050.767
284198.84036.36213394.79254799.17960.33820.70330.90680.9068
294097.84135.073246.17295267.37310.47430.45610.85770.8556
304244.84178.52093110.1685613.85660.46390.54390.6980.8149
3142354294.68473055.91286035.61610.47320.52240.70010.8078
324627.84625.58033163.1846764.06840.49920.63980.65220.8441
334446.84738.69733003.90077475.36430.41720.53170.67690.8082
344747.24788.49112844.71748060.43060.49010.58110.62770.7759
354928.84921.61222759.97178776.27350.49850.53530.63650.7616
365202.25300.81112820.82469961.12940.48350.56220.61140.7728







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
250.0461-0.0260.0260.02578378.510900-0.44380.4438
260.06640.04020.03310.033323271.423615824.9672125.79730.73960.5917
270.08250.02120.02910.02946558.277212736.0706112.85420.39260.5253
280.09640.03870.03150.031926386.073916148.5714127.0770.78750.5909
290.1397-0.00910.0270.02731389.049813196.6671114.8767-0.18070.5088
300.17530.01560.02510.02544392.918811729.3757108.30220.32130.4776
310.2068-0.01410.02350.02383562.262510562.6452102.7747-0.28930.4507
320.23595e-040.02070.02084.92719242.930596.14020.01080.3957
330.2947-0.06560.02570.025685204.033417683.053132.9776-1.41510.509
340.3486-0.00870.0240.02391704.955416085.2432126.8276-0.20020.4781
350.39960.00150.02190.021951.664514627.6452120.94480.03480.4378
360.4486-0.0190.02170.02169724.156314219.0211119.2435-0.47810.4411

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
25 & 0.0461 & -0.026 & 0.026 & 0.0257 & 8378.5109 & 0 & 0 & -0.4438 & 0.4438 \tabularnewline
26 & 0.0664 & 0.0402 & 0.0331 & 0.0333 & 23271.4236 & 15824.9672 & 125.7973 & 0.7396 & 0.5917 \tabularnewline
27 & 0.0825 & 0.0212 & 0.0291 & 0.0294 & 6558.2772 & 12736.0706 & 112.8542 & 0.3926 & 0.5253 \tabularnewline
28 & 0.0964 & 0.0387 & 0.0315 & 0.0319 & 26386.0739 & 16148.5714 & 127.077 & 0.7875 & 0.5909 \tabularnewline
29 & 0.1397 & -0.0091 & 0.027 & 0.0273 & 1389.0498 & 13196.6671 & 114.8767 & -0.1807 & 0.5088 \tabularnewline
30 & 0.1753 & 0.0156 & 0.0251 & 0.0254 & 4392.9188 & 11729.3757 & 108.3022 & 0.3213 & 0.4776 \tabularnewline
31 & 0.2068 & -0.0141 & 0.0235 & 0.0238 & 3562.2625 & 10562.6452 & 102.7747 & -0.2893 & 0.4507 \tabularnewline
32 & 0.2359 & 5e-04 & 0.0207 & 0.0208 & 4.9271 & 9242.9305 & 96.1402 & 0.0108 & 0.3957 \tabularnewline
33 & 0.2947 & -0.0656 & 0.0257 & 0.0256 & 85204.0334 & 17683.053 & 132.9776 & -1.4151 & 0.509 \tabularnewline
34 & 0.3486 & -0.0087 & 0.024 & 0.0239 & 1704.9554 & 16085.2432 & 126.8276 & -0.2002 & 0.4781 \tabularnewline
35 & 0.3996 & 0.0015 & 0.0219 & 0.0219 & 51.6645 & 14627.6452 & 120.9448 & 0.0348 & 0.4378 \tabularnewline
36 & 0.4486 & -0.019 & 0.0217 & 0.0216 & 9724.1563 & 14219.0211 & 119.2435 & -0.4781 & 0.4411 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299094&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]25[/C][C]0.0461[/C][C]-0.026[/C][C]0.026[/C][C]0.0257[/C][C]8378.5109[/C][C]0[/C][C]0[/C][C]-0.4438[/C][C]0.4438[/C][/ROW]
[ROW][C]26[/C][C]0.0664[/C][C]0.0402[/C][C]0.0331[/C][C]0.0333[/C][C]23271.4236[/C][C]15824.9672[/C][C]125.7973[/C][C]0.7396[/C][C]0.5917[/C][/ROW]
[ROW][C]27[/C][C]0.0825[/C][C]0.0212[/C][C]0.0291[/C][C]0.0294[/C][C]6558.2772[/C][C]12736.0706[/C][C]112.8542[/C][C]0.3926[/C][C]0.5253[/C][/ROW]
[ROW][C]28[/C][C]0.0964[/C][C]0.0387[/C][C]0.0315[/C][C]0.0319[/C][C]26386.0739[/C][C]16148.5714[/C][C]127.077[/C][C]0.7875[/C][C]0.5909[/C][/ROW]
[ROW][C]29[/C][C]0.1397[/C][C]-0.0091[/C][C]0.027[/C][C]0.0273[/C][C]1389.0498[/C][C]13196.6671[/C][C]114.8767[/C][C]-0.1807[/C][C]0.5088[/C][/ROW]
[ROW][C]30[/C][C]0.1753[/C][C]0.0156[/C][C]0.0251[/C][C]0.0254[/C][C]4392.9188[/C][C]11729.3757[/C][C]108.3022[/C][C]0.3213[/C][C]0.4776[/C][/ROW]
[ROW][C]31[/C][C]0.2068[/C][C]-0.0141[/C][C]0.0235[/C][C]0.0238[/C][C]3562.2625[/C][C]10562.6452[/C][C]102.7747[/C][C]-0.2893[/C][C]0.4507[/C][/ROW]
[ROW][C]32[/C][C]0.2359[/C][C]5e-04[/C][C]0.0207[/C][C]0.0208[/C][C]4.9271[/C][C]9242.9305[/C][C]96.1402[/C][C]0.0108[/C][C]0.3957[/C][/ROW]
[ROW][C]33[/C][C]0.2947[/C][C]-0.0656[/C][C]0.0257[/C][C]0.0256[/C][C]85204.0334[/C][C]17683.053[/C][C]132.9776[/C][C]-1.4151[/C][C]0.509[/C][/ROW]
[ROW][C]34[/C][C]0.3486[/C][C]-0.0087[/C][C]0.024[/C][C]0.0239[/C][C]1704.9554[/C][C]16085.2432[/C][C]126.8276[/C][C]-0.2002[/C][C]0.4781[/C][/ROW]
[ROW][C]35[/C][C]0.3996[/C][C]0.0015[/C][C]0.0219[/C][C]0.0219[/C][C]51.6645[/C][C]14627.6452[/C][C]120.9448[/C][C]0.0348[/C][C]0.4378[/C][/ROW]
[ROW][C]36[/C][C]0.4486[/C][C]-0.019[/C][C]0.0217[/C][C]0.0216[/C][C]9724.1563[/C][C]14219.0211[/C][C]119.2435[/C][C]-0.4781[/C][C]0.4411[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299094&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299094&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
250.0461-0.0260.0260.02578378.510900-0.44380.4438
260.06640.04020.03310.033323271.423615824.9672125.79730.73960.5917
270.08250.02120.02910.02946558.277212736.0706112.85420.39260.5253
280.09640.03870.03150.031926386.073916148.5714127.0770.78750.5909
290.1397-0.00910.0270.02731389.049813196.6671114.8767-0.18070.5088
300.17530.01560.02510.02544392.918811729.3757108.30220.32130.4776
310.2068-0.01410.02350.02383562.262510562.6452102.7747-0.28930.4507
320.23595e-040.02070.02084.92719242.930596.14020.01080.3957
330.2947-0.06560.02570.025685204.033417683.053132.9776-1.41510.509
340.3486-0.00870.0240.02391704.955416085.2432126.8276-0.20020.4781
350.39960.00150.02190.021951.664514627.6452120.94480.03480.4378
360.4486-0.0190.02170.02169724.156314219.0211119.2435-0.47810.4411



Parameters (Session):
par1 = 1 ; par2 = 1 ; par3 = 1 ; par4 = 1 ;
Parameters (R input):
par1 = 12 ; par2 = 0.0 ; par3 = 1 ; par4 = 1 ; par5 = 4 ; par6 = 0 ; par7 = 0 ; 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*2
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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')