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 computationMon, 19 Dec 2016 22:11:17 +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/19/t14821818847dv2e5to95n1667.htm/, Retrieved Fri, 17 May 2024 16:38:20 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301515, Retrieved Fri, 17 May 2024 16:38:20 +0000
QR Codes:

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

Post a new message
Dataseries X:
3894.5
3850
3823
4091
4145.5
4432.5
4245
4172
3815
3565.5
3560
3477.5
3597
3685.5
4012.5
4422
4548.5
4599
4675
4583
4755.5
5001
5113
5131
5336
5276
5431
5479
5550
5601.5
5681.5
6191.5
6433.5
6489.5
6609
6673
6877
6972
6993
7032
7125.5
7233
7109
6935.5




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301515&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[32])
315681.5-------
326191.5-------
336433.56414.80926065.38576764.23270.45830.89480.89480.8948
346489.56512.58765900.6037124.57230.47050.60.60.8481
3566096555.4015719.48337391.31870.450.56140.56140.8032
3666736574.14745545.91697602.37780.42530.47350.47350.7671
3768776582.35565385.9857778.72630.31460.4410.4410.739
3869726585.94975239.74837932.15110.2870.33590.33590.7171
3969936587.52345105.54528069.50170.29590.30560.30560.6998
4070326588.21254981.47728194.94780.29410.31070.31070.6858
417125.56588.51424865.86418311.16440.27060.30690.30690.6743
4272336588.64634757.33388419.95890.24520.28280.28280.6646
4371096588.70424654.79628522.61220.2990.25690.25690.6564
446935.56588.72954557.38918620.070.3690.30780.30780.6492

