Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data:
2284.86 2329.22 2324.32 2331.88 2323.48 2349.66 2338.19 2329.51 2356.45 2359.05 2376.87 2371.3 2380.9 2398.76 2390.53 2384.47 2423.07 2443.72 2432.93 2446.05 2435.79 2470.14 2459.26 2452.06 2419.01 2428.28 2446.16 2430.2 2411.93 2428.05 2433.91 2427.07 2423.01 2429.02 2398.58 2382.61 2391.12 2412 2451.78 2442.34 2444.92 2472.5 2473.55 2501.22 2487.99 2479.03 2466.04 2480.94 2469.12 2407.79 2435.97 2426.38 2426.49 2458.23 2463.16 2493.26 2485.9 2504.12 2504.02 2510.32 2499.32 2525.42 2508.44 2485.87 2489.09 2501.22 2494.4 2495.18 2503.26 2530.02 2509.71 2511.78 2545.94 2538.38 2524.18 2535.52 2536.52 2545.91 2550.18 2538.26 2532.41 2537.17 2506.46 2505.25 2502.31 2457.49 2468.91 2479.53 2472.64 2469.38 2468.78 2496.17 2519.73 2528.75 2537.33 2550 2570.78 2556.87 2560.46 2542.24 2558.3 2551.45 2527.31 2542.8 2532.83 2546.25 2552.53 2557.43 2558.81 2546.35 2568.88 2567.47 2548.83 2546.12 2549.29 2554.29 2539.67 2540.11 2566.43 2572.96 2573.69 2551.62 2561.39 2564 2572.25 2568.95 2577.39 2583.49 2551.04 2562.18 2567.43 2575.54 2544.26 2550.53 2469.79 2497.19 2506.22 2520.19 2482.4 2475.07 2447.8 2465 2470.34 2477.81 2457.48 2473.35 2494.46 2508.65 2520.93 2522.47 2531.89 2538.15 2525.64 2528.18 2539.41 2538.68 2546.33 2548.36 2562.76 2560.26 2543.74 2557.26 2555.16 2552.36 2558.84 2563.16 2560.06 2543.83 2532.88 2510.77 2532.39 2529.54 2517 2548.73 2570.95 2566.8 2570.32 2595.96 2629.87 2628.08 2625.7 2624.44 2646.1 2628.6 2638.45 2658.97 2666.55 2659.04 2651.85 2655.73 2676.5 2683.28 2702.64 2691.17 2702.99 2680.75 2686.03 2693.88 2728.45 2714.9 2716.26 2734.82 2729.03 2718.98 2699.53 2678.43 2674.22 2703.83 2673.62 2678.73 2659.25 2683.25 2671.86 2691.29 2729.19 2713.22 2739.83 2728.32 2734.3 2773.43 2777.01 2795.8 2763.84 2764.09 2774.5 2772.34 2763.69 2799.19 2810.64 2797.03 2817.49 2845.52 2858.6 2886.98 2866.06 2909.91 2791.96 2857.24 2891 2841.05 2847.08 2799.71 2855.79 2815.13 2820.75 2807.75 2854.45 2845.57 2852.88 2888.69 2848.77 2859.28 2881.32 2886.13 2906.34 2892.63 2933.39 2954.95 2948.88 2988.45 2993.31 3001.37 3030.68 2976.71 3028.67 3033.45 2998.24 2994.53 2989.33 2999.2 3017.32 3035.15 3062.29 3067.06 3098 3104.14 3138.01 3184.36 3187.58 3216.14 3229.48 3248.18 3232.57 3276.16 3233.75 3196.03 3184.09 3184.21 3233.21 3237.87 3276.72 3259.64 3263.86 3320.66 3364.99 3417.6 3376.2 3436.06 3460.58 3415.4 3349.81 3359.29 3350.99 3291.19 3315.93 3264.67 3298.24 3321.84 3349.14 3418.12 3429.04 3295.93 3301.91 3215.24 3244.93 3312.88 3329.76 3359.46 3351.49 3340.05 3279.9 3327.68 3353.45 3383.25 3344.39 3347.58 3340.33 3395.95 3397.36 3374.1 3363.06 3383.19 3438.07 3460.37 3528.78 3568.28 3551.98 3562.41 3575.37 3595.14 3573.69 3562.11 3604.54 3543.43 3596.08 3579.42 3602.18 3657.86 3664.94 3636.41 3547.84 3605.62 3625.74 3661.84 3673.03 3695.29 3667.43 3665.01 3677.43 3707.99 3744.44 3765.11 3741.48 3730.27 3749.27 3788.27 3754.72 3755.82 3798.5 3805.29 3795.41 3785.77 3819.85 3854.76 3887.39 3942.53 3972.84 4006.4 4055.86 3992.38 4040.97 4124.19 4121.13 4201.24 4227.31 4196.53 4090.06 4230.42 4406.09 4335.74 4317.64 4371.16 4381.69 4421.72 4438.93 4408.79 4296.94 4302.68 4335.39 4414.35 4354.15 4333.13 4363.09 4278.48 4231.43 4152.86 4078.6 4169.62 4223.43 4253.67 4086.01 4071.79 3959.33 3995.66 3973.65 3906.02 3989.96 4047.37 4103.65 4071.68 4100.67 4068.01 4094.39 4050.14 3972.55 3854.81 3820.13 3898.95 4010.48 4000.48 4032.97 4088.92 4098.2 4102.39 4148.58 4080.78 4104.27 4167.85 4196.97 4273.71 4273.71 4302.13 4307.39 4347.24 4243.01 4188.52 4231.4 4202.37 4193.69 4118.22 4061.5 4040.75 4139.5 4171.45 3977.26 4050.87 3879.12 3567.22 3791.81 3727.4 3726.69 3854.07 3812.45 3866.68 3823.91 3699.89 3752.53 3731.08 3659.27 3704.29 3730.94 3794.61 3833.47 3834.82 3915.94 3959.69 3830.63 3849.23 3916.53 3953.84 3949.14 4068.05 4072.96 4082.89 4139.8 4170.08 4223.36 4184.91 4117.27 4030.16 4082.6 4060.04 4083.97 4158.68 4166.24 4084.75 4043.02 4121.79 4197.37 4249.69 4315.37 4384.81 4352.63 4391.54 4347.23 4236.94 4087.28 4159.4 4190.08 4148.34 4184.46 4284.94 4307.91 4282.84 4220.25 4237.31 4224.78 4278.76 4391.02 4419.38 4440.38 4522.81 4532.52 4486.95 4548.46 4496.33 4563.55 4523.75 4588.43 4536.83 4502.48 4520.64 4602.4 4628.83 4582.4 4602.65 4657.54 4599.54 4635.82 4692.03 4709.83 4736.74 4757.14 4709.58 4623.4 4715.95 4780.83 4834.43 4832.76 4839.6 4889.65 4883.85 4946.68 4919.72 4936.32 5001.55 4971.32 5028.24 5096.62 5039.76 5083.16 5009.76 5102.35 5154.21 5176.66 5223.52 5271.65 5357.05 5269.46 5317.22 5374.78 5388.47 5324.14 5268.75 5442 5388.93 5360.65 5251.46 5144.28 5088.13 5018.67 5108.48 5107.44 5314.66 5232.03 5229.8 5186.22 5257.58 5341.69 5297.35 5376.88 5361.22 5393.14 5342.85 5388.89 5510.97 5564.21 5575.16 5644.29 5490.64 5481.26 5569.08 5582.78 5613.76 5592.48 5688.5 5779.09 5760.02 5754.46 5670.83 5527.32 5591.57 5709.36 5718.06 5702.61 5654.74 5718.71 5779.91 5866.63 5870.42 5915.13 5897.44 5906.85 5904.1 5953.16 5918.37 5960.98 6013.14 5996.77 5982.42 6019.48 6095.28 6108.24 6094.02 6147.86 6171.43 6165.52 6110.73 6058.45 6035.28 5885 5889.01 5853.63 5880.87 5873.92 5758.77 5756.19 5632.51 5517.64 5560.55 5476.25 5268.4 5402.37 5356.22 5447.9 5456.58 5568.88 5596.4 5488.22 5163.51 5234.88 5371.76 5231.61 5060.84 4993.54 4833.89 4791.81 4970.5 4812.18 4820.25 4923.37 5103.84 5040.87 4747.33 4737.15 4896.49 4831.22 4857.97 4669.51 4598.58 4433.87 4575.15 4699.39 4646.25 4561.58 4653.93 4578.27 4474.51 4226.49 3962.5 4034.23 4156.64 4087.83 3896.08 3983.65 4225.49 4274.48 4318.52 4399.05 4489.1 4458.4 4595.82 4523.24 4454.28 4451.09 4577.74 4682.45 4536.34 4549.33 4671.12 4761.15 4705.08 4841.72 4811.6 4836.22 4768.58 4662.78 4717.7 4639.89 4639.65 4783.77 4702.63 4698.72 4795.69 4911.88 5019.12 4958.82 4944.37 5051.63 5121.48 5022.7 4781.72 4691.69 4787.08 4775.23 4713.96 4699.34 4663.68 4642.68 4536.2 4522.86 4574.5 4663.45 4723.81 4629.23 4780.93 4825.38 4951.77 4951.77 4951.77 5044.77 5031.87 5252.36 5253.91 5443.62 5323.21 5392.84 5270.6 5200.1 4931.8 4912.75 4960.22 5050.4 5073.15 5143.06 5156.67 5019.28 4982.45 4986.8 5061.18 5096.41 5190.82 5166.87 5085.66 5077.85 5080.77 5027.22 4904.35 4796.82 4839.33 4888.74 4879.55 4904.68 4810.09 4845.08 4802.38 4845.18 4987.56 5062.31 4958.58 4911.81 4784.31 4804.02 4697.67 4678.72 4839.09 4788.68 4758.46 4721.41 4754.41 5008.16 5029.24 5094.63 5077.43 5013.62 5099.48 5027.06 4915.02 4780.13 4860.26 4775.17 4876.92 4856.84 4884.2 4914.59 4965.29 5052.27 5068.75 5124.18 5159.16 5199.18 5182.16 5181.01 5155.35 5220.14 5087.29 5163.29 5218.82 5195.42 5256.22 5347.5 5348.61 5334.42 5393.1 5377.56 5383.21 5307.22 5274.45 5297.38 5205.95 5249.15 5248.02 5173.25 5114.47 5154.94 5181.51 5235.64 5264.68 5143.1 5160.44 5083.83 5068.73 5069.83 5021.24 4997.83 5107.81 5190.14 5211.08 5253.89 5206.47 5262.14 5268.87 5342.86 5381.25 5412 5430.32 5430.32 5430.32
Include mean?
1
FALSE
TRUE
Box-Cox lambda transformation parameter (lambda)
2
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)
0
0
1
2
Degree of seasonal differencing (D)
12
0
1
Seasonal Period (s)
1
2
3
4
6
12
Maximum AR(p) order
0
1
2
3
Maximum MA(q) order
0
1
Maximum SAR(P) order
0
1
2
Maximum SMA(Q) order
0
1
Chart options
R Code
par9 <- '1' par8 <- '2' par7 <- '1' par6 <- '3' par5 <- '12' par4 <- '0' par3 <- '2' par2 <- '-1.2' par1 <- 'FALSE' library(lattice) if (par1 == 'TRUE') par1 <- TRUE if (par1 == 'FALSE') par1 <- FALSE par2 <- as.numeric(par2) #Box-Cox lambda transformation parameter 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) #degree (p) of the non-seasonal AR(p) polynomial par7 <- as.numeric(par7) #degree (q) of the non-seasonal MA(q) polynomial par8 <- as.numeric(par8) #degree (P) of the seasonal AR(P) polynomial par9 <- as.numeric(par9) #degree (Q) of the seasonal MA(Q) polynomial armaGR <- function(arima.out, names, n){ try1 <- arima.out$coef try2 <- sqrt(diag(arima.out$var.coef)) try.data.frame <- data.frame(matrix(NA,ncol=4,nrow=length(names))) dimnames(try.data.frame) <- list(names,c('coef','std','tstat','pv')) try.data.frame[,1] <- try1 for(i in 1:length(try2)) try.data.frame[which(rownames(try.data.frame)==names(try2)[i]),2] <- try2[i] try.data.frame[,3] <- try.data.frame[,1] / try.data.frame[,2] try.data.frame[,4] <- round((1-pt(abs(try.data.frame[,3]),df=n-(length(try2)+1)))*2,5) vector <- rep(NA,length(names)) vector[is.na(try.data.frame[,4])] <- 0 maxi <- which.max(try.data.frame[,4]) continue <- max(try.data.frame[,4],na.rm=TRUE) > .05 vector[maxi] <- 0 list(summary=try.data.frame,next.vector=vector,continue=continue) } arimaSelect <- function(series, order=c(13,0,0), seasonal=list(order=c(2,0,0),period=12), include.mean=F){ nrc <- order[1]+order[3]+seasonal$order[1]+seasonal$order[3] coeff <- matrix(NA, nrow=nrc*2, ncol=nrc) pval <- matrix(NA, nrow=nrc*2, ncol=nrc) mylist <- rep(list(NULL), nrc) names <- NULL if(order[1] > 0) names <- paste('ar',1:order[1],sep='') if(order[3] > 0) names <- c( names , paste('ma',1:order[3],sep='') ) if(seasonal$order[1] > 0) names <- c(names, paste('sar',1:seasonal$order[1],sep='')) if(seasonal$order[3] > 0) names <- c(names, paste('sma',1:seasonal$order[3],sep='')) arima.out <- arima(series, order=order, seasonal=seasonal, include.mean=include.mean, method='ML') mylist[[1]] <- arima.out last.arma <- armaGR(arima.out, names, length(series)) mystop <- FALSE i <- 1 coeff[i,] <- last.arma[[1]][,1] pval [i,] <- last.arma[[1]][,4] i <- 2 aic <- arima.out$aic while(!mystop){ mylist[[i]] <- arima.out arima.out <- arima(series, order=order, seasonal=seasonal, include.mean=include.mean, method='ML', fixed=last.arma$next.vector) aic <- c(aic, arima.out$aic) last.arma <- armaGR(arima.out, names, length(series)) mystop <- !last.arma$continue coeff[i,] <- last.arma[[1]][,1] pval [i,] <- last.arma[[1]][,4] i <- i+1 } list(coeff, pval, mylist, aic=aic) } arimaSelectplot <- function(arimaSelect.out,noms,choix){ noms <- names(arimaSelect.out[[3]][[1]]$coef) coeff <- arimaSelect.out[[1]] k <- min(which(is.na(coeff[,1])))-1 coeff <- coeff[1:k,] pval <- arimaSelect.out[[2]][1:k,] aic <- arimaSelect.out$aic[1:k] coeff[coeff==0] <- NA n <- ncol(coeff) if(missing(choix)) choix <- k layout(matrix(c(1,1,1,2, 3,3,3,2, 3,3,3,4, 5,6,7,7),nr=4), widths=c(10,35,45,15), heights=c(30,30,15,15)) couleurs <- rainbow(75)[1:50]#(50) ticks <- pretty(coeff) par(mar=c(1,1,3,1)) plot(aic,k:1-.5,type='o',pch=21,bg='blue',cex=2,axes=F,lty=2,xpd=NA) points(aic[choix],k-choix+.5,pch=21,cex=4,bg=2,xpd=NA) title('aic',line=2) par(mar=c(3,0,0,0)) plot(0,axes=F,xlab='',ylab='',xlim=range(ticks),ylim=c(.1,1)) rect(xleft = min(ticks) + (0:49)/50*(max(ticks)-min(ticks)), xright = min(ticks) + (1:50)/50*(max(ticks)-min(ticks)), ytop = rep(1,50), ybottom= rep(0,50),col=couleurs,border=NA) axis(1,ticks) rect(xleft=min(ticks),xright=max(ticks),ytop=1,ybottom=0) text(mean(coeff,na.rm=T),.5,'coefficients',cex=2,font=2) par(mar=c(1,1,3,1)) image(1:n,1:k,t(coeff[k:1,]),axes=F,col=couleurs,zlim=range(ticks)) for(i in 1:n) for(j in 1:k) if(!is.na(coeff[j,i])) { if(pval[j,i]<.01) symb = 'green' else if( (pval[j,i]<.05) & (pval[j,i]>=.01)) symb = 'orange' else if( (pval[j,i]<.1) & (pval[j,i]>=.05)) symb = 'red' else symb = 'black' polygon(c(i+.5 ,i+.2 ,i+.5 ,i+.5), c(k-j+0.5,k-j+0.5,k-j+0.8,k-j+0.5), col=symb) if(j==choix) { rect(xleft=i-.5, xright=i+.5, ybottom=k-j+1.5, ytop=k-j+.5, lwd=4) text(i, k-j+1, round(coeff[j,i],2), cex=1.2, font=2) } else{ rect(xleft=i-.5,xright=i+.5,ybottom=k-j+1.5,ytop=k-j+.5) text(i,k-j+1,round(coeff[j,i],2),cex=1.2,font=1) } } axis(3,1:n,noms) par(mar=c(0.5,0,0,0.5)) plot(0,axes=F,xlab='',ylab='',type='n',xlim=c(0,8),ylim=c(-.2,.8)) cols <- c('green','orange','red','black') niv <- c('0','0.01','0.05','0.1') for(i in 0:3){ polygon(c(1+2*i ,1+2*i ,1+2*i-.5 ,1+2*i), c(.4 ,.7 , .4 , .4), col=cols[i+1]) text(2*i,0.5,niv[i+1],cex=1.5) } text(8,.5,1,cex=1.5) text(4,0,'p-value',cex=2) box() residus <- arimaSelect.out[[3]][[choix]]$res par(mar=c(1,2,4,1)) acf(residus,main='') title('acf',line=.5) par(mar=c(1,2,4,1)) pacf(residus,main='') title('pacf',line=.5) par(mar=c(2,2,4,1)) qqnorm(residus,main='') title('qq-norm',line=.5) qqline(residus) residus } if (par2 == 0) x <- log(x) if (par2 != 0) x <- x^par2 (selection <- arimaSelect(x, order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5))) bitmap(file='test1.png') resid <- arimaSelectplot(selection) dev.off() resid bitmap(file='test2.png') acf(resid,length(resid)/2, main='Residual Autocorrelation Function') dev.off() bitmap(file='test3.png') pacf(resid,length(resid)/2, main='Residual Partial Autocorrelation Function') dev.off() bitmap(file='test4.png') cpgram(resid, main='Residual Cumulative Periodogram') dev.off() bitmap(file='test5.png') hist(resid, main='Residual Histogram', xlab='values of Residuals') dev.off() bitmap(file='test6.png') densityplot(~resid,col='black',main='Residual Density Plot', xlab='values of Residuals') dev.off() bitmap(file='test7.png') qqnorm(resid, main='Residual Normal Q-Q Plot') qqline(resid) dev.off() ncols <- length(selection[[1]][1,]) nrows <- length(selection[[2]][,1])-1 load(file='createtable') a<-table.start() a<-table.row.start(a) a<-table.element(a,'ARIMA Parameter Estimation and Backward Selection', ncols+1,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Iteration', header=TRUE) for (i in 1:ncols) { a<-table.element(a,names(selection[[3]][[1]]$coef)[i],header=TRUE) } a<-table.row.end(a) for (j in 1:nrows) { a<-table.row.start(a) mydum <- 'Estimates (' mydum <- paste(mydum,j) mydum <- paste(mydum,')') a<-table.element(a,mydum, header=TRUE) for (i in 1:ncols) { a<-table.element(a,round(selection[[1]][j,i],4)) } a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'(p-val)', header=TRUE) for (i in 1:ncols) { mydum <- '(' mydum <- paste(mydum,round(selection[[2]][j,i],4),sep='') mydum <- paste(mydum,')') a<-table.element(a,mydum) } 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,'Estimated ARIMA Residuals', 1,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Value', 1,TRUE) a<-table.row.end(a) for (i in (par4*par5+par3):length(resid)) { a<-table.row.start(a) a<-table.element(a,resid[i]) 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