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 computationSat, 17 Dec 2016 12:41:11 +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/17/t148197534212da3gb53ebnf9m.htm/, Retrieved Thu, 02 May 2024 12:10:22 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300727, Retrieved Thu, 02 May 2024 12:10:22 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact60
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-17 11:41:11] [df90c754990be6fd2b18fcd529010a59] [Current]
Feedback Forum

Post a new message
Dataseries X:
2160
2660
3680
3380
3600
3940
3080
2680
2920
2660
2360
2440
2660
3000
4140
3580
3960
4280
3000
3620
4280
4500
4360
3840
4620
4700
5280
4700
5340
5200
3880
4920
4600
5360
4960
4060
4880
4980
5440
5320
5960
5460
3780
5220
5920
6060
5100
4400
5480
5240
5160
5620
5440
5460
4680
4940
5900
5580
4480
4600
5540
5800
6460
6100
6080
6080
4860
5740
5980
6660
5520
5360
5900
6360
7280
6220
6660
6860
4460
6360
6480
6800
6460
6060
6760
6860
7320
6680
7220
7160
4100
6560
5780
5500
5800
5300
4240
5620
7100
5960
7360
7420
4760
6040
5940
6720
4700
3100
3880
3540
4160
5260
6040
5800
4180
5120
5980
6940
5440
4360
4640
5540
6840
6340
6620
6680




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300727&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[114])
1136040-------
1145800-------
115418058004081.71288241.63810.09670.50.50.5
116512058003528.90079532.71360.36050.80250.80250.5
117598058003156.036910658.93740.47110.60810.60810.5
118694058002872.479211711.13770.35270.47620.47620.5
119544058002643.847112723.88250.45940.37350.37350.5
120436058002452.851513714.64990.36070.53550.53550.5
121464058002289.415314693.7080.39910.62450.62450.5
122554058002147.093215667.69450.47940.59110.59110.5
123684058002021.488916641.19980.42540.51870.51870.5
124634058001909.458117617.56410.46430.43150.43150.5
125662058001808.668518599.31720.450.4670.4670.5
126668058001717.339519588.43920.45020.45360.45360.5

