Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data:
1021.3 1039.79 938.12 947.36 956.6 956.6 942.74 951.98 919.63 901.15 887.28 836.45 841.07 836.45 831.83 817.97 771.75 707.05 716.3 725.54 716.3 707.05 716.3 780.99 859.56 961.22 938.12 988.95 910.39 901.15 896.53 910.39 988.95 988.95 965.85 975.09 1002.82 1025.92 1081.38 1164.56 1201.53 1229.26 1275.47 1275.47 1307.82 1252.36 1261.61 1340.17 1414.11 1409.49 1432.59 1520.4 1529.64 1455.7 1427.97 1538.88 1612.82 1635.93 1603.58 1589.72 1557.37 1589.72 1668.28 1635.93 1615.68 1644.69 1622.71 1626.11 1705.55 1841.35 2029.03 2024.21 1952.87 2153.06 2339.29 2502.89 2515.37 2445.68 2491.11 2691.32 2651.8 2593.49 2697.23 2751.63 2713.9 2747.21 2982.32 3063.39 3058.7 3074.38 3341.06 3500.03 392.88 3071.52 2516.41 2350.7 2488.68 2872.65 3220.21 3078.04 3043.98 3134.34 3141.85 3128.01 3241.16 3389.48 3406.36 3449.84 3606.24 3653.99 3607.31 3712.52 3803.47 3806.33 3768.4 3952.06 4134.85 4060.9 3999.88 4004.03 3977.34 3650.08 3708.85 3764.78 3761.86 3802.55 3773.52 3428.7 3194.21 3095.56 3064.85 3022.98 2887.66 3178.86 3438.47 3493.87 3421.89 3390.28 3319.24 3287.84 3222.82 3182.69 3180.21 3116.34 3297.46 3357.48 3386.03 3319.45 3363.59 3303.47 3210.55 3050.27 3010.55 3011.65 3104.98 3087.85 3160.16 3319.22 3432.49 3475.68 3347.48 3388.81 3610.23 3691.45 3587.86 3704.62 3798.75 3956.54 4121.94 4148.56 4100.37 4060.71 4147.86 3926.61 3865.41 3978.57 3851.95 3701.22 3738.65 3766.9 3711.02 3675.22 3560.53 3723.8 3914.27 3870.77 3924.36 3968.89 3982.93 3917.09 3969.18 4149.81 4406.88 423.82 417.72 4527.16 4617.39 4656.23 4579.9 4652.4 4722.95 4845.81 4975.21 5083.64 5378.04 5684.44 5841.87 5857.23 6174.52 6413.17 6780.11 6524.94 6466.7 6495.61 6399.52 6729.98 7060.77 7423.27 8069.17 8650.68 8938.07 9482.08 10225.26 9390.27 8546.11 8073.77 8655.31 9150.1 9775.81 9785.14 9363.44 9304.18 9030.26 8920.8 8606.08 8353.75 8615.63 8128.64 8715.94 8500.8 8142.58 7614.66 7558.95 7820.75 7828.9 7904.59 8140.97 8483.01 8322.68 8268.01 8402.05 8177.78 7950.54 8049.94 7674.13 7666.36 7570.18 7694.45 7810.64 7748.43 7040.64 7077.26 7245.51 7289.12 7486.92 7519.88 7554.84 7780.89 7748.09 7152.25 6484.66 6254.58 5867.32 5544.16 5822.74 5690.63 5564.78 5088.39 4784.22 5332.46 5541.48 5723.92 5736.99 5992.07 6091.43 6158.17 6303.79 6349.71 6802.96 7132.68 7073.29 7264.5 7105.33 7218.71 7225.72 7354.25 7745.46 8070.26 8366.33 8667.51 8854.34 9218.1 9332.9 9358.31 9248.66 9401.2 9652.04 9957.38 10110.63 10169.26 10343.78 10750.21 11337.5 11786.96 12083.04 12007.74 11745.93 11051.51 11445.9 11924.88 12247.63 12690.91 12910.7 13202.12 13654.67 13862.82 13523.93 14211.17 14510.35 14289.23 14111.82 13086.59 13351.54 13747.69 12855.61 12926.93 12121.95 11731.65 11639.51 12163.78 12029.53 11234.18 9852.13 9709.04 9332.75 7108.6 6691.49 6143.05 6379.15 5994.58 5607.94 6046.13 6624.96 6652.54 6696 7315.16 7907.79 8066.35 7939.64 8068.48 8186.33 7975.21 8357.51 8463.38 7937.68 8034.62 8056.61 8176.95 8441.04 8697.39 8665.57 8625.77 8718.42 8822.34 8597.67 8782.05 8661.06 8265.32 8072.58 721.85 7138.6 7351.11 7077 7272.37 7577.84
Sample Range:
(leave blank to include all observations)
From:
To:
Testing Period
(?)
12
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)
0.0
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)
12
1
2
3
4
6
12
AR(p) order
1
0
1
2
3
MA(q) order
1
0
1
2
SAR(P) order
0
0
1
2
SMA(Q) order
0
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,par1)) (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.mape1 <- 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) 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.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.mse[1] = abs(perf.se[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.mse[i] = perf.mse[i-1] + perf.se[i] perf.mse1[i] = perf.mse[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',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.mape1[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.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