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, 20 Dec 2016 21:28:46 +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/20/t1482265798w7ogozbtx9vn32o.htm/, Retrieved Fri, 01 Nov 2024 03:30:25 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301801, Retrieved Fri, 01 Nov 2024 03:30:25 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact84
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-20 20:28:46] [672675941468e072e71d9fb024f2b817] [Current]
Feedback Forum

Post a new message
Dataseries X:
1932.8
1861.4
2170.2
1999.6
2225.5
2195.7
2713.1
2412
2568.3
2623.7
3185.5
2722.6
3046.3
2854.2
3337.6
2920.3
3058.3
2933.7
3773.4
3193.5
3472.2
3345.5
4028.4
3463.1
3675.4
3500.8
4142.1
3598
3765.3
3557.7
4303.6
3620.1
3691.1
3678.1
4505.8
3695
3894.1
3718.9
4749.8
3855.9
4011.7
3907.6
4812.5
4071.3
4163.4
4077.6
5109.2
4207.6
4320.8
4396.9
5358.8




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301801&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[39])
354505.8-------
363695-------
373894.1-------
383718.9-------
394749.8-------
403855.93894.21953692.22634096.21270.35500.97340
414011.74051.04633826.9044275.18870.36540.9560.9150
423907.63917.37193651.48174183.2620.47130.24340.92830
434812.54882.44874594.13635170.76110.317210.81640.8164
444071.34034.43823672.41934396.45710.420900.83311e-04
454163.44111.64463712.34214510.9470.39970.57850.68819e-04
464077.64062.85583624.98854500.72310.47370.32630.75650.0011
475109.25062.65484594.71615530.59340.422710.85260.905
484207.64170.01553628.89174711.13930.44593e-040.63970.0179
494320.84252.37323666.74564838.00090.40940.55960.61710.048
504396.94185.28613556.59284813.97950.25470.33630.63150.0392
515358.85253.71134589.11765918.3050.37830.99420.6650.9314

\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[39]) \tabularnewline
35 & 4505.8 & - & - & - & - & - & - & - \tabularnewline
36 & 3695 & - & - & - & - & - & - & - \tabularnewline
37 & 3894.1 & - & - & - & - & - & - & - \tabularnewline
38 & 3718.9 & - & - & - & - & - & - & - \tabularnewline
39 & 4749.8 & - & - & - & - & - & - & - \tabularnewline
40 & 3855.9 & 3894.2195 & 3692.2263 & 4096.2127 & 0.355 & 0 & 0.9734 & 0 \tabularnewline
41 & 4011.7 & 4051.0463 & 3826.904 & 4275.1887 & 0.3654 & 0.956 & 0.915 & 0 \tabularnewline
42 & 3907.6 & 3917.3719 & 3651.4817 & 4183.262 & 0.4713 & 0.2434 & 0.9283 & 0 \tabularnewline
43 & 4812.5 & 4882.4487 & 4594.1363 & 5170.7611 & 0.3172 & 1 & 0.8164 & 0.8164 \tabularnewline
44 & 4071.3 & 4034.4382 & 3672.4193 & 4396.4571 & 0.4209 & 0 & 0.8331 & 1e-04 \tabularnewline
45 & 4163.4 & 4111.6446 & 3712.3421 & 4510.947 & 0.3997 & 0.5785 & 0.6881 & 9e-04 \tabularnewline
46 & 4077.6 & 4062.8558 & 3624.9885 & 4500.7231 & 0.4737 & 0.3263 & 0.7565 & 0.0011 \tabularnewline
47 & 5109.2 & 5062.6548 & 4594.7161 & 5530.5934 & 0.4227 & 1 & 0.8526 & 0.905 \tabularnewline
48 & 4207.6 & 4170.0155 & 3628.8917 & 4711.1393 & 0.4459 & 3e-04 & 0.6397 & 0.0179 \tabularnewline
49 & 4320.8 & 4252.3732 & 3666.7456 & 4838.0009 & 0.4094 & 0.5596 & 0.6171 & 0.048 \tabularnewline
50 & 4396.9 & 4185.2861 & 3556.5928 & 4813.9795 & 0.2547 & 0.3363 & 0.6315 & 0.0392 \tabularnewline
51 & 5358.8 & 5253.7113 & 4589.1176 & 5918.305 & 0.3783 & 0.9942 & 0.665 & 0.9314 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301801&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[39])[/C][/ROW]
[ROW][C]35[/C][C]4505.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]3695[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]3894.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]3718.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]4749.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]3855.9[/C][C]3894.2195[/C][C]3692.2263[/C][C]4096.2127[/C][C]0.355[/C][C]0[/C][C]0.9734[/C][C]0[/C][/ROW]
[ROW][C]41[/C][C]4011.7[/C][C]4051.0463[/C][C]3826.904[/C][C]4275.1887[/C][C]0.3654[/C][C]0.956[/C][C]0.915[/C][C]0[/C][/ROW]
[ROW][C]42[/C][C]3907.6[/C][C]3917.3719[/C][C]3651.4817[/C][C]4183.262[/C][C]0.4713[/C][C]0.2434[/C][C]0.9283[/C][C]0[/C][/ROW]
[ROW][C]43[/C][C]4812.5[/C][C]4882.4487[/C][C]4594.1363[/C][C]5170.7611[/C][C]0.3172[/C][C]1[/C][C]0.8164[/C][C]0.8164[/C][/ROW]
[ROW][C]44[/C][C]4071.3[/C][C]4034.4382[/C][C]3672.4193[/C][C]4396.4571[/C][C]0.4209[/C][C]0[/C][C]0.8331[/C][C]1e-04[/C][/ROW]
[ROW][C]45[/C][C]4163.4[/C][C]4111.6446[/C][C]3712.3421[/C][C]4510.947[/C][C]0.3997[/C][C]0.5785[/C][C]0.6881[/C][C]9e-04[/C][/ROW]
[ROW][C]46[/C][C]4077.6[/C][C]4062.8558[/C][C]3624.9885[/C][C]4500.7231[/C][C]0.4737[/C][C]0.3263[/C][C]0.7565[/C][C]0.0011[/C][/ROW]
[ROW][C]47[/C][C]5109.2[/C][C]5062.6548[/C][C]4594.7161[/C][C]5530.5934[/C][C]0.4227[/C][C]1[/C][C]0.8526[/C][C]0.905[/C][/ROW]
[ROW][C]48[/C][C]4207.6[/C][C]4170.0155[/C][C]3628.8917[/C][C]4711.1393[/C][C]0.4459[/C][C]3e-04[/C][C]0.6397[/C][C]0.0179[/C][/ROW]
[ROW][C]49[/C][C]4320.8[/C][C]4252.3732[/C][C]3666.7456[/C][C]4838.0009[/C][C]0.4094[/C][C]0.5596[/C][C]0.6171[/C][C]0.048[/C][/ROW]
[ROW][C]50[/C][C]4396.9[/C][C]4185.2861[/C][C]3556.5928[/C][C]4813.9795[/C][C]0.2547[/C][C]0.3363[/C][C]0.6315[/C][C]0.0392[/C][/ROW]
[ROW][C]51[/C][C]5358.8[/C][C]5253.7113[/C][C]4589.1176[/C][C]5918.305[/C][C]0.3783[/C][C]0.9942[/C][C]0.665[/C][C]0.9314[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301801&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301801&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[39])
354505.8-------
363695-------
373894.1-------
383718.9-------
394749.8-------
403855.93894.21953692.22634096.21270.35500.97340
414011.74051.04633826.9044275.18870.36540.9560.9150
423907.63917.37193651.48174183.2620.47130.24340.92830
434812.54882.44874594.13635170.76110.317210.81640.8164
444071.34034.43823672.41934396.45710.420900.83311e-04
454163.44111.64463712.34214510.9470.39970.57850.68819e-04
464077.64062.85583624.98854500.72310.47370.32630.75650.0011
475109.25062.65484594.71615530.59340.422710.85260.905
484207.64170.01553628.89174711.13930.44593e-040.63970.0179
494320.84252.37323666.74564838.00090.40940.55960.61710.048
504396.94185.28613556.59284813.97950.25470.33630.63150.0392
515358.85253.71134589.11765918.3050.37830.99420.6650.9314







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
400.0265-0.00990.00990.00991468.386200-0.08160.0816
410.0282-0.00980.00990.00981548.13471508.260438.8363-0.08370.0827
420.0346-0.00250.00740.007495.48951037.336832.2077-0.02080.062
430.0301-0.01450.00920.00914892.81632001.206744.7348-0.14890.0837
440.04580.00910.00920.00911358.79291872.723943.2750.07850.0827
450.04950.01240.00970.00972678.62652007.04144.80.11020.0873
460.0550.00360.00880.0088217.39151751.376841.84950.03140.0793
470.04720.00910.00890.00892166.4591803.262142.46480.09910.0818
480.06620.00890.00890.00891412.59571759.854741.95060.080.0816
490.07030.01580.00960.00964682.22122052.091345.30.14560.088
500.07660.04810.01310.013244780.42345936.485277.04860.45040.1209
510.06450.01960.01360.013811043.6366362.081179.76270.22370.1295

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
40 & 0.0265 & -0.0099 & 0.0099 & 0.0099 & 1468.3862 & 0 & 0 & -0.0816 & 0.0816 \tabularnewline
41 & 0.0282 & -0.0098 & 0.0099 & 0.0098 & 1548.1347 & 1508.2604 & 38.8363 & -0.0837 & 0.0827 \tabularnewline
42 & 0.0346 & -0.0025 & 0.0074 & 0.0074 & 95.4895 & 1037.3368 & 32.2077 & -0.0208 & 0.062 \tabularnewline
43 & 0.0301 & -0.0145 & 0.0092 & 0.0091 & 4892.8163 & 2001.2067 & 44.7348 & -0.1489 & 0.0837 \tabularnewline
44 & 0.0458 & 0.0091 & 0.0092 & 0.0091 & 1358.7929 & 1872.7239 & 43.275 & 0.0785 & 0.0827 \tabularnewline
45 & 0.0495 & 0.0124 & 0.0097 & 0.0097 & 2678.6265 & 2007.041 & 44.8 & 0.1102 & 0.0873 \tabularnewline
46 & 0.055 & 0.0036 & 0.0088 & 0.0088 & 217.3915 & 1751.3768 & 41.8495 & 0.0314 & 0.0793 \tabularnewline
47 & 0.0472 & 0.0091 & 0.0089 & 0.0089 & 2166.459 & 1803.2621 & 42.4648 & 0.0991 & 0.0818 \tabularnewline
48 & 0.0662 & 0.0089 & 0.0089 & 0.0089 & 1412.5957 & 1759.8547 & 41.9506 & 0.08 & 0.0816 \tabularnewline
49 & 0.0703 & 0.0158 & 0.0096 & 0.0096 & 4682.2212 & 2052.0913 & 45.3 & 0.1456 & 0.088 \tabularnewline
50 & 0.0766 & 0.0481 & 0.0131 & 0.0132 & 44780.4234 & 5936.4852 & 77.0486 & 0.4504 & 0.1209 \tabularnewline
51 & 0.0645 & 0.0196 & 0.0136 & 0.0138 & 11043.636 & 6362.0811 & 79.7627 & 0.2237 & 0.1295 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301801&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]40[/C][C]0.0265[/C][C]-0.0099[/C][C]0.0099[/C][C]0.0099[/C][C]1468.3862[/C][C]0[/C][C]0[/C][C]-0.0816[/C][C]0.0816[/C][/ROW]
[ROW][C]41[/C][C]0.0282[/C][C]-0.0098[/C][C]0.0099[/C][C]0.0098[/C][C]1548.1347[/C][C]1508.2604[/C][C]38.8363[/C][C]-0.0837[/C][C]0.0827[/C][/ROW]
[ROW][C]42[/C][C]0.0346[/C][C]-0.0025[/C][C]0.0074[/C][C]0.0074[/C][C]95.4895[/C][C]1037.3368[/C][C]32.2077[/C][C]-0.0208[/C][C]0.062[/C][/ROW]
[ROW][C]43[/C][C]0.0301[/C][C]-0.0145[/C][C]0.0092[/C][C]0.0091[/C][C]4892.8163[/C][C]2001.2067[/C][C]44.7348[/C][C]-0.1489[/C][C]0.0837[/C][/ROW]
[ROW][C]44[/C][C]0.0458[/C][C]0.0091[/C][C]0.0092[/C][C]0.0091[/C][C]1358.7929[/C][C]1872.7239[/C][C]43.275[/C][C]0.0785[/C][C]0.0827[/C][/ROW]
[ROW][C]45[/C][C]0.0495[/C][C]0.0124[/C][C]0.0097[/C][C]0.0097[/C][C]2678.6265[/C][C]2007.041[/C][C]44.8[/C][C]0.1102[/C][C]0.0873[/C][/ROW]
[ROW][C]46[/C][C]0.055[/C][C]0.0036[/C][C]0.0088[/C][C]0.0088[/C][C]217.3915[/C][C]1751.3768[/C][C]41.8495[/C][C]0.0314[/C][C]0.0793[/C][/ROW]
[ROW][C]47[/C][C]0.0472[/C][C]0.0091[/C][C]0.0089[/C][C]0.0089[/C][C]2166.459[/C][C]1803.2621[/C][C]42.4648[/C][C]0.0991[/C][C]0.0818[/C][/ROW]
[ROW][C]48[/C][C]0.0662[/C][C]0.0089[/C][C]0.0089[/C][C]0.0089[/C][C]1412.5957[/C][C]1759.8547[/C][C]41.9506[/C][C]0.08[/C][C]0.0816[/C][/ROW]
[ROW][C]49[/C][C]0.0703[/C][C]0.0158[/C][C]0.0096[/C][C]0.0096[/C][C]4682.2212[/C][C]2052.0913[/C][C]45.3[/C][C]0.1456[/C][C]0.088[/C][/ROW]
[ROW][C]50[/C][C]0.0766[/C][C]0.0481[/C][C]0.0131[/C][C]0.0132[/C][C]44780.4234[/C][C]5936.4852[/C][C]77.0486[/C][C]0.4504[/C][C]0.1209[/C][/ROW]
[ROW][C]51[/C][C]0.0645[/C][C]0.0196[/C][C]0.0136[/C][C]0.0138[/C][C]11043.636[/C][C]6362.0811[/C][C]79.7627[/C][C]0.2237[/C][C]0.1295[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301801&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301801&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
400.0265-0.00990.00990.00991468.386200-0.08160.0816
410.0282-0.00980.00990.00981548.13471508.260438.8363-0.08370.0827
420.0346-0.00250.00740.007495.48951037.336832.2077-0.02080.062
430.0301-0.01450.00920.00914892.81632001.206744.7348-0.14890.0837
440.04580.00910.00920.00911358.79291872.723943.2750.07850.0827
450.04950.01240.00970.00972678.62652007.04144.80.11020.0873
460.0550.00360.00880.0088217.39151751.376841.84950.03140.0793
470.04720.00910.00890.00892166.4591803.262142.46480.09910.0818
480.06620.00890.00890.00891412.59571759.854741.95060.080.0816
490.07030.01580.00960.00964682.22122052.091345.30.14560.088
500.07660.04810.01310.013244780.42345936.485277.04860.45040.1209
510.06450.01960.01360.013811043.6366362.081179.76270.22370.1295



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