Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data:
122.36 123.33 123.04 124.53 125.13 125.85 126.50 126.53 127.07 124.55 124.90 124.32 122.84 123.31 123.31 124.87 124.64 124.73 124.90 124.04 123.28 123.86 122.29 124.09 124.54 125.65 125.70 125.53 125.61 125.55 125.41 127.60 124.68 124.41 126.43 126.38 125.78 124.70 125.07 125.25 126.58 127.13 125.82 123.70 124.39 123.70 124.42 121.05 121.02 123.23 121.32 120.91 120.72 123.31 119.58 119.53 120.59 118.63 118.47 111.81 114.71 117.34 115.77 118.38 117.84 118.83 120.02 116.21 117.08 120.20 119.83 118.92 118.03 117.71 119.55 116.13 115.97 115.99 114.96 116.46 116.55 113.05 117.44 118.84 117.06 117.54 119.31 118.72 121.55 122.61 121.53 123.31 124.07 123.59 122.97 123.22 123.04 122.96 122.81 122.81 122.62 120.82 119.41 121.56 121.59 118.50 118.77 118.86 117.60 119.90 121.83 121.84 122.12 122.12 121.36 119.66 119.32 120.36 117.06 117.48 115.60 113.86 116.92 117.75 117.75 115.31 116.28 115.22 115.65 115.11 118.67 118.04 116.50 119.78 119.95 120.37 119.79 119.43 121.06 121.74 121.09 122.97 120.50 117.18 115.03 113.36 112.59 111.65 111.98 114.87 114.67 114.09 114.77 117.05 117.22 113.18 110.95 112.14 112.72 110.01 110.29 110.74 110.32 105.89 108.97 109.34 106.57 99.49 101.81 104.29 109.73 105.06 107.97 108.13 109.86 108.95 111.20 110.69 106.10 105.68 104.12 104.71 104.30 103.52 107.76 107.80 107.30 108.64 105.03 108.30 107.21 109.27 109.50 111.68 111.80 111.75 106.68 106.37 105.76 109.01 109.01 109.01 109.01 107.69 105.19 105.48 102.22 100.54 105.00 105.44 107.89 108.64 106.70 109.10 105.23 108.41 108.80 110.39 110.22 110.86 108.58 107.70 106.62 109.84 107.16 107.26 108.70 109.85 109.41 112.36 111.03 110.67 109.21 113.58 113.88 114.08 112.33 113.92 114.41 114.57 115.35 113.13 113.29 112.56 113.06 113.46 115.39 116.62 117.04 117.42 115.62 115.16 115.69 112.85 114.05 112.00 113.74 116.26 118.63 116.49 118.23 116.83 118.82 114.36 112.02 113.24 109.75 110.33 112.86 113.04 113.80 110.90 109.96 108.69 108.84 108.47 108.07 107.94 108.11 108.11 106.81 105.58 105.61 106.52 103.86 104.60 104.73 105.12 104.76 103.85 103.83 103.22 101.64 102.13 104.33 104.92 107.78 104.49 102.80 102.86 104.51 104.73 102.58 99.93 101.41 101.05 99.86 101.11 100.89 101.09 98.31 98.08 99.55 99.62 97.37 98.16 97.98 98.15 97.10 97.24 96.70 96.64 100.65 96.75 97.74 97.92 98.34 93.84 97.80 96.20 95.99 95.18 95.95 92.23 91.78 92.97 89.76 92.88 96.23 95.79 93.97 93.90 93.60 93.96 88.69 88.57 85.62 86.25 85.33 83.33 77.78 78.70 72.05 80.75 81.41 82.65 75.85 75.70 78.25 77.41 76.84 74.25 74.95 68.78 73.21 73.26 78.67 75.63 74.99 83.87 79.62 80.13 79.76 78.20 78.05 79.05 73.32 75.17 73.26 73.72 73.57 70.60 71.25 74.22 73.32 73.01 74.21 75.32 71.73 71.94 72.94 72.47 71.94 74.30 74.30
Sample Range:
(leave blank to include all observations)
From:
To:
Testing Period
(?)
24
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Box-Cox lambda transformation parameter (lambda)
1
1
-2.0
-1.9
-1.8
-1.7
-1.6
-1.5
-1.4
-1.3
-1.2
-1.1
-1.0
-0.9
-0.8
-0.7
-0.6
-0.5
-0.4
-0.3
-0.2
-0.1
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
2.0
Degree of non-seasonal differencing (d)
1
0
1
2
Degree of seasonal differencing (D)
0
0
1
Seasonal period (s)
1
1
2
3
4
6
12
AR(p) order
2
0
1
2
3
MA(q) order
0
0
1
2
SAR(P) order
2
0
1
2
SMA(Q) order
1
0
1
Include mean?
FALSE
FALSE
TRUE
Chart options
R Code
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 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.mape <- array(0, dim=fx) perf.se <- array(0, dim=fx) perf.mse <- array(0, dim=fx) perf.rmse <- array(0, dim=fx) for (i in 1:fx) { locSD <- (ub[i] - forecast$pred[i]) / 1.96 perf.pe[i] = (x[nx+i] - forecast$pred[i]) / forecast$pred[i] perf.mape[i] = perf.mape[i] + abs(perf.pe[i]) perf.se[i] = (x[nx+i] - forecast$pred[i])^2 perf.mse[i] = perf.mse[i] + perf.se[i] 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 = perf.mape / fx perf.mse = perf.mse / fx perf.rmse = sqrt(perf.mse) 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:12] <- 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<br />(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',7,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,'Sq.E',1,header=TRUE) a<-table.element(a,'MSE',1,header=TRUE) a<-table.element(a,'RMSE',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.mape[i],4)) a<-table.element(a,round(perf.se[i],4)) a<-table.element(a,round(perf.mse[i],4)) a<-table.element(a,round(perf.rmse[i],4)) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable1.tab')
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation