Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data:
770.81 772.79 774.65 769.73 780.09 780.56 781.48 778.09 784.91 790.83 790.53 792.71 800.88 834.28 864.54 921.98 898.82 896.18 907.61 933.20 975.92 973.50 961.24 963.74 998.33 1021.75 1043.84 1154.73 1013.38 902.20 908.59 911.20 902.83 907.68 777.76 804.83 823.98 818.41 821.80 831.53 907.94 886.62 899.07 895.03 921.79 924.67 921.01 892.69 901.54 917.59 919.75 921.59 919.50 920.38 970.40 989.02 1011.80 1029.91 1042.90 1027.34 1038.15 1061.35 1063.07 994.38 988.67 1004.45 999.18 990.64 1004.55 1007.48 1027.44 1046.21 1054.42 1047.87 1079.98 1115.30 1117.44 1166.72 1173.68 1143.84 1165.20 1179.97 1179.97 1222.50 1251.01 1274.99 1255.15 1267.12 1272.83 1223.54 1150.00 1188.49 1116.72 1175.83 1221.38 1231.92 1240.00 1249.61 1187.81 1100.23 973.82 1036.74 1054.23 1120.54 1049.14 1038.59 937.52 972.78 966.73 1045.77 1047.15 1039.97 1026.43 1071.79 1080.50 1102.17 1143.81 1133.25 1124.78 1182.68 1176.90 1175.95 1187.87 1187.13 1205.01 1200.37 1169.28 1167.54 1172.52 1182.94 1193.91 1211.67 1210.29 1229.08 1222.05 1231.71 1207.21 1250.15 1265.49 1281.08 1317.73 1316.48 1321.79 1347.89 1421.60 1452.82 1490.09 1537.67 1555.45 1578.80 1596.71 1723.35 1755.36 1787.13 1848.57 1724.24 1804.91 1808.91 1738.43 1734.45 1839.09 1888.65 1987.71 2084.73 2041.20 2173.40 2320.42 2443.64 2304.98 2202.42 2038.87 2155.80 2255.61 2175.47 2286.41 2407.88 2488.55 2515.35 2511.81 2686.81 2863.20 2732.16 2805.62 2823.81 2947.71 2958.11 2659.63 2717.02 2506.37 2464.58 2518.56 2655.88 2548.29 2589.60 2721.79 2689.10 2705.41 2744.91 2608.72 2589.41 2478.45 2552.45 2574.79 2539.32 2480.84 2434.55 2506.47 2564.06 2601.64 2601.99 2608.56 2518.66 2571.34 2518.44 2372.56 2337.79 2398.84 2357.90 2233.34 1998.86 1929.82 2228.41 2318.88 2273.43 2817.60 2667.76 2810.12 2730.40 2754.86 2576.48 2529.45 2671.78 2809.01 2726.45 2757.18 2875.34 2718.26 2710.67 2804.73 2895.89 3252.91 3213.94 3378.94 3419.94 3342.47 3381.28 3650.62 3884.71 4073.26 4325.13 4181.93 4376.63 4331.69 4160.62 4193.70 4087.66 4001.74 4100.52 4151.52 4334.68 4371.60 4352.40 4382.88 4382.66 4579.02 4565.30 4703.39 4892.01 4578.77 4582.96 4236.31 4376.53 4597.12 4599.88 4228.75 4226.06 4122.94 4161.27 4130.81 3882.59 3154.95 3637.52 3625.04 3582.88 4065.20 3924.97 3905.95 3631.04 3630.70 3792.40 3682.84 3926.07 3892.35 4200.67 4174.73 4163.07 4338.71 4403.74 4409.32 4317.48 4229.36 4328.41 4370.81 4426.89 4610.48 4772.02 4781.99 4826.48 5446.91 5647.21 5831.79 5678.19 5725.59 5605.51 5590.69 5708.52 6011.45 6031.60 6008.42 5930.32 5526.64 5750.80 5904.83 5780.90 5753.09 6153.85 6130.53 6468.40 6767.31 7078.50 7207.76 7379.95 7407.41 7022.76 7144.38 7459.69 7143.58 6618.14 6357.60 5950.07 6559.49 6635.75 7315.54 7871.69 7708.99 7790.15 8036.49 8200.64 8071.26 8253.55 8038.77 8253.69 8790.92 9330.55 9818.35 10058.80 9888.61 10233.60 10975.60 11074.60 11323.20 11657.20 11916.70 14291.50 17899.70
Sample Range:
(leave blank to include all observations)
From:
To:
Testing Period
(?)
1
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)
12
0
1
Seasonal period (s)
1
2
3
4
6
12
AR(p) order
0
1
2
3
MA(q) order
0
1
2
SAR(P) order
0
1
2
SMA(Q) order
0
1
Include mean?
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*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<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',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')
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
1 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation