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 11:49:10 +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/t1482145293es6xfpcrr6mbkp0.htm/, Retrieved Tue, 21 May 2024 01:53:05 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301290, Retrieved Tue, 21 May 2024 01:53:05 +0000
QR Codes:

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

Post a new message
Dataseries X:
5797.8
5784.3
5714.8
5748.8
5793.8
5783.2
5765
5846.1
5879.4
5922.7
5992.7
6032.5
6028.3
6096.3
6184.8
6206.1
6324
6380.6
6504.6
6591
6637.9
6653.8
6611.3
6603.1
6562.8
6554.9
6529.8
6543.4
6481.5
6489.6
6452.3
6444.5
6409.6
6427.5
6374.2
6400.5
6268.2
6239.5
6220.1
6226.6
6207.1
6217.4
6196.9
6132.9
6151.2
6115.2
6122.6
6140.9
6146.5
6126
6131.9
6190.8
6209.2
6230.8
6196.5
6168.2
6213.4
6243
6298.1
6361.4
6388.7
6416.3
6505.7
6538.7
6605.5
6668.9
6741.7
6813.2
6864.3
6870
6889.8
6938.8
7033.3
7104
7168.7
7156
7156.6
7171.8
7251.2
7258.8
7231.5
7261.7
7252.8
7194.2
7211.9
7177.8
7145.9
7170.6
7189.6
7161
7219.9
7155.3
7155.8
7232.1
7254.9
7278.8
7291.2
7298.6
7256.3
7187.7
7126.3
7034.6
7018.6
7024.4
7028.2
7042.2
7022.2
6998.7
6982.7
6936.6
6887.2
6881.1
6890.9
6947.7
6887.5
6937.1




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301290&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])
1027034.6-------
1037018.6-------
1047024.4-------
1057028.2-------
1067042.2-------
1077022.27045.20696962.81827127.59550.29210.52850.73660.5285
1086998.77048.28276914.32387182.24170.23410.64860.63660.5355
1096982.77048.92576864.9117232.94030.24030.70370.58740.5286
1106936.67052.75596818.92497286.5870.16510.72150.53530.5353
1116887.27058.8946773.37257344.41560.11930.79940.59940.5456
1126881.17064.74086727.74887401.73280.14270.84910.64950.5522
1136890.97067.83576679.80297455.86840.18570.82720.66640.5515
1146947.77073.83576635.40157512.26980.28640.79330.73020.5562
1156887.57081.89386592.22787571.55970.21830.70440.78210.5631
1166937.17089.43956549.19477629.68440.29020.76810.77510.568