\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[32]) \tabularnewline
31 & 5681.5 & - & - & - & - & - & - & - \tabularnewline
32 & 6191.5 & - & - & - & - & - & - & - \tabularnewline
33 & 6433.5 & 6414.8092 & 6065.3857 & 6764.2327 & 0.4583 & 0.8948 & 0.8948 & 0.8948 \tabularnewline
34 & 6489.5 & 6512.5876 & 5900.603 & 7124.5723 & 0.4705 & 0.6 & 0.6 & 0.8481 \tabularnewline
35 & 6609 & 6555.401 & 5719.4833 & 7391.3187 & 0.45 & 0.5614 & 0.5614 & 0.8032 \tabularnewline
36 & 6673 & 6574.1474 & 5545.9169 & 7602.3778 & 0.4253 & 0.4735 & 0.4735 & 0.7671 \tabularnewline
37 & 6877 & 6582.3556 & 5385.985 & 7778.7263 & 0.3146 & 0.441 & 0.441 & 0.739 \tabularnewline
38 & 6972 & 6585.9497 & 5239.7483 & 7932.1511 & 0.287 & 0.3359 & 0.3359 & 0.7171 \tabularnewline
39 & 6993 & 6587.5234 & 5105.5452 & 8069.5017 & 0.2959 & 0.3056 & 0.3056 & 0.6998 \tabularnewline
40 & 7032 & 6588.2125 & 4981.4772 & 8194.9478 & 0.2941 & 0.3107 & 0.3107 & 0.6858 \tabularnewline
41 & 7125.5 & 6588.5142 & 4865.8641 & 8311.1644 & 0.2706 & 0.3069 & 0.3069 & 0.6743 \tabularnewline
42 & 7233 & 6588.6463 & 4757.3338 & 8419.9589 & 0.2452 & 0.2828 & 0.2828 & 0.6646 \tabularnewline
43 & 7109 & 6588.7042 & 4654.7962 & 8522.6122 & 0.299 & 0.2569 & 0.2569 & 0.6564 \tabularnewline
44 & 6935.5 & 6588.7295 & 4557.3891 & 8620.07 & 0.369 & 0.3078 & 0.3078 & 0.6492 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301515&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[32])[/C][/ROW]
[ROW][C]31[/C][C]5681.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]6191.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]6433.5[/C][C]6414.8092[/C][C]6065.3857[/C][C]6764.2327[/C][C]0.4583[/C][C]0.8948[/C][C]0.8948[/C][C]0.8948[/C][/ROW]
[ROW][C]34[/C][C]6489.5[/C][C]6512.5876[/C][C]5900.603[/C][C]7124.5723[/C][C]0.4705[/C][C]0.6[/C][C]0.6[/C][C]0.8481[/C][/ROW]
[ROW][C]35[/C][C]6609[/C][C]6555.401[/C][C]5719.4833[/C][C]7391.3187[/C][C]0.45[/C][C]0.5614[/C][C]0.5614[/C][C]0.8032[/C][/ROW]
[ROW][C]36[/C][C]6673[/C][C]6574.1474[/C][C]5545.9169[/C][C]7602.3778[/C][C]0.4253[/C][C]0.4735[/C][C]0.4735[/C][C]0.7671[/C][/ROW]
[ROW][C]37[/C][C]6877[/C][C]6582.3556[/C][C]5385.985[/C][C]7778.7263[/C][C]0.3146[/C][C]0.441[/C][C]0.441[/C][C]0.739[/C][/ROW]
[ROW][C]38[/C][C]6972[/C][C]6585.9497[/C][C]5239.7483[/C][C]7932.1511[/C][C]0.287[/C][C]0.3359[/C][C]0.3359[/C][C]0.7171[/C][/ROW]
[ROW][C]39[/C][C]6993[/C][C]6587.5234[/C][C]5105.5452[/C][C]8069.5017[/C][C]0.2959[/C][C]0.3056[/C][C]0.3056[/C][C]0.6998[/C][/ROW]
[ROW][C]40[/C][C]7032[/C][C]6588.2125[/C][C]4981.4772[/C][C]8194.9478[/C][C]0.2941[/C][C]0.3107[/C][C]0.3107[/C][C]0.6858[/C][/ROW]
[ROW][C]41[/C][C]7125.5[/C][C]6588.5142[/C][C]4865.8641[/C][C]8311.1644[/C][C]0.2706[/C][C]0.3069[/C][C]0.3069[/C][C]0.6743[/C][/ROW]
[ROW][C]42[/C][C]7233[/C][C]6588.6463[/C][C]4757.3338[/C][C]8419.9589[/C][C]0.2452[/C][C]0.2828[/C][C]0.2828[/C][C]0.6646[/C][/ROW]
[ROW][C]43[/C][C]7109[/C][C]6588.7042[/C][C]4654.7962[/C][C]8522.6122[/C][C]0.299[/C][C]0.2569[/C][C]0.2569[/C][C]0.6564[/C][/ROW]
[ROW][C]44[/C][C]6935.5[/C][C]6588.7295[/C][C]4557.3891[/C][C]8620.07[/C][C]0.369[/C][C]0.3078[/C][C]0.3078[/C][C]0.6492[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301515&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301515&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[32])
315681.5-------
326191.5-------
336433.56414.80926065.38576764.23270.45830.89480.89480.8948
346489.56512.58765900.6037124.57230.47050.60.60.8481
3566096555.4015719.48337391.31870.450.56140.56140.8032
3666736574.14745545.91697602.37780.42530.47350.47350.7671
3768776582.35565385.9857778.72630.31460.4410.4410.739
3869726585.94975239.74837932.15110.2870.33590.33590.7171
3969936587.52345105.54528069.50170.29590.30560.30560.6998
4070326588.21254981.47728194.94780.29410.31070.31070.6858
417125.56588.51424865.86418311.16440.27060.30690.30690.6743
4272336588.64634757.33388419.95890.24520.28280.28280.6646
4371096588.70424654.79628522.61220.2990.25690.25690.6564
446935.56588.72954557.38918620.070.3690.30780.30780.6492







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
330.02780.00290.00290.0029349.3456000.18740.1874
340.0479-0.00360.00320.0032533.0395441.192621.0046-0.23150.2095
350.06510.00810.00490.00492872.84941251.744835.380.53750.3188
360.07980.01480.00730.00749771.84623381.770258.1530.99120.4869
370.09270.04280.01440.014786815.300820068.4763141.66322.95450.9804
380.10430.05540.02130.0217149034.813641562.8659203.86973.87111.4622
390.11480.0580.02650.0271164411.241559112.6338243.13094.06591.8341
400.12440.06310.03110.0319196947.339376341.972276.30054.452.1611
410.13340.07540.0360.0371288353.725199898.8335316.06785.38452.5193
420.14180.08910.04130.0427415191.649131428.115362.53026.46122.9135
430.14980.07320.04420.0457270707.7423144089.8993379.59185.21723.1229
440.15730.050.04470.0462120249.7752142103.2223376.96583.47723.1524

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
33 & 0.0278 & 0.0029 & 0.0029 & 0.0029 & 349.3456 & 0 & 0 & 0.1874 & 0.1874 \tabularnewline
34 & 0.0479 & -0.0036 & 0.0032 & 0.0032 & 533.0395 & 441.1926 & 21.0046 & -0.2315 & 0.2095 \tabularnewline
35 & 0.0651 & 0.0081 & 0.0049 & 0.0049 & 2872.8494 & 1251.7448 & 35.38 & 0.5375 & 0.3188 \tabularnewline
36 & 0.0798 & 0.0148 & 0.0073 & 0.0074 & 9771.8462 & 3381.7702 & 58.153 & 0.9912 & 0.4869 \tabularnewline
37 & 0.0927 & 0.0428 & 0.0144 & 0.0147 & 86815.3008 & 20068.4763 & 141.6632 & 2.9545 & 0.9804 \tabularnewline
38 & 0.1043 & 0.0554 & 0.0213 & 0.0217 & 149034.8136 & 41562.8659 & 203.8697 & 3.8711 & 1.4622 \tabularnewline
39 & 0.1148 & 0.058 & 0.0265 & 0.0271 & 164411.2415 & 59112.6338 & 243.1309 & 4.0659 & 1.8341 \tabularnewline
40 & 0.1244 & 0.0631 & 0.0311 & 0.0319 & 196947.3393 & 76341.972 & 276.3005 & 4.45 & 2.1611 \tabularnewline
41 & 0.1334 & 0.0754 & 0.036 & 0.0371 & 288353.7251 & 99898.8335 & 316.0678 & 5.3845 & 2.5193 \tabularnewline
42 & 0.1418 & 0.0891 & 0.0413 & 0.0427 & 415191.649 & 131428.115 & 362.5302 & 6.4612 & 2.9135 \tabularnewline
43 & 0.1498 & 0.0732 & 0.0442 & 0.0457 & 270707.7423 & 144089.8993 & 379.5918 & 5.2172 & 3.1229 \tabularnewline
44 & 0.1573 & 0.05 & 0.0447 & 0.0462 & 120249.7752 & 142103.2223 & 376.9658 & 3.4772 & 3.1524 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301515&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]33[/C][C]0.0278[/C][C]0.0029[/C][C]0.0029[/C][C]0.0029[/C][C]349.3456[/C][C]0[/C][C]0[/C][C]0.1874[/C][C]0.1874[/C][/ROW]
[ROW][C]34[/C][C]0.0479[/C][C]-0.0036[/C][C]0.0032[/C][C]0.0032[/C][C]533.0395[/C][C]441.1926[/C][C]21.0046[/C][C]-0.2315[/C][C]0.2095[/C][/ROW]
[ROW][C]35[/C][C]0.0651[/C][C]0.0081[/C][C]0.0049[/C][C]0.0049[/C][C]2872.8494[/C][C]1251.7448[/C][C]35.38[/C][C]0.5375[/C][C]0.3188[/C][/ROW]
[ROW][C]36[/C][C]0.0798[/C][C]0.0148[/C][C]0.0073[/C][C]0.0074[/C][C]9771.8462[/C][C]3381.7702[/C][C]58.153[/C][C]0.9912[/C][C]0.4869[/C][/ROW]
[ROW][C]37[/C][C]0.0927[/C][C]0.0428[/C][C]0.0144[/C][C]0.0147[/C][C]86815.3008[/C][C]20068.4763[/C][C]141.6632[/C][C]2.9545[/C][C]0.9804[/C][/ROW]
[ROW][C]38[/C][C]0.1043[/C][C]0.0554[/C][C]0.0213[/C][C]0.0217[/C][C]149034.8136[/C][C]41562.8659[/C][C]203.8697[/C][C]3.8711[/C][C]1.4622[/C][/ROW]
[ROW][C]39[/C][C]0.1148[/C][C]0.058[/C][C]0.0265[/C][C]0.0271[/C][C]164411.2415[/C][C]59112.6338[/C][C]243.1309[/C][C]4.0659[/C][C]1.8341[/C][/ROW]
[ROW][C]40[/C][C]0.1244[/C][C]0.0631[/C][C]0.0311[/C][C]0.0319[/C][C]196947.3393[/C][C]76341.972[/C][C]276.3005[/C][C]4.45[/C][C]2.1611[/C][/ROW]
[ROW][C]41[/C][C]0.1334[/C][C]0.0754[/C][C]0.036[/C][C]0.0371[/C][C]288353.7251[/C][C]99898.8335[/C][C]316.0678[/C][C]5.3845[/C][C]2.5193[/C][/ROW]
[ROW][C]42[/C][C]0.1418[/C][C]0.0891[/C][C]0.0413[/C][C]0.0427[/C][C]415191.649[/C][C]131428.115[/C][C]362.5302[/C][C]6.4612[/C][C]2.9135[/C][/ROW]
[ROW][C]43[/C][C]0.1498[/C][C]0.0732[/C][C]0.0442[/C][C]0.0457[/C][C]270707.7423[/C][C]144089.8993[/C][C]379.5918[/C][C]5.2172[/C][C]3.1229[/C][/ROW]
[ROW][C]44[/C][C]0.1573[/C][C]0.05[/C][C]0.0447[/C][C]0.0462[/C][C]120249.7752[/C][C]142103.2223[/C][C]376.9658[/C][C]3.4772[/C][C]3.1524[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301515&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301515&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
330.02780.00290.00290.0029349.3456000.18740.1874
340.0479-0.00360.00320.0032533.0395441.192621.0046-0.23150.2095
350.06510.00810.00490.00492872.84941251.744835.380.53750.3188
360.07980.01480.00730.00749771.84623381.770258.1530.99120.4869
370.09270.04280.01440.014786815.300820068.4763141.66322.95450.9804
380.10430.05540.02130.0217149034.813641562.8659203.86973.87111.4622
390.11480.0580.02650.0271164411.241559112.6338243.13094.06591.8341
400.12440.06310.03110.0319196947.339376341.972276.30054.452.1611
410.13340.07540.0360.0371288353.725199898.8335316.06785.38452.5193
420.14180.08910.04130.0427415191.649131428.115362.53026.46122.9135
430.14980.07320.04420.0457270707.7423144089.8993379.59185.21723.1229
440.15730.050.04470.0462120249.7752142103.2223376.96583.47723.1524



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