R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(10 + ,10 + ,10 + ,10 + ,10 + ,9.94 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,9.94 + ,9.94 + ,9.94 + ,9.94 + ,9.94 + ,9.94 + ,10.06 + ,10.06 + ,9.94 + ,10.06 + ,10.06 + ,10.06 + ,10.18 + ,10.28 + ,10.28 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.28 + ,10.28 + ,10.18 + ,10.18 + ,10.18 + ,10.28 + ,10.28 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.18 + ,10.18 + ,10.28 + ,10.18 + ,10.18 + ,10.28 + ,10.18 + ,10.18 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.34 + ,10.34 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.34 + ,10.34 + ,10.34 + ,10.42 + ,10.42 + ,10.34 + ,10.34 + ,10.34 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.34 + ,10.34 + ,10.34 + ,10.34 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.34 + ,10.34 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.34 + ,10.42 + ,10.42 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.49 + ,10.49 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.49 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.49 + ,10.49 + ,10.55 + ,10.55 + ,10.55 + ,10.49 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.49 + ,10.49 + ,10.49 + ,10.55 + ,10.55 + ,10.55 + ,10.49 + ,10.55 + ,10.55 + ,10.55 + ,10.63 + ,10.63 + ,10.63 + ,10.63 + ,10.63 + ,10.57 + ,10.63 + ,10.63 + ,10.63 + ,10.63 + ,10.57 + ,10.57 + ,10.57 + ,10.63 + ,10.63 + ,10.63 + ,10.63 + ,10.57 + ,10.63 + ,10.63 + ,10.57 + ,10.63 + ,10.63 + ,10.63 + ,10.63 + ,10.57 + ,10.63 + ,10.6 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.6 + ,10.6 + ,10.6 + ,10.6 + ,10.7 + ,10.7 + ,10.6 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.8 + ,10.8 + ,10.8 + ,10.8 + ,10.7 + ,10.7 + ,10.7 + ,10.85 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.75 + ,10.75 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = 'FALSE' > ylab = '' > xlab = '' > main = '' > 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))) [[1]] [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.5682623 -0.004108468 0.04526521 -0.8499425 0.05896744 0.06829546 [2,] 0.5658443 0.000000000 0.04322891 -0.8500932 0.01305349 0.06888870 [3,] 0.5685829 0.000000000 0.04451208 -0.8517829 0.02032424 0.06894984 [4,] 0.5567877 0.000000000 0.04056310 -0.8428571 0.00000000 0.06856681 [5,] 0.5114020 0.000000000 0.00000000 -0.7980787 0.00000000 0.06842934 [6,] 0.4904463 0.000000000 0.00000000 -0.7819282 0.00000000 0.00000000 [7,] NA NA NA NA NA NA [8,] NA NA NA NA NA NA [9,] NA NA NA NA NA NA [10,] NA NA NA NA NA NA [11,] NA NA NA NA NA NA [12,] NA NA NA NA NA NA [13,] NA NA NA NA NA NA [14,] NA NA NA NA NA NA [,7] [1,] -0.039230029 [2,] 0.006884633 [3,] 0.000000000 [4,] 0.000000000 [5,] 0.000000000 [6,] 0.000000000 [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA [13,] NA [14,] NA [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0e+00 0.95152 0.50082 0 0.92566 0.23102 0.95040 [2,] 0e+00 NA 0.51633 0 0.98295 0.21802 0.99098 [3,] 0e+00 NA 0.50001 0 0.72074 0.21104 NA [4,] 0e+00 NA 0.54348 0 NA 0.21372 NA [5,] 0e+00 NA NA 0 NA 0.21570 NA [6,] 2e-05 NA NA 0 NA NA NA [7,] NA NA NA NA NA NA NA [8,] NA NA NA NA NA NA NA [9,] NA NA NA NA NA NA NA [10,] NA NA NA NA NA NA NA [11,] NA NA NA NA NA NA NA [12,] NA NA NA NA NA NA NA [13,] NA NA NA NA NA NA NA [14,] NA NA NA NA NA NA NA [[3]] [[3]][[1]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0.5683 -0.0041 0.0453 -0.8499 0.0590 0.0683 -0.0392 s.e. 0.1120 0.0675 0.0672 0.0955 0.6315 0.0569 0.6302 sigma^2 estimated as 0.001812: log likelihood = 606.26, aic = -1196.52 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0.5683 -0.0041 0.0453 -0.8499 0.0590 0.0683 -0.0392 s.e. 0.1120 0.0675 0.0672 0.0955 0.6315 0.0569 0.6302 sigma^2 estimated as 0.001812: log likelihood = 606.26, aic = -1196.52 [[3]][[3]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0.5658 0 0.0432 -0.8501 0.0131 0.0689 0.0069 s.e. 0.1101 0 0.0665 0.0862 0.6102 0.0558 0.6082 sigma^2 estimated as 0.001812: log likelihood = 606.26, aic = -1198.51 [[3]][[4]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0.5686 0 0.0445 -0.8518 0.0203 0.0689 0 s.e. 0.1083 0 0.0659 0.0845 0.0568 0.0550 0 sigma^2 estimated as 0.001812: log likelihood = 606.26, aic = -1200.52 [[3]][[5]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0.5568 0 0.0406 -0.8429 0 0.0686 0 s.e. 0.1084 0 0.0667 0.0858 0 0.0550 0 sigma^2 estimated as 0.001813: log likelihood = 606.19, aic = -1202.39 [[3]][[6]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0.5114 0 0 -0.7981 0 0.0684 0 s.e. 0.1090 0 0 0.0794 0 0.0552 0 sigma^2 estimated as 0.001815: log likelihood = 606.03, aic = -1204.05 [[3]][[7]] NULL $aic [1] -1196.523 -1198.513 -1200.515 -1202.387 -1204.050 -1204.518 Warning messages: 1: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 2: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 3: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 4: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 5: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE > postscript(file="/var/www/html/rcomp/tmp/1nxib1293545787.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > resid <- arimaSelectplot(selection) > dev.off() null device 1 > resid Time Series: Start = 1 End = 350 Frequency = 1 [1] 9.999994e-03 2.184669e-06 1.603581e-06 1.217787e-06 9.428654e-07 [6] -5.942692e-02 1.027763e-01 2.036755e-02 1.617859e-02 1.287331e-02 [11] 1.025446e-02 8.174037e-03 6.518588e-03 5.199937e-03 4.148926e-03 [16] 3.311016e-03 2.643101e-03 2.111155e-03 1.688539e-03 1.354892e-03 [21] -1.186240e-01 -3.342288e-02 -2.662769e-02 -2.116329e-02 -1.672792e-02 [26] -1.343658e-02 1.092663e-01 2.582333e-02 -9.938793e-02 1.061551e-01 [31] 1.303803e-02 1.460440e-02 1.316544e-01 1.437008e-01 6.354365e-02 [36] -4.928722e-02 1.118051e-01 3.808890e-02 3.039790e-02 -7.574007e-02 [41] 9.069366e-02 2.124046e-02 -8.304843e-02 -1.513898e-02 -3.870575e-03 [46] 9.271159e-02 2.285094e-02 -8.176315e-02 -1.411323e-02 -1.126347e-02 [51] -1.720065e-02 -9.528088e-03 6.073565e-04 8.807381e-02 2.334902e-02 [56] 1.863436e-02 -9.333984e-02 -2.599588e-02 -1.724727e-02 9.307825e-02 [61] -8.719885e-02 -1.495186e-02 8.806724e-02 -7.401268e-02 -1.827016e-02 [66] -1.108154e-02 9.799899e-02 2.357122e-02 1.881169e-02 8.170275e-03 [71] 1.002001e-02 1.483969e-02 -9.165625e-02 -2.200870e-02 -1.756467e-02 [76] -1.401799e-02 -1.118746e-02 -1.577141e-02 -9.087337e-03 -7.252410e-03 [81] 1.054940e-03 9.734243e-02 2.654672e-02 1.434344e-02 2.178962e-02 [86] 1.389034e-02 4.242653e-03 1.372840e-02 7.456850e-03 -9.404885e-02 [91] 6.923888e-02 7.617369e-03 6.079260e-03 4.851728e-03 -9.612794e-02 [96] 7.442254e-02 1.509778e-02 8.549724e-03 -9.317665e-02 -2.322210e-02 [101] 8.146694e-02 1.387683e-02 1.107480e-02 8.838563e-03 7.053870e-03 [106] -1.213391e-03 2.531109e-03 -9.797998e-02 7.294447e-02 7.075226e-03 [111] 5.646587e-03 1.445064e-01 4.373122e-02 4.174389e-02 2.297249e-02 [116] 2.183334e-02 1.742473e-02 1.390630e-02 1.794126e-02 3.976114e-03 [121] 6.672742e-03 -7.467463e-02 -1.184113e-02 -1.294965e-02 6.282223e-02 [126] 1.272441e-02 1.015508e-02 8.104555e-03 -7.353193e-02 6.222790e-02 [131] 8.750597e-03 1.382660e-02 6.922910e-04 4.051993e-03 3.233810e-03 [136] -6.999273e-03 -6.866844e-04 -5.480282e-04 -4.373697e-04 -3.490554e-04 [141] -2.785737e-04 -2.223238e-04 -1.774319e-04 -1.416046e-04 -1.130116e-04 [146] 5.384155e-03 -7.850261e-02 -2.173910e-02 -2.282386e-02 -1.541565e-02 [151] 6.769710e-02 1.311545e-02 -6.405849e-02 -1.848549e-02 -1.195329e-02 [156] 7.046033e-02 1.532073e-02 1.222715e-02 -7.024177e-02 -1.514630e-02 [161] -1.208794e-02 -9.647129e-03 -7.699168e-03 7.385546e-02 1.803031e-02 [166] 1.438961e-02 -6.851596e-02 6.623103e-02 1.194541e-02 9.533381e-03 [171] 1.308274e-02 7.641461e-03 6.098488e-03 4.867074e-03 -1.590039e-03 [176] 1.530616e-03 6.695899e-03 2.544262e-03 2.030522e-03 -3.853831e-03 [181] -8.027607e-02 -2.315446e-02 -1.300474e-02 6.682160e-02 1.241674e-02 [186] 9.909536e-03 7.908590e-03 8.373301e-04 3.467848e-03 2.767616e-03 [191] 7.683122e-03 -2.142203e-03 1.089946e-03 8.698625e-04 6.942188e-04 [196] 5.540412e-04 4.421685e-04 -7.964711e-02 -2.265251e-02 6.192152e-02 [201] 8.506083e-03 1.367885e-01 4.268575e-02 3.406659e-02 3.266217e-02 [206] 2.326739e-02 1.856921e-02 9.345344e-03 1.025791e-02 8.186622e-03 [211] 6.533569e-03 -5.478570e-02 -1.303918e-02 4.959371e-02 8.895563e-03 [216] 7.099359e-03 5.665848e-03 4.521793e-03 3.608747e-03 -5.711994e-02 [221] 4.509792e-02 1.078191e-02 5.805223e-03 -8.413222e-04 2.128151e-03 [226] -7.197382e-03 -6.119474e-02 -1.815410e-02 4.551160e-02 5.637718e-03 [231] 4.499343e-03 -5.640917e-02 4.566516e-02 5.760273e-03 4.597152e-03 [236] 7.774650e-03 4.105088e-03 -8.295768e-04 1.437627e-03 1.147339e-03 [241] 9.156671e-04 -5.926923e-02 -1.661739e-02 -9.156223e-03 4.648716e-02 [246] 8.515985e-03 6.796427e-03 -5.457592e-02 4.712824e-02 6.927927e-03 [251] 9.634792e-03 8.558963e-02 2.328934e-02 2.068642e-02 1.650939e-02 [256] 1.728156e-02 -5.241341e-02 5.095379e-02 9.981012e-03 7.965633e-03 [261] 6.357203e-03 -5.492645e-02 -1.315151e-02 -1.049594e-02 5.162341e-02 [266] 1.462119e-02 9.569164e-03 7.636946e-03 -5.801088e-02 4.648657e-02 [271] 6.415821e-03 -5.077391e-02 4.395709e-02 6.496791e-03 5.184951e-03 [276] -1.336348e-03 -5.826692e-02 4.418253e-02 -2.542298e-02 9.505252e-02 [281] 2.882495e-02 1.679913e-02 1.550672e-02 1.237558e-02 9.876690e-03 [286] 1.198814e-02 7.467783e-03 5.959879e-03 6.506923e-04 -9.738100e-02 [291] -2.657750e-02 -2.121094e-02 -1.282224e-02 8.356139e-02 1.764806e-02 [296] -8.180970e-02 7.964417e-02 1.452181e-02 1.158955e-02 9.249370e-03 [301] 1.148749e-02 2.962464e-03 6.516854e-03 -2.691819e-03 1.351207e-03 [306] 1.078370e-03 8.606239e-04 6.868456e-04 5.481569e-04 4.374724e-04 [311] 1.003491e-01 2.894631e-02 2.310143e-02 2.527970e-02 -8.332430e-02 [316] -1.535915e-02 -1.225781e-02 1.333744e-01 -6.676757e-02 4.697361e-03 [321] -6.593560e-03 -1.762690e-03 -1.406765e-03 -1.122709e-03 -8.960105e-04 [326] -7.150870e-04 -5.706957e-04 -4.554601e-04 -3.634930e-04 9.970990e-02 [331] 2.843615e-02 2.269429e-02 1.811183e-02 1.445467e-02 4.693027e-03 [336] 7.244896e-03 5.781997e-03 4.614489e-03 1.052566e-02 -9.509919e-02 [341] -2.475643e-02 6.997801e-02 1.679993e-02 9.908178e-03 7.907506e-03 [346] -9.368919e-02 -2.363115e-02 -1.885951e-02 -1.505138e-02 -1.201218e-02 > postscript(file="/var/www/html/rcomp/tmp/2nxib1293545787.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(resid,length(resid)/2, main='Residual Autocorrelation Function') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3nxib1293545787.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(resid,length(resid)/2, main='Residual Partial Autocorrelation Function') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4g6he1293545787.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > cpgram(resid, main='Residual Cumulative Periodogram') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5g6he1293545787.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(resid, main='Residual Histogram', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6g6he1293545787.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7g6he1293545787.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(resid, main='Residual Normal Q-Q Plot') > qqline(resid) > dev.off() null device 1 > ncols <- length(selection[[1]][1,]) > nrows <- length(selection[[2]][,1])-1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/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="/var/www/html/rcomp/tmp/8cyxm1293545787.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="/var/www/html/rcomp/tmp/9m7e71293545787.tab") > > try(system("convert tmp/1nxib1293545787.ps tmp/1nxib1293545787.png",intern=TRUE)) character(0) > try(system("convert tmp/2nxib1293545787.ps tmp/2nxib1293545787.png",intern=TRUE)) character(0) > try(system("convert tmp/3nxib1293545787.ps tmp/3nxib1293545787.png",intern=TRUE)) character(0) > try(system("convert tmp/4g6he1293545787.ps tmp/4g6he1293545787.png",intern=TRUE)) character(0) > try(system("convert tmp/5g6he1293545787.ps tmp/5g6he1293545787.png",intern=TRUE)) character(0) > try(system("convert tmp/6g6he1293545787.ps tmp/6g6he1293545787.png",intern=TRUE)) character(0) > try(system("convert tmp/7g6he1293545787.ps tmp/7g6he1293545787.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 13.334 1.790 28.147