\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 & 7034.6 & - & - & - & - & - & - & - \tabularnewline
103 & 7018.6 & - & - & - & - & - & - & - \tabularnewline
104 & 7024.4 & - & - & - & - & - & - & - \tabularnewline
105 & 7028.2 & - & - & - & - & - & - & - \tabularnewline
106 & 7042.2 & - & - & - & - & - & - & - \tabularnewline
107 & 7022.2 & 7045.2069 & 6962.8182 & 7127.5955 & 0.2921 & 0.5285 & 0.7366 & 0.5285 \tabularnewline
108 & 6998.7 & 7048.2827 & 6914.3238 & 7182.2417 & 0.2341 & 0.6486 & 0.6366 & 0.5355 \tabularnewline
109 & 6982.7 & 7048.9257 & 6864.911 & 7232.9403 & 0.2403 & 0.7037 & 0.5874 & 0.5286 \tabularnewline
110 & 6936.6 & 7052.7559 & 6818.9249 & 7286.587 & 0.1651 & 0.7215 & 0.5353 & 0.5353 \tabularnewline
111 & 6887.2 & 7058.894 & 6773.3725 & 7344.4156 & 0.1193 & 0.7994 & 0.5994 & 0.5456 \tabularnewline
112 & 6881.1 & 7064.7408 & 6727.7488 & 7401.7328 & 0.1427 & 0.8491 & 0.6495 & 0.5522 \tabularnewline
113 & 6890.9 & 7067.8357 & 6679.8029 & 7455.8684 & 0.1857 & 0.8272 & 0.6664 & 0.5515 \tabularnewline
114 & 6947.7 & 7073.8357 & 6635.4015 & 7512.2698 & 0.2864 & 0.7933 & 0.7302 & 0.5562 \tabularnewline
115 & 6887.5 & 7081.8938 & 6592.2278 & 7571.5597 & 0.2183 & 0.7044 & 0.7821 & 0.5631 \tabularnewline
116 & 6937.1 & 7089.4395 & 6549.1947 & 7629.6844 & 0.2902 & 0.7681 & 0.7751 & 0.568 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301290&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]7034.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]7018.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]7024.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]7028.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]7042.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]7022.2[/C][C]7045.2069[/C][C]6962.8182[/C][C]7127.5955[/C][C]0.2921[/C][C]0.5285[/C][C]0.7366[/C][C]0.5285[/C][/ROW]
[ROW][C]108[/C][C]6998.7[/C][C]7048.2827[/C][C]6914.3238[/C][C]7182.2417[/C][C]0.2341[/C][C]0.6486[/C][C]0.6366[/C][C]0.5355[/C][/ROW]
[ROW][C]109[/C][C]6982.7[/C][C]7048.9257[/C][C]6864.911[/C][C]7232.9403[/C][C]0.2403[/C][C]0.7037[/C][C]0.5874[/C][C]0.5286[/C][/ROW]
[ROW][C]110[/C][C]6936.6[/C][C]7052.7559[/C][C]6818.9249[/C][C]7286.587[/C][C]0.1651[/C][C]0.7215[/C][C]0.5353[/C][C]0.5353[/C][/ROW]
[ROW][C]111[/C][C]6887.2[/C][C]7058.894[/C][C]6773.3725[/C][C]7344.4156[/C][C]0.1193[/C][C]0.7994[/C][C]0.5994[/C][C]0.5456[/C][/ROW]
[ROW][C]112[/C][C]6881.1[/C][C]7064.7408[/C][C]6727.7488[/C][C]7401.7328[/C][C]0.1427[/C][C]0.8491[/C][C]0.6495[/C][C]0.5522[/C][/ROW]
[ROW][C]113[/C][C]6890.9[/C][C]7067.8357[/C][C]6679.8029[/C][C]7455.8684[/C][C]0.1857[/C][C]0.8272[/C][C]0.6664[/C][C]0.5515[/C][/ROW]
[ROW][C]114[/C][C]6947.7[/C][C]7073.8357[/C][C]6635.4015[/C][C]7512.2698[/C][C]0.2864[/C][C]0.7933[/C][C]0.7302[/C][C]0.5562[/C][/ROW]
[ROW][C]115[/C][C]6887.5[/C][C]7081.8938[/C][C]6592.2278[/C][C]7571.5597[/C][C]0.2183[/C][C]0.7044[/C][C]0.7821[/C][C]0.5631[/C][/ROW]
[ROW][C]116[/C][C]6937.1[/C][C]7089.4395[/C][C]6549.1947[/C][C]7629.6844[/C][C]0.2902[/C][C]0.7681[/C][C]0.7751[/C][C]0.568[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301290&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301290&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])
1027034.6-------
1037018.6-------
1047024.4-------
1057028.2-------
1067042.2-------
1077022.27045.20696962.81827127.59550.29210.52850.73660.5285
1086998.77048.28276914.32387182.24170.23410.64860.63660.5355
1096982.77048.92576864.9117232.94030.24030.70370.58740.5286
1106936.67052.75596818.92497286.5870.16510.72150.53530.5353
1116887.27058.8946773.37257344.41560.11930.79940.59940.5456
1126881.17064.74086727.74887401.73280.14270.84910.64950.5522
1136890.97067.83576679.80297455.86840.18570.82720.66640.5515
1146947.77073.83576635.40157512.26980.28640.79330.73020.5562
1156887.57081.89386592.22787571.55970.21830.70440.78210.5631
1166937.17089.43956549.19477629.68440.29020.76810.77510.568







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1070.006-0.00330.00330.0033529.315200-0.65220.6522
1080.0097-0.00710.00520.00522458.44561493.880438.6507-1.40551.0288
1090.0133-0.00950.00660.00664385.83772457.866149.5769-1.87731.3116
1100.0169-0.01670.00910.009113492.19855216.449272.225-3.29261.8069
1110.0206-0.02490.01230.012229478.841710068.9277100.344-4.86692.4189
1120.0243-0.02670.01470.014633723.930814011.4282118.3699-5.20562.8833
1130.028-0.02570.01630.016131306.227116482.1138128.3827-5.01553.1879
1140.0316-0.01820.01650.016315910.20616410.6253128.104-3.57553.2364
1150.0353-0.02820.01780.017637788.945218785.9942137.062-5.51043.489
1160.0389-0.0220.01820.01823207.337419228.1285138.6655-4.31833.572

