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 computationFri, 16 Dec 2016 15:54:52 +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/16/t14819001035b854g2ccq4sbm6.htm/, Retrieved Thu, 02 May 2024 17:28:13 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300333, Retrieved Thu, 02 May 2024 17:28:13 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact67
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [] [2016-12-16 13:36:55] [683f400e1b95307fc738e729f07c4fce]
-    D  [ARIMA Backward Selection] [] [2016-12-16 14:17:56] [683f400e1b95307fc738e729f07c4fce]
- R  D    [ARIMA Backward Selection] [] [2016-12-16 14:51:40] [683f400e1b95307fc738e729f07c4fce]
- RM          [ARIMA Forecasting] [] [2016-12-16 14:54:52] [404ac5ee4f7301873f6a96ef36861981] [Current]
Feedback Forum

Post a new message
Dataseries X:
5100
5100
5050
5150
5150
5050
4800
4750
4900
4950
5050
4900
4950
4850
5100
5200
5450
5150
5150
5000
5200
5350
5600
5600
5650
5550
5700
5750
5850
5750
5700
5500
5750
5750
5750
5500
5750
5750
5900
6000
6150
5950
5900
5750
5750
5800
5800
5450
5400
5600
5600
5800
5650
5700
5550
5350
5800
5700
5950
5450
5400
5400
5450
5700
5850
5850
5700
5450
5800
5600
5700
5800
5750
5850
6250
6450
6550
6500
6150
6100
6300
6350
6250
6200
6250
6450
6050
6500
6600
6450




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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 time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300333&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]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=300333&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300333&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 time2 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[81])
695800-------
705600-------
715700-------
725800-------
735750-------
745850-------
756250-------
766450-------
776550-------
786500-------
796150-------
806100-------
816300-------
8263506184.46415909.73946459.18870.11880.204910.2049
8362506367.69356028.1986707.18910.24840.54070.99990.652
8462006210.2735758.39046662.15560.48220.43160.96240.3486
8562506152.65415589.90326715.4050.36730.43450.91960.3039
8664506194.66125551.68136837.6410.21820.4330.85330.3741
8760506432.68395736.02667129.34120.14080.48060.69640.6455
8865006661.58215918.6297404.53520.3350.94670.71160.8299
8966006790.21535996.43287583.99770.31930.76320.72350.8869
9064506762.56515914.26017610.87020.23510.64640.7280.8574

