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, 06 Dec 2016 09:48:37 +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/06/t1481014289wbl9z5bzzh05r6e.htm/, Retrieved Sat, 04 May 2024 13:39:28 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=297758, Retrieved Sat, 04 May 2024 13:39:28 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact86
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [F1 Computation] [2016-12-06 08:48:37] [ada7696de20b35d9f514c719a1db97fd] [Current]
Feedback Forum

Post a new message
Dataseries X:
2705.82
2694.94
2670.74
2762.52
2822.16
2803.14
2778.76
2778.16
2788.44
2874.84
2917.38
2916.06
2695.18
2721.82
2688.26
2706.32
2651.88
2526.76
2514.38
2589.16
2615.36
2651.12
2615.26
2655.8
2782.36
2904.42
2808.26
2817.8
2876.62
2846.34
2855.28
2894.8
2950.16
2883.22
3126.02
3409.7
3420.62
3506.18
3349.4
3405.22
3383
3409.64
3631.52
3728.06
3754.34
3799.12
3918.22
3922.42
3836.7
3874.8
3795.96
3801.72
3791.9
3728.12
3822.44
3848.74
3867.2
3882.5
3933.82
3923.4
4059.6
4093.74
4051.06
4042.2
4109.68
4063.2
4076.68
4071.78
4083.86
4142.9
4183.12
4016.12
4159.52
4147.96
4182.7
4115.5
4197.8
4247.86
4280.28
4286.46
4274.88
4526.78
4557.72
4466.98
4818.48
4848.58
4718.64
4697.24
4722.58
4777.2
4803.42
4903.94
4902.54
4903.24
4819.02
4778.64
4868.9
4950.26
4986.04
5007.32
5009.14
5065.72
5077.58
5195.3
5276.82
5530.64
5596.48
5651.08
5683.88
5767.48
5871.02
5830.94
5856.7
5975.72
6043.8
6306.66




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=297758&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[106])
1025065.72-------
1035077.58-------
1045195.3-------
1055276.82-------
1065530.64-------
1075596.485534.23315355.93375712.53250.24690.515810.5158
1085651.085547.77745295.6245799.93080.2110.35250.99690.553
1095683.885608.19725299.37365917.02080.31550.39270.98230.6887
1105767.485681.55925324.96236038.15610.31840.49490.79660.7966
1115871.025685.15235275.57056094.73410.18690.34680.66430.7702
1125830.945698.69665242.23956155.15380.28510.22970.5810.7647
1135856.75759.11645260.16846258.06430.35070.38890.61620.8153
1145975.725832.47845294.38836370.56850.30090.46480.59360.8642
1156043.85836.07155252.96366419.17940.24250.31940.45320.8477
1166306.665849.61585224.7256474.50670.07590.27120.52340.8415