\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.006 & -0.0033 & 0.0033 & 0.0033 & 529.3152 & 0 & 0 & -0.6522 & 0.6522 \tabularnewline
108 & 0.0097 & -0.0071 & 0.0052 & 0.0052 & 2458.4456 & 1493.8804 & 38.6507 & -1.4055 & 1.0288 \tabularnewline
109 & 0.0133 & -0.0095 & 0.0066 & 0.0066 & 4385.8377 & 2457.8661 & 49.5769 & -1.8773 & 1.3116 \tabularnewline
110 & 0.0169 & -0.0167 & 0.0091 & 0.0091 & 13492.1985 & 5216.4492 & 72.225 & -3.2926 & 1.8069 \tabularnewline
111 & 0.0206 & -0.0249 & 0.0123 & 0.0122 & 29478.8417 & 10068.9277 & 100.344 & -4.8669 & 2.4189 \tabularnewline
112 & 0.0243 & -0.0267 & 0.0147 & 0.0146 & 33723.9308 & 14011.4282 & 118.3699 & -5.2056 & 2.8833 \tabularnewline
113 & 0.028 & -0.0257 & 0.0163 & 0.0161 & 31306.2271 & 16482.1138 & 128.3827 & -5.0155 & 3.1879 \tabularnewline
114 & 0.0316 & -0.0182 & 0.0165 & 0.0163 & 15910.206 & 16410.6253 & 128.104 & -3.5755 & 3.2364 \tabularnewline
115 & 0.0353 & -0.0282 & 0.0178 & 0.0176 & 37788.9452 & 18785.9942 & 137.062 & -5.5104 & 3.489 \tabularnewline
116 & 0.0389 & -0.022 & 0.0182 & 0.018 & 23207.3374 & 19228.1285 & 138.6655 & -4.3183 & 3.572 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301290&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.006[/C][C]-0.0033[/C][C]0.0033[/C][C]0.0033[/C][C]529.3152[/C][C]0[/C][C]0[/C][C]-0.6522[/C][C]0.6522[/C][/ROW]
[ROW][C]108[/C][C]0.0097[/C][C]-0.0071[/C][C]0.0052[/C][C]0.0052[/C][C]2458.4456[/C][C]1493.8804[/C][C]38.6507[/C][C]-1.4055[/C][C]1.0288[/C][/ROW]
[ROW][C]109[/C][C]0.0133[/C][C]-0.0095[/C][C]0.0066[/C][C]0.0066[/C][C]4385.8377[/C][C]2457.8661[/C][C]49.5769[/C][C]-1.8773[/C][C]1.3116[/C][/ROW]
[ROW][C]110[/C][C]0.0169[/C][C]-0.0167[/C][C]0.0091[/C][C]0.0091[/C][C]13492.1985[/C][C]5216.4492[/C][C]72.225[/C][C]-3.2926[/C][C]1.8069[/C][/ROW]
[ROW][C]111[/C][C]0.0206[/C][C]-0.0249[/C][C]0.0123[/C][C]0.0122[/C][C]29478.8417[/C][C]10068.9277[/C][C]100.344[/C][C]-4.8669[/C][C]2.4189[/C][/ROW]
[ROW][C]112[/C][C]0.0243[/C][C]-0.0267[/C][C]0.0147[/C][C]0.0146[/C][C]33723.9308[/C][C]14011.4282[/C][C]118.3699[/C][C]-5.2056[/C][C]2.8833[/C][/ROW]
[ROW][C]113[/C][C]0.028[/C][C]-0.0257[/C][C]0.0163[/C][C]0.0161[/C][C]31306.2271[/C][C]16482.1138[/C][C]128.3827[/C][C]-5.0155[/C][C]3.1879[/C][/ROW]
[ROW][C]114[/C][C]0.0316[/C][C]-0.0182[/C][C]0.0165[/C][C]0.0163[/C][C]15910.206[/C][C]16410.6253[/C][C]128.104[/C][C]-3.5755[/C][C]3.2364[/C][/ROW]
[ROW][C]115[/C][C]0.0353[/C][C]-0.0282[/C][C]0.0178[/C][C]0.0176[/C][C]37788.9452[/C][C]18785.9942[/C][C]137.062[/C][C]-5.5104[/C][C]3.489[/C][/ROW]
[ROW][C]116[/C][C]0.0389[/C][C]-0.022[/C][C]0.0182[/C][C]0.018[/C][C]23207.3374[/C][C]19228.1285[/C][C]138.6655[/C][C]-4.3183[/C][C]3.572[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301290&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301290&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.006-0.00330.00330.0033529.315200-0.65220.6522
1080.0097-0.00710.00520.00522458.44561493.880438.6507-1.40551.0288
1090.0133-0.00950.00660.00664385.83772457.866149.5769-1.87731.3116
1100.0169-0.01670.00910.009113492.19855216.449272.225-3.29261.8069
1110.0206-0.02490.01230.012229478.841710068.9277100.344-4.86692.4189
1120.0243-0.02670.01470.014633723.930814011.4282118.3699-5.20562.8833
1130.028-0.02570.01630.016131306.227116482.1138128.3827-5.01553.1879
1140.0316-0.01820.01650.016315910.20616410.6253128.104-3.57553.2364
1150.0353-0.02820.01780.017637788.945218785.9942137.062-5.51043.489
1160.0389-0.0220.01820.01823207.337419228.1285138.6655-4.31833.572



Parameters (Session):
par1 = 10 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 4 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 10 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 4 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '1'
par8 <- '0'
par7 <- '1'
par6 <- '1'
par5 <- '4'
par4 <- '1'
par3 <- '1'
par2 <- '1'
par1 <- '19'
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')