\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[81]) \tabularnewline
69 & 5800 & - & - & - & - & - & - & - \tabularnewline
70 & 5600 & - & - & - & - & - & - & - \tabularnewline
71 & 5700 & - & - & - & - & - & - & - \tabularnewline
72 & 5800 & - & - & - & - & - & - & - \tabularnewline
73 & 5750 & - & - & - & - & - & - & - \tabularnewline
74 & 5850 & - & - & - & - & - & - & - \tabularnewline
75 & 6250 & - & - & - & - & - & - & - \tabularnewline
76 & 6450 & - & - & - & - & - & - & - \tabularnewline
77 & 6550 & - & - & - & - & - & - & - \tabularnewline
78 & 6500 & - & - & - & - & - & - & - \tabularnewline
79 & 6150 & - & - & - & - & - & - & - \tabularnewline
80 & 6100 & - & - & - & - & - & - & - \tabularnewline
81 & 6300 & - & - & - & - & - & - & - \tabularnewline
82 & 6350 & 6184.4641 & 5909.7394 & 6459.1887 & 0.1188 & 0.2049 & 1 & 0.2049 \tabularnewline
83 & 6250 & 6367.6935 & 6028.198 & 6707.1891 & 0.2484 & 0.5407 & 0.9999 & 0.652 \tabularnewline
84 & 6200 & 6210.273 & 5758.3904 & 6662.1556 & 0.4822 & 0.4316 & 0.9624 & 0.3486 \tabularnewline
85 & 6250 & 6152.6541 & 5589.9032 & 6715.405 & 0.3673 & 0.4345 & 0.9196 & 0.3039 \tabularnewline
86 & 6450 & 6194.6612 & 5551.6813 & 6837.641 & 0.2182 & 0.433 & 0.8533 & 0.3741 \tabularnewline
87 & 6050 & 6432.6839 & 5736.0266 & 7129.3412 & 0.1408 & 0.4806 & 0.6964 & 0.6455 \tabularnewline
88 & 6500 & 6661.5821 & 5918.629 & 7404.5352 & 0.335 & 0.9467 & 0.7116 & 0.8299 \tabularnewline
89 & 6600 & 6790.2153 & 5996.4328 & 7583.9977 & 0.3193 & 0.7632 & 0.7235 & 0.8869 \tabularnewline
90 & 6450 & 6762.5651 & 5914.2601 & 7610.8702 & 0.2351 & 0.6464 & 0.728 & 0.8574 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300333&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[81])[/C][/ROW]
[ROW][C]69[/C][C]5800[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]5600[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]5700[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]5800[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]5750[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]5850[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]6250[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]6450[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]6550[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]6500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]6150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]6100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]6300[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]6350[/C][C]6184.4641[/C][C]5909.7394[/C][C]6459.1887[/C][C]0.1188[/C][C]0.2049[/C][C]1[/C][C]0.2049[/C][/ROW]
[ROW][C]83[/C][C]6250[/C][C]6367.6935[/C][C]6028.198[/C][C]6707.1891[/C][C]0.2484[/C][C]0.5407[/C][C]0.9999[/C][C]0.652[/C][/ROW]
[ROW][C]84[/C][C]6200[/C][C]6210.273[/C][C]5758.3904[/C][C]6662.1556[/C][C]0.4822[/C][C]0.4316[/C][C]0.9624[/C][C]0.3486[/C][/ROW]
[ROW][C]85[/C][C]6250[/C][C]6152.6541[/C][C]5589.9032[/C][C]6715.405[/C][C]0.3673[/C][C]0.4345[/C][C]0.9196[/C][C]0.3039[/C][/ROW]
[ROW][C]86[/C][C]6450[/C][C]6194.6612[/C][C]5551.6813[/C][C]6837.641[/C][C]0.2182[/C][C]0.433[/C][C]0.8533[/C][C]0.3741[/C][/ROW]
[ROW][C]87[/C][C]6050[/C][C]6432.6839[/C][C]5736.0266[/C][C]7129.3412[/C][C]0.1408[/C][C]0.4806[/C][C]0.6964[/C][C]0.6455[/C][/ROW]
[ROW][C]88[/C][C]6500[/C][C]6661.5821[/C][C]5918.629[/C][C]7404.5352[/C][C]0.335[/C][C]0.9467[/C][C]0.7116[/C][C]0.8299[/C][/ROW]
[ROW][C]89[/C][C]6600[/C][C]6790.2153[/C][C]5996.4328[/C][C]7583.9977[/C][C]0.3193[/C][C]0.7632[/C][C]0.7235[/C][C]0.8869[/C][/ROW]
[ROW][C]90[/C][C]6450[/C][C]6762.5651[/C][C]5914.2601[/C][C]7610.8702[/C][C]0.2351[/C][C]0.6464[/C][C]0.728[/C][C]0.8574[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300333&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300333&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[81])
695800-------
705600-------
715700-------
725800-------
735750-------
745850-------
756250-------
766450-------
776550-------
786500-------
796150-------
806100-------
816300-------
8263506184.46415909.73946459.18870.11880.204910.2049
8362506367.69356028.1986707.18910.24840.54070.99990.652
8462006210.2735758.39046662.15560.48220.43160.96240.3486
8562506152.65415589.90326715.4050.36730.43450.91960.3039
8664506194.66125551.68136837.6410.21820.4330.85330.3741
8760506432.68395736.02667129.34120.14080.48060.69640.6455
8865006661.58215918.6297404.53520.3350.94670.71160.8299
8966006790.21535996.43287583.99770.31930.76320.72350.8869
9064506762.56515914.26017610.87020.23510.64640.7280.8574







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
820.02270.02610.02610.026427402.1499000.88290.8829
830.0272-0.01880.02240.022513851.767720626.9588143.6209-0.62770.7553
840.0371-0.00170.01550.0156105.534613786.484117.4159-0.05480.5218
850.04670.01560.01550.01569476.220312708.9181112.73380.51920.5211
860.0530.03960.02030.020665197.909623206.7164152.33751.36180.6893
870.0553-0.06330.02750.0274146446.971243746.7589209.1573-2.0410.9146
880.0569-0.02490.02710.02726108.775641227.047203.0444-0.86180.907
890.0596-0.02880.02730.027136181.846440596.3969201.4855-1.01450.9204
900.064-0.04850.02970.029497696.9646940.9039216.6585-1.6671.0034

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
82 & 0.0227 & 0.0261 & 0.0261 & 0.0264 & 27402.1499 & 0 & 0 & 0.8829 & 0.8829 \tabularnewline
83 & 0.0272 & -0.0188 & 0.0224 & 0.0225 & 13851.7677 & 20626.9588 & 143.6209 & -0.6277 & 0.7553 \tabularnewline
84 & 0.0371 & -0.0017 & 0.0155 & 0.0156 & 105.5346 & 13786.484 & 117.4159 & -0.0548 & 0.5218 \tabularnewline
85 & 0.0467 & 0.0156 & 0.0155 & 0.0156 & 9476.2203 & 12708.9181 & 112.7338 & 0.5192 & 0.5211 \tabularnewline
86 & 0.053 & 0.0396 & 0.0203 & 0.0206 & 65197.9096 & 23206.7164 & 152.3375 & 1.3618 & 0.6893 \tabularnewline
87 & 0.0553 & -0.0633 & 0.0275 & 0.0274 & 146446.9712 & 43746.7589 & 209.1573 & -2.041 & 0.9146 \tabularnewline
88 & 0.0569 & -0.0249 & 0.0271 & 0.027 & 26108.7756 & 41227.047 & 203.0444 & -0.8618 & 0.907 \tabularnewline
89 & 0.0596 & -0.0288 & 0.0273 & 0.0271 & 36181.8464 & 40596.3969 & 201.4855 & -1.0145 & 0.9204 \tabularnewline
90 & 0.064 & -0.0485 & 0.0297 & 0.0294 & 97696.96 & 46940.9039 & 216.6585 & -1.667 & 1.0034 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300333&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]82[/C][C]0.0227[/C][C]0.0261[/C][C]0.0261[/C][C]0.0264[/C][C]27402.1499[/C][C]0[/C][C]0[/C][C]0.8829[/C][C]0.8829[/C][/ROW]
[ROW][C]83[/C][C]0.0272[/C][C]-0.0188[/C][C]0.0224[/C][C]0.0225[/C][C]13851.7677[/C][C]20626.9588[/C][C]143.6209[/C][C]-0.6277[/C][C]0.7553[/C][/ROW]
[ROW][C]84[/C][C]0.0371[/C][C]-0.0017[/C][C]0.0155[/C][C]0.0156[/C][C]105.5346[/C][C]13786.484[/C][C]117.4159[/C][C]-0.0548[/C][C]0.5218[/C][/ROW]
[ROW][C]85[/C][C]0.0467[/C][C]0.0156[/C][C]0.0155[/C][C]0.0156[/C][C]9476.2203[/C][C]12708.9181[/C][C]112.7338[/C][C]0.5192[/C][C]0.5211[/C][/ROW]
[ROW][C]86[/C][C]0.053[/C][C]0.0396[/C][C]0.0203[/C][C]0.0206[/C][C]65197.9096[/C][C]23206.7164[/C][C]152.3375[/C][C]1.3618[/C][C]0.6893[/C][/ROW]
[ROW][C]87[/C][C]0.0553[/C][C]-0.0633[/C][C]0.0275[/C][C]0.0274[/C][C]146446.9712[/C][C]43746.7589[/C][C]209.1573[/C][C]-2.041[/C][C]0.9146[/C][/ROW]
[ROW][C]88[/C][C]0.0569[/C][C]-0.0249[/C][C]0.0271[/C][C]0.027[/C][C]26108.7756[/C][C]41227.047[/C][C]203.0444[/C][C]-0.8618[/C][C]0.907[/C][/ROW]
[ROW][C]89[/C][C]0.0596[/C][C]-0.0288[/C][C]0.0273[/C][C]0.0271[/C][C]36181.8464[/C][C]40596.3969[/C][C]201.4855[/C][C]-1.0145[/C][C]0.9204[/C][/ROW]
[ROW][C]90[/C][C]0.064[/C][C]-0.0485[/C][C]0.0297[/C][C]0.0294[/C][C]97696.96[/C][C]46940.9039[/C][C]216.6585[/C][C]-1.667[/C][C]1.0034[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300333&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300333&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
820.02270.02610.02610.026427402.1499000.88290.8829
830.0272-0.01880.02240.022513851.767720626.9588143.6209-0.62770.7553
840.0371-0.00170.01550.0156105.534613786.484117.4159-0.05480.5218
850.04670.01560.01550.01569476.220312708.9181112.73380.51920.5211
860.0530.03960.02030.020665197.909623206.7164152.33751.36180.6893
870.0553-0.06330.02750.0274146446.971243746.7589209.1573-2.0410.9146
880.0569-0.02490.02710.02726108.775641227.047203.0444-0.86180.907
890.0596-0.02880.02730.027136181.846440596.3969201.4855-1.01450.9204
900.064-0.04850.02970.029497696.9646940.9039216.6585-1.6671.0034



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