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(9.3,9.3,8.7,8.2,8.3,8.5,8.6,8.5,8.2,8.1,7.9,8.6,8.7,8.7,8.5,8.4,8.5,8.7,8.7,8.6,8.5,8.3,8,8.2,8.1,8.1,8,7.9,7.9,8,8,7.9,8,7.7,7.2,7.5,7.3,7,7,7,7.2,7.3,7.1,6.8,6.4,6.1,6.5,7.7,7.9,7.5,6.9,6.6,6.9,7.7,8,8,7.7,7.3,7.4,8.1,8.3) > par9 = '0' > par8 = '0' > par7 = '0' > par6 = '3' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > 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 > par6 <- 11 > 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.1996593 -0.2880788 -0.1805411 -0.1834936 0.02046894 0.2923637 [2,] 0.1975509 -0.2914240 -0.1853178 -0.1808483 0.00000000 0.2945276 [3,] 0.2004141 -0.2816825 -0.1839588 -0.1865437 0.00000000 0.2838435 [4,] 0.2012570 -0.2743309 -0.1705211 -0.1888804 0.00000000 0.2755878 [5,] 0.2143348 -0.2737477 -0.1777256 -0.1937794 0.00000000 0.2797878 [6,] 0.2025139 -0.2760432 -0.1840177 -0.1856649 0.00000000 0.2932017 [7,] 0.2069583 -0.2734871 -0.1895151 -0.2038911 0.00000000 0.3033334 [8,] 0.2662440 -0.3411587 0.0000000 -0.2376232 0.00000000 0.3678550 [9,] 0.3579689 -0.2837964 0.0000000 0.0000000 0.00000000 0.4444771 [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 [15,] NA NA NA NA NA NA [16,] NA NA NA NA NA NA [17,] NA NA NA NA NA NA [18,] NA NA NA NA NA NA [19,] NA NA NA NA NA NA [20,] NA NA NA NA NA NA [21,] NA NA NA NA NA NA [22,] NA NA NA NA NA NA [,7] [,8] [,9] [,10] [,11] [1,] 0.05487811 0.04213218 0.04607136 -0.04804422 0.07996308 [2,] 0.05138120 0.03998195 0.04421535 -0.04930653 0.08624720 [3,] 0.05468737 0.00000000 0.04780895 -0.05756602 0.07806225 [4,] 0.04324810 0.00000000 0.00000000 -0.04994372 0.06049135 [5,] 0.00000000 0.00000000 0.00000000 -0.05974669 0.05275140 [6,] 0.00000000 0.00000000 0.00000000 -0.04628154 0.00000000 [7,] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 [8,] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 [9,] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 [10,] NA NA NA NA NA [11,] NA NA NA NA NA [12,] NA NA NA NA NA [13,] NA NA NA NA NA [14,] NA NA NA NA NA [15,] NA NA NA NA NA [16,] NA NA NA NA NA [17,] NA NA NA NA NA [18,] NA NA NA NA NA [19,] NA NA NA NA NA [20,] NA NA NA NA NA [21,] NA NA NA NA NA [22,] NA NA NA NA NA [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.12992 0.04004 0.19981 0.19683 0.88895 0.04220 0.70687 0.77194 0.75180 [2,] 0.13132 0.03493 0.17467 0.19925 NA 0.03966 0.72084 0.78215 0.76060 [3,] 0.12459 0.03488 0.17731 0.18212 NA 0.03957 0.70290 NA 0.74068 [4,] 0.12342 0.03703 0.19034 0.17686 NA 0.04230 0.75607 NA NA [5,] 0.08372 0.03752 0.16564 0.16317 NA 0.03862 NA NA NA [6,] 0.09364 0.03606 0.14936 0.17733 NA 0.02606 NA NA NA [7,] 0.08563 0.03726 0.13519 0.11260 NA 0.01866 NA NA NA [8,] 0.02162 0.00748 NA 0.06421 NA 0.00316 NA NA NA [9,] 0.00127 0.02065 NA NA NA 0.00024 NA NA NA [10,] NA NA NA NA NA NA NA NA NA [11,] NA NA NA NA NA NA NA NA NA [12,] NA NA NA NA NA NA NA NA NA [13,] NA NA NA NA NA NA NA NA NA [14,] NA NA NA NA NA NA NA NA NA [15,] NA NA NA NA NA NA NA NA NA [16,] NA NA NA NA NA NA NA NA NA [17,] NA NA NA NA NA NA NA NA NA [18,] NA NA NA NA NA NA NA NA NA [19,] NA NA NA NA NA NA NA NA NA [20,] NA NA NA NA NA NA NA NA NA [21,] NA NA NA NA NA NA NA NA NA [22,] NA NA NA NA NA NA NA NA NA [,10] [,11] [1,] 0.73261 0.59131 [2,] 0.72527 0.54340 [3,] 0.67481 0.57372 [4,] 0.71217 0.63704 [5,] 0.65029 0.67473 [6,] 0.71814 NA [7,] NA NA [8,] NA NA [9,] NA NA [10,] NA NA [11,] NA NA [12,] NA NA [13,] NA NA [14,] NA NA [15,] NA NA [16,] NA NA [17,] NA NA [18,] NA NA [19,] NA NA [20,] NA NA [21,] NA NA [22,] NA NA [[3]] [[3]][[1]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ar4 ar5 ar6 ar7 ar8 ar9 0.1997 -0.2881 -0.1805 -0.1835 0.0205 0.2924 0.0549 0.0421 0.0461 s.e. 0.1296 0.1366 0.1389 0.1402 0.1458 0.1402 0.1451 0.1446 0.1449 ar10 ar11 -0.0480 0.0800 s.e. 0.1398 0.1479 sigma^2 estimated as 0.05155: log likelihood = 2.64, aic = 18.72 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ar4 ar5 ar6 ar7 ar8 ar9 0.1997 -0.2881 -0.1805 -0.1835 0.0205 0.2924 0.0549 0.0421 0.0461 s.e. 0.1296 0.1366 0.1389 0.1402 0.1458 0.1402 0.1451 0.1446 0.1449 ar10 ar11 -0.0480 0.0800 s.e. 0.1398 0.1479 sigma^2 estimated as 0.05155: log likelihood = 2.64, aic = 18.72 [[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 ar4 ar5 ar6 ar7 ar8 ar9 0.1976 -0.2914 -0.1853 -0.1808 0 0.2945 0.0514 0.0400 0.0442 s.e. 0.1288 0.1344 0.1346 0.1390 0 0.1394 0.1430 0.1438 0.1443 ar10 ar11 -0.0493 0.0862 s.e. 0.1395 0.1410 sigma^2 estimated as 0.05156: log likelihood = 2.63, aic = 16.74 [[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 ar4 ar5 ar6 ar7 ar8 ar9 0.2004 -0.2817 -0.1840 -0.1865 0 0.2838 0.0547 0 0.0478 s.e. 0.1283 0.1300 0.1345 0.1379 0 0.1344 0.1426 0 0.1437 ar10 ar11 -0.0576 0.0781 s.e. 0.1364 0.1379 sigma^2 estimated as 0.05163: log likelihood = 2.59, aic = 14.82 [[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 ar4 ar5 ar6 ar7 ar8 ar9 ar10 0.2013 -0.2743 -0.1705 -0.1889 0 0.2756 0.0432 0 0 -0.0499 s.e. 0.1285 0.1282 0.1285 0.1380 0 0.1324 0.1385 0 0 0.1346 ar11 0.0605 s.e. 0.1275 sigma^2 estimated as 0.05174: log likelihood = 2.54, aic = 12.93 [[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 ar4 ar5 ar6 ar7 ar8 ar9 ar10 0.2143 -0.2737 -0.1777 -0.1938 0 0.2798 0 0 0 -0.0597 s.e. 0.1216 0.1283 0.1264 0.1370 0 0.1319 0 0 0 0.1310 ar11 0.0528 s.e. 0.1250 sigma^2 estimated as 0.05183: log likelihood = 2.49, aic = 11.02 [[3]][[7]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ar3 ar4 ar5 ar6 ar7 ar8 ar9 ar10 0.2025 -0.2760 -0.1840 -0.1857 0 0.2932 0 0 0 -0.0463 s.e. 0.1187 0.1284 0.1258 0.1358 0 0.1281 0 0 0 0.1276 ar11 0 s.e. 0 sigma^2 estimated as 0.05205: log likelihood = 2.4, aic = 9.2 [[3]][[8]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ar3 ar4 ar5 ar6 ar7 ar8 ar9 ar10 ar11 0.2070 -0.2735 -0.1895 -0.2039 0 0.3033 0 0 0 0 0 s.e. 0.1182 0.1281 0.1250 0.1265 0 0.1251 0 0 0 0 0 sigma^2 estimated as 0.05219: log likelihood = 2.33, aic = 7.33 [[3]][[9]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ar3 ar4 ar5 ar6 ar7 ar8 ar9 ar10 ar11 0.2662 -0.3412 0 -0.2376 0 0.3679 0 0 0 0 0 s.e. 0.1127 0.1229 0 0.1259 0 0.1192 0 0 0 0 0 sigma^2 estimated as 0.05421: log likelihood = 1.2, aic = 7.61 [[3]][[10]] NULL [[3]][[11]] NULL $aic [1] 18.718887 16.738649 14.815873 12.926529 11.023847 9.200520 7.331867 [8] 7.607453 9.088130 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 6: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 7: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 8: 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/1fqrl1260534640.ps",horizontal=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 = 61 Frequency = 1 [1] 9.299991e-03 -3.781347e-06 -4.500598e-01 -2.071011e-01 4.415380e-02 [6] -1.030468e-01 -1.524912e-01 -1.772042e-01 5.215588e-03 1.772095e-01 [11] -2.887464e-01 6.217996e-01 -2.626750e-01 2.252099e-01 -1.030523e-01 [16] 1.563705e-01 1.557260e-01 -1.182388e-01 -1.034431e-01 -5.553058e-02 [21] 2.395772e-02 -1.231813e-01 -3.176526e-01 1.143081e-01 -2.793587e-01 [26] 8.411700e-02 -1.686173e-01 4.772003e-02 7.910271e-02 -7.686871e-03 [31] -1.360121e-02 -8.964645e-02 1.634099e-01 -3.001924e-01 -3.860109e-01 [36] 2.702265e-01 -4.266902e-01 -1.789051e-01 -1.439556e-01 7.929585e-02 [41] 3.364029e-01 -1.348922e-01 -8.482165e-02 -1.022788e-01 -3.408339e-01 [46] -2.720877e-01 2.223141e-01 8.830824e-01 -4.507542e-03 -4.788806e-03 [51] -1.830794e-01 1.187872e-01 7.556060e-02 8.130392e-02 -2.679247e-02 [56] 2.689088e-01 9.434757e-02 -1.967176e-02 6.508043e-02 2.426281e-01 [61] -1.338984e-01 > postscript(file="/var/www/html/rcomp/tmp/29ofo1260534640.ps",horizontal=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/3f5lh1260534640.ps",horizontal=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/4v5831260534640.ps",horizontal=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/51ajt1260534640.ps",horizontal=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/65efv1260534640.ps",horizontal=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/79evx1260534640.ps",horizontal=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/893021260534640.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/9q3mb1260534640.tab") > > system("convert tmp/1fqrl1260534640.ps tmp/1fqrl1260534640.png") > system("convert tmp/29ofo1260534640.ps tmp/29ofo1260534640.png") > system("convert tmp/3f5lh1260534640.ps tmp/3f5lh1260534640.png") > system("convert tmp/4v5831260534640.ps tmp/4v5831260534640.png") > system("convert tmp/51ajt1260534640.ps tmp/51ajt1260534640.png") > system("convert tmp/65efv1260534640.ps tmp/65efv1260534640.png") > system("convert tmp/79evx1260534640.ps tmp/79evx1260534640.png") > > > proc.time() user system elapsed 3.553 1.068 12.124