\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[106]) \tabularnewline
102 & 5065.72 & - & - & - & - & - & - & - \tabularnewline
103 & 5077.58 & - & - & - & - & - & - & - \tabularnewline
104 & 5195.3 & - & - & - & - & - & - & - \tabularnewline
105 & 5276.82 & - & - & - & - & - & - & - \tabularnewline
106 & 5530.64 & - & - & - & - & - & - & - \tabularnewline
107 & 5596.48 & 5534.2331 & 5355.9337 & 5712.5325 & 0.2469 & 0.5158 & 1 & 0.5158 \tabularnewline
108 & 5651.08 & 5547.7774 & 5295.624 & 5799.9308 & 0.211 & 0.3525 & 0.9969 & 0.553 \tabularnewline
109 & 5683.88 & 5608.1972 & 5299.3736 & 5917.0208 & 0.3155 & 0.3927 & 0.9823 & 0.6887 \tabularnewline
110 & 5767.48 & 5681.5592 & 5324.9623 & 6038.1561 & 0.3184 & 0.4949 & 0.7966 & 0.7966 \tabularnewline
111 & 5871.02 & 5685.1523 & 5275.5705 & 6094.7341 & 0.1869 & 0.3468 & 0.6643 & 0.7702 \tabularnewline
112 & 5830.94 & 5698.6966 & 5242.2395 & 6155.1538 & 0.2851 & 0.2297 & 0.581 & 0.7647 \tabularnewline
113 & 5856.7 & 5759.1164 & 5260.1684 & 6258.0643 & 0.3507 & 0.3889 & 0.6162 & 0.8153 \tabularnewline
114 & 5975.72 & 5832.4784 & 5294.3883 & 6370.5685 & 0.3009 & 0.4648 & 0.5936 & 0.8642 \tabularnewline
115 & 6043.8 & 5836.0715 & 5252.9636 & 6419.1794 & 0.2425 & 0.3194 & 0.4532 & 0.8477 \tabularnewline
116 & 6306.66 & 5849.6158 & 5224.725 & 6474.5067 & 0.0759 & 0.2712 & 0.5234 & 0.8415 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=297758&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[106])[/C][/ROW]
[ROW][C]102[/C][C]5065.72[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]5077.58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]5195.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]5276.82[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]5530.64[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]5596.48[/C][C]5534.2331[/C][C]5355.9337[/C][C]5712.5325[/C][C]0.2469[/C][C]0.5158[/C][C]1[/C][C]0.5158[/C][/ROW]
[ROW][C]108[/C][C]5651.08[/C][C]5547.7774[/C][C]5295.624[/C][C]5799.9308[/C][C]0.211[/C][C]0.3525[/C][C]0.9969[/C][C]0.553[/C][/ROW]
[ROW][C]109[/C][C]5683.88[/C][C]5608.1972[/C][C]5299.3736[/C][C]5917.0208[/C][C]0.3155[/C][C]0.3927[/C][C]0.9823[/C][C]0.6887[/C][/ROW]
[ROW][C]110[/C][C]5767.48[/C][C]5681.5592[/C][C]5324.9623[/C][C]6038.1561[/C][C]0.3184[/C][C]0.4949[/C][C]0.7966[/C][C]0.7966[/C][/ROW]
[ROW][C]111[/C][C]5871.02[/C][C]5685.1523[/C][C]5275.5705[/C][C]6094.7341[/C][C]0.1869[/C][C]0.3468[/C][C]0.6643[/C][C]0.7702[/C][/ROW]
[ROW][C]112[/C][C]5830.94[/C][C]5698.6966[/C][C]5242.2395[/C][C]6155.1538[/C][C]0.2851[/C][C]0.2297[/C][C]0.581[/C][C]0.7647[/C][/ROW]
[ROW][C]113[/C][C]5856.7[/C][C]5759.1164[/C][C]5260.1684[/C][C]6258.0643[/C][C]0.3507[/C][C]0.3889[/C][C]0.6162[/C][C]0.8153[/C][/ROW]
[ROW][C]114[/C][C]5975.72[/C][C]5832.4784[/C][C]5294.3883[/C][C]6370.5685[/C][C]0.3009[/C][C]0.4648[/C][C]0.5936[/C][C]0.8642[/C][/ROW]
[ROW][C]115[/C][C]6043.8[/C][C]5836.0715[/C][C]5252.9636[/C][C]6419.1794[/C][C]0.2425[/C][C]0.3194[/C][C]0.4532[/C][C]0.8477[/C][/ROW]
[ROW][C]116[/C][C]6306.66[/C][C]5849.6158[/C][C]5224.725[/C][C]6474.5067[/C][C]0.0759[/C][C]0.2712[/C][C]0.5234[/C][C]0.8415[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=297758&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=297758&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[106])
1025065.72-------
1035077.58-------
1045195.3-------
1055276.82-------
1065530.64-------
1075596.485534.23315355.93375712.53250.24690.515810.5158
1085651.085547.77745295.6245799.93080.2110.35250.99690.553
1095683.885608.19725299.37365917.02080.31550.39270.98230.6887
1105767.485681.55925324.96236038.15610.31840.49490.79660.7966
1115871.025685.15235275.57056094.73410.18690.34680.66430.7702
1125830.945698.69665242.23956155.15380.28510.22970.5810.7647
1135856.75759.11645260.16846258.06430.35070.38890.61620.8153
1145975.725832.47845294.38836370.56850.30090.46480.59360.8642
1156043.85836.07155252.96366419.17940.24250.31940.45320.8477
1166306.665849.61585224.7256474.50670.07590.27120.52340.8415







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1070.01640.01110.01110.01123874.6768000.70880.7088
1080.02320.01830.01470.014810671.41977273.048285.28221.17640.9426
1090.02810.01330.01420.01435727.89366757.996782.2070.86180.9157
1100.0320.01490.01440.01457382.38326914.093383.1510.97840.9314
1110.03680.03170.01790.01834546.801112440.6349111.53762.11661.1684
1120.04090.02270.01870.018917488.306213281.9134115.24721.50591.2247
1130.04420.01670.01840.01869522.567712744.8641112.89321.11121.2085
1140.04710.0240.01910.019320518.153713716.5253117.11761.63121.2613
1150.0510.03440.02080.02143151.127216987.0366130.33432.36551.384
1160.05450.07250.02590.0264208889.360436177.269190.20325.20461.766

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
107 & 0.0164 & 0.0111 & 0.0111 & 0.0112 & 3874.6768 & 0 & 0 & 0.7088 & 0.7088 \tabularnewline
108 & 0.0232 & 0.0183 & 0.0147 & 0.0148 & 10671.4197 & 7273.0482 & 85.2822 & 1.1764 & 0.9426 \tabularnewline
109 & 0.0281 & 0.0133 & 0.0142 & 0.0143 & 5727.8936 & 6757.9967 & 82.207 & 0.8618 & 0.9157 \tabularnewline
110 & 0.032 & 0.0149 & 0.0144 & 0.0145 & 7382.3832 & 6914.0933 & 83.151 & 0.9784 & 0.9314 \tabularnewline
111 & 0.0368 & 0.0317 & 0.0179 & 0.018 & 34546.8011 & 12440.6349 & 111.5376 & 2.1166 & 1.1684 \tabularnewline
112 & 0.0409 & 0.0227 & 0.0187 & 0.0189 & 17488.3062 & 13281.9134 & 115.2472 & 1.5059 & 1.2247 \tabularnewline
113 & 0.0442 & 0.0167 & 0.0184 & 0.0186 & 9522.5677 & 12744.8641 & 112.8932 & 1.1112 & 1.2085 \tabularnewline
114 & 0.0471 & 0.024 & 0.0191 & 0.0193 & 20518.1537 & 13716.5253 & 117.1176 & 1.6312 & 1.2613 \tabularnewline
115 & 0.051 & 0.0344 & 0.0208 & 0.021 & 43151.1272 & 16987.0366 & 130.3343 & 2.3655 & 1.384 \tabularnewline
116 & 0.0545 & 0.0725 & 0.0259 & 0.0264 & 208889.3604 & 36177.269 & 190.2032 & 5.2046 & 1.766 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=297758&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]107[/C][C]0.0164[/C][C]0.0111[/C][C]0.0111[/C][C]0.0112[/C][C]3874.6768[/C][C]0[/C][C]0[/C][C]0.7088[/C][C]0.7088[/C][/ROW]
[ROW][C]108[/C][C]0.0232[/C][C]0.0183[/C][C]0.0147[/C][C]0.0148[/C][C]10671.4197[/C][C]7273.0482[/C][C]85.2822[/C][C]1.1764[/C][C]0.9426[/C][/ROW]
[ROW][C]109[/C][C]0.0281[/C][C]0.0133[/C][C]0.0142[/C][C]0.0143[/C][C]5727.8936[/C][C]6757.9967[/C][C]82.207[/C][C]0.8618[/C][C]0.9157[/C][/ROW]
[ROW][C]110[/C][C]0.032[/C][C]0.0149[/C][C]0.0144[/C][C]0.0145[/C][C]7382.3832[/C][C]6914.0933[/C][C]83.151[/C][C]0.9784[/C][C]0.9314[/C][/ROW]
[ROW][C]111[/C][C]0.0368[/C][C]0.0317[/C][C]0.0179[/C][C]0.018[/C][C]34546.8011[/C][C]12440.6349[/C][C]111.5376[/C][C]2.1166[/C][C]1.1684[/C][/ROW]
[ROW][C]112[/C][C]0.0409[/C][C]0.0227[/C][C]0.0187[/C][C]0.0189[/C][C]17488.3062[/C][C]13281.9134[/C][C]115.2472[/C][C]1.5059[/C][C]1.2247[/C][/ROW]
[ROW][C]113[/C][C]0.0442[/C][C]0.0167[/C][C]0.0184[/C][C]0.0186[/C][C]9522.5677[/C][C]12744.8641[/C][C]112.8932[/C][C]1.1112[/C][C]1.2085[/C][/ROW]
[ROW][C]114[/C][C]0.0471[/C][C]0.024[/C][C]0.0191[/C][C]0.0193[/C][C]20518.1537[/C][C]13716.5253[/C][C]117.1176[/C][C]1.6312[/C][C]1.2613[/C][/ROW]
[ROW][C]115[/C][C]0.051[/C][C]0.0344[/C][C]0.0208[/C][C]0.021[/C][C]43151.1272[/C][C]16987.0366[/C][C]130.3343[/C][C]2.3655[/C][C]1.384[/C][/ROW]
[ROW][C]116[/C][C]0.0545[/C][C]0.0725[/C][C]0.0259[/C][C]0.0264[/C][C]208889.3604[/C][C]36177.269[/C][C]190.2032[/C][C]5.2046[/C][C]1.766[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=297758&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=297758&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
1070.01640.01110.01110.01123874.6768000.70880.7088
1080.02320.01830.01470.014810671.41977273.048285.28221.17640.9426
1090.02810.01330.01420.01435727.89366757.996782.2070.86180.9157
1100.0320.01490.01440.01457382.38326914.093383.1510.97840.9314
1110.03680.03170.01790.01834546.801112440.6349111.53762.11661.1684
1120.04090.02270.01870.018917488.306213281.9134115.24721.50591.2247
1130.04420.01670.01840.01869522.567712744.8641112.89321.11121.2085
1140.04710.0240.01910.019320518.153713716.5253117.11761.63121.2613
1150.0510.03440.02080.02143151.127216987.0366130.33432.36551.384
1160.05450.07250.02590.0264208889.360436177.269190.20325.20461.766



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