\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[114]) \tabularnewline
113 & 6040 & - & - & - & - & - & - & - \tabularnewline
114 & 5800 & - & - & - & - & - & - & - \tabularnewline
115 & 4180 & 5800 & 4081.7128 & 8241.6381 & 0.0967 & 0.5 & 0.5 & 0.5 \tabularnewline
116 & 5120 & 5800 & 3528.9007 & 9532.7136 & 0.3605 & 0.8025 & 0.8025 & 0.5 \tabularnewline
117 & 5980 & 5800 & 3156.0369 & 10658.9374 & 0.4711 & 0.6081 & 0.6081 & 0.5 \tabularnewline
118 & 6940 & 5800 & 2872.4792 & 11711.1377 & 0.3527 & 0.4762 & 0.4762 & 0.5 \tabularnewline
119 & 5440 & 5800 & 2643.8471 & 12723.8825 & 0.4594 & 0.3735 & 0.3735 & 0.5 \tabularnewline
120 & 4360 & 5800 & 2452.8515 & 13714.6499 & 0.3607 & 0.5355 & 0.5355 & 0.5 \tabularnewline
121 & 4640 & 5800 & 2289.4153 & 14693.708 & 0.3991 & 0.6245 & 0.6245 & 0.5 \tabularnewline
122 & 5540 & 5800 & 2147.0932 & 15667.6945 & 0.4794 & 0.5911 & 0.5911 & 0.5 \tabularnewline
123 & 6840 & 5800 & 2021.4889 & 16641.1998 & 0.4254 & 0.5187 & 0.5187 & 0.5 \tabularnewline
124 & 6340 & 5800 & 1909.4581 & 17617.5641 & 0.4643 & 0.4315 & 0.4315 & 0.5 \tabularnewline
125 & 6620 & 5800 & 1808.6685 & 18599.3172 & 0.45 & 0.467 & 0.467 & 0.5 \tabularnewline
126 & 6680 & 5800 & 1717.3395 & 19588.4392 & 0.4502 & 0.4536 & 0.4536 & 0.5 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300727&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[114])[/C][/ROW]
[ROW][C]113[/C][C]6040[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]5800[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]4180[/C][C]5800[/C][C]4081.7128[/C][C]8241.6381[/C][C]0.0967[/C][C]0.5[/C][C]0.5[/C][C]0.5[/C][/ROW]
[ROW][C]116[/C][C]5120[/C][C]5800[/C][C]3528.9007[/C][C]9532.7136[/C][C]0.3605[/C][C]0.8025[/C][C]0.8025[/C][C]0.5[/C][/ROW]
[ROW][C]117[/C][C]5980[/C][C]5800[/C][C]3156.0369[/C][C]10658.9374[/C][C]0.4711[/C][C]0.6081[/C][C]0.6081[/C][C]0.5[/C][/ROW]
[ROW][C]118[/C][C]6940[/C][C]5800[/C][C]2872.4792[/C][C]11711.1377[/C][C]0.3527[/C][C]0.4762[/C][C]0.4762[/C][C]0.5[/C][/ROW]
[ROW][C]119[/C][C]5440[/C][C]5800[/C][C]2643.8471[/C][C]12723.8825[/C][C]0.4594[/C][C]0.3735[/C][C]0.3735[/C][C]0.5[/C][/ROW]
[ROW][C]120[/C][C]4360[/C][C]5800[/C][C]2452.8515[/C][C]13714.6499[/C][C]0.3607[/C][C]0.5355[/C][C]0.5355[/C][C]0.5[/C][/ROW]
[ROW][C]121[/C][C]4640[/C][C]5800[/C][C]2289.4153[/C][C]14693.708[/C][C]0.3991[/C][C]0.6245[/C][C]0.6245[/C][C]0.5[/C][/ROW]
[ROW][C]122[/C][C]5540[/C][C]5800[/C][C]2147.0932[/C][C]15667.6945[/C][C]0.4794[/C][C]0.5911[/C][C]0.5911[/C][C]0.5[/C][/ROW]
[ROW][C]123[/C][C]6840[/C][C]5800[/C][C]2021.4889[/C][C]16641.1998[/C][C]0.4254[/C][C]0.5187[/C][C]0.5187[/C][C]0.5[/C][/ROW]
[ROW][C]124[/C][C]6340[/C][C]5800[/C][C]1909.4581[/C][C]17617.5641[/C][C]0.4643[/C][C]0.4315[/C][C]0.4315[/C][C]0.5[/C][/ROW]
[ROW][C]125[/C][C]6620[/C][C]5800[/C][C]1808.6685[/C][C]18599.3172[/C][C]0.45[/C][C]0.467[/C][C]0.467[/C][C]0.5[/C][/ROW]
[ROW][C]126[/C][C]6680[/C][C]5800[/C][C]1717.3395[/C][C]19588.4392[/C][C]0.4502[/C][C]0.4536[/C][C]0.4536[/C][C]0.5[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300727&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300727&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[114])
1136040-------
1145800-------
115418058004081.71288241.63810.09670.50.50.5
116512058003528.90079532.71360.36050.80250.80250.5
117598058003156.036910658.93740.47110.60810.60810.5
118694058002872.479211711.13770.35270.47620.47620.5
119544058002643.847112723.88250.45940.37350.37350.5
120436058002452.851513714.64990.36070.53550.53550.5
121464058002289.415314693.7080.39910.62450.62450.5
122554058002147.093215667.69450.47940.59110.59110.5
123684058002021.488916641.19980.42540.51870.51870.5
124634058001909.458117617.56410.46430.43150.43150.5
125662058001808.668518599.31720.450.4670.4670.5
126668058001717.339519588.43920.45020.45360.45360.5







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.2148-0.38760.38760.3246262440000-2.05772.0577
1160.3284-0.13280.26020.224646240015434001242.3365-0.86371.4607
1170.42740.03010.18350.1599324001039733.33331019.67320.22861.05
1180.520.16430.17870.1647129960011047001051.04711.4481.1495
1190.6091-0.06620.15620.1446129600909680953.7715-0.45731.0111
1200.6962-0.33030.18520.167720736001103666.66671050.5554-1.82911.1474
1210.7823-0.250.19450.175513456001138228.57141066.878-1.47341.194
1220.868-0.04690.1760.15936760010044001002.1976-0.33031.086
1230.95370.1520.17340.159910816001012977.77781006.4681.3211.1121
1241.03950.08520.16450.1528291600940840969.96910.68591.0695
1251.12590.12390.16080.1509672400916436.3636957.30681.04161.067
1261.21290.13170.15840.1501774400904600951.10461.11781.0712

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
115 & 0.2148 & -0.3876 & 0.3876 & 0.3246 & 2624400 & 0 & 0 & -2.0577 & 2.0577 \tabularnewline
116 & 0.3284 & -0.1328 & 0.2602 & 0.2246 & 462400 & 1543400 & 1242.3365 & -0.8637 & 1.4607 \tabularnewline
117 & 0.4274 & 0.0301 & 0.1835 & 0.1599 & 32400 & 1039733.3333 & 1019.6732 & 0.2286 & 1.05 \tabularnewline
118 & 0.52 & 0.1643 & 0.1787 & 0.1647 & 1299600 & 1104700 & 1051.0471 & 1.448 & 1.1495 \tabularnewline
119 & 0.6091 & -0.0662 & 0.1562 & 0.1446 & 129600 & 909680 & 953.7715 & -0.4573 & 1.0111 \tabularnewline
120 & 0.6962 & -0.3303 & 0.1852 & 0.1677 & 2073600 & 1103666.6667 & 1050.5554 & -1.8291 & 1.1474 \tabularnewline
121 & 0.7823 & -0.25 & 0.1945 & 0.1755 & 1345600 & 1138228.5714 & 1066.878 & -1.4734 & 1.194 \tabularnewline
122 & 0.868 & -0.0469 & 0.176 & 0.1593 & 67600 & 1004400 & 1002.1976 & -0.3303 & 1.086 \tabularnewline
123 & 0.9537 & 0.152 & 0.1734 & 0.1599 & 1081600 & 1012977.7778 & 1006.468 & 1.321 & 1.1121 \tabularnewline
124 & 1.0395 & 0.0852 & 0.1645 & 0.1528 & 291600 & 940840 & 969.9691 & 0.6859 & 1.0695 \tabularnewline
125 & 1.1259 & 0.1239 & 0.1608 & 0.1509 & 672400 & 916436.3636 & 957.3068 & 1.0416 & 1.067 \tabularnewline
126 & 1.2129 & 0.1317 & 0.1584 & 0.1501 & 774400 & 904600 & 951.1046 & 1.1178 & 1.0712 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300727&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]115[/C][C]0.2148[/C][C]-0.3876[/C][C]0.3876[/C][C]0.3246[/C][C]2624400[/C][C]0[/C][C]0[/C][C]-2.0577[/C][C]2.0577[/C][/ROW]
[ROW][C]116[/C][C]0.3284[/C][C]-0.1328[/C][C]0.2602[/C][C]0.2246[/C][C]462400[/C][C]1543400[/C][C]1242.3365[/C][C]-0.8637[/C][C]1.4607[/C][/ROW]
[ROW][C]117[/C][C]0.4274[/C][C]0.0301[/C][C]0.1835[/C][C]0.1599[/C][C]32400[/C][C]1039733.3333[/C][C]1019.6732[/C][C]0.2286[/C][C]1.05[/C][/ROW]
[ROW][C]118[/C][C]0.52[/C][C]0.1643[/C][C]0.1787[/C][C]0.1647[/C][C]1299600[/C][C]1104700[/C][C]1051.0471[/C][C]1.448[/C][C]1.1495[/C][/ROW]
[ROW][C]119[/C][C]0.6091[/C][C]-0.0662[/C][C]0.1562[/C][C]0.1446[/C][C]129600[/C][C]909680[/C][C]953.7715[/C][C]-0.4573[/C][C]1.0111[/C][/ROW]
[ROW][C]120[/C][C]0.6962[/C][C]-0.3303[/C][C]0.1852[/C][C]0.1677[/C][C]2073600[/C][C]1103666.6667[/C][C]1050.5554[/C][C]-1.8291[/C][C]1.1474[/C][/ROW]
[ROW][C]121[/C][C]0.7823[/C][C]-0.25[/C][C]0.1945[/C][C]0.1755[/C][C]1345600[/C][C]1138228.5714[/C][C]1066.878[/C][C]-1.4734[/C][C]1.194[/C][/ROW]
[ROW][C]122[/C][C]0.868[/C][C]-0.0469[/C][C]0.176[/C][C]0.1593[/C][C]67600[/C][C]1004400[/C][C]1002.1976[/C][C]-0.3303[/C][C]1.086[/C][/ROW]
[ROW][C]123[/C][C]0.9537[/C][C]0.152[/C][C]0.1734[/C][C]0.1599[/C][C]1081600[/C][C]1012977.7778[/C][C]1006.468[/C][C]1.321[/C][C]1.1121[/C][/ROW]
[ROW][C]124[/C][C]1.0395[/C][C]0.0852[/C][C]0.1645[/C][C]0.1528[/C][C]291600[/C][C]940840[/C][C]969.9691[/C][C]0.6859[/C][C]1.0695[/C][/ROW]
[ROW][C]125[/C][C]1.1259[/C][C]0.1239[/C][C]0.1608[/C][C]0.1509[/C][C]672400[/C][C]916436.3636[/C][C]957.3068[/C][C]1.0416[/C][C]1.067[/C][/ROW]
[ROW][C]126[/C][C]1.2129[/C][C]0.1317[/C][C]0.1584[/C][C]0.1501[/C][C]774400[/C][C]904600[/C][C]951.1046[/C][C]1.1178[/C][C]1.0712[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300727&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300727&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
1150.2148-0.38760.38760.3246262440000-2.05772.0577
1160.3284-0.13280.26020.224646240015434001242.3365-0.86371.4607
1170.42740.03010.18350.1599324001039733.33331019.67320.22861.05
1180.520.16430.17870.1647129960011047001051.04711.4481.1495
1190.6091-0.06620.15620.1446129600909680953.7715-0.45731.0111
1200.6962-0.33030.18520.167720736001103666.66671050.5554-1.82911.1474
1210.7823-0.250.19450.175513456001138228.57141066.878-1.47341.194
1220.868-0.04690.1760.15936760010044001002.1976-0.33031.086
1230.95370.1520.17340.159910816001012977.77781006.4681.3211.1121
1241.03950.08520.16450.1528291600940840969.96910.68591.0695
1251.12590.12390.16080.1509672400916436.3636957.30681.04161.067
1261.21290.13170.15840.1501774400904600951.10461.11781.0712



Parameters (Session):
par1 = blue ; par2 = no ;
Parameters (R input):
par1 = 12 ; par2 = 0.0 ; par3 = 1 ; par4 = 0 ; par5 = 1 ; par6 = 0 ; par7 = 0 ; 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*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')