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(226.9,235.9,216.2,226.2,198.3,176.7,166.2,157.6,163.4,159.7,191.0,239.4,321.9,362.7,413.6,407.1,383.2,347.7,333.8,312.3,295.4,283.3,287.6,265.7,250.2,234.7,244.0,231.2,223.8,223.5,210.5,201.6,190.7,207.5,198.8,196.6,204.2,227.4,229.7,217.9,221.4,216.3,197.0,193.8,196.8,180.5,174.8,181.6,190.0,190.6,179.0,174.1,161.1,168.6,169.4,152.2,148.3,137.7,145.0,153.4) > 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.5306145 0.2878644 -0.3403913 0.1865323 -0.3111489 -0.10473362 [2,] 0.5295173 0.2846423 -0.3325441 0.1830704 -0.3191650 -0.09454389 [3,] 0.5516970 0.2639641 -0.3181390 0.1742226 -0.3553975 0.00000000 [4,] 0.5688562 0.2392164 -0.3287814 0.2254260 -0.3821908 0.00000000 [5,] 0.5659236 0.2360197 -0.3349948 0.2253275 -0.3969934 0.00000000 [6,] 0.5149099 0.2846310 -0.2298106 0.0000000 -0.2887231 0.00000000 [7,] 0.4758903 0.1855744 0.0000000 0.0000000 -0.3585827 0.00000000 [8,] 0.4707839 0.2072886 0.0000000 0.0000000 -0.3340153 0.00000000 [9,] 0.4532206 0.1839255 0.0000000 0.0000000 -0.2913756 0.00000000 [10,] 0.5593435 0.0000000 0.0000000 0.0000000 -0.2672557 0.00000000 [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.34972922 -0.2164598 -0.11303940 0.02272112 0.06609414 [2,] 0.34098762 -0.2103545 -0.10451942 0.00000000 0.07739534 [3,] 0.31014094 -0.2353689 -0.09042458 0.00000000 0.09426173 [4,] 0.30975481 -0.2914394 0.00000000 0.00000000 0.05621014 [5,] 0.31326521 -0.2899298 0.00000000 0.00000000 0.00000000 [6,] 0.25741799 -0.2352364 0.00000000 0.00000000 0.00000000 [7,] 0.20199405 -0.1638173 0.00000000 0.00000000 0.00000000 [8,] 0.09325788 0.0000000 0.00000000 0.00000000 0.00000000 [9,] 0.00000000 0.0000000 0.00000000 0.00000000 0.00000000 [10,] 0.00000000 0.0000000 0.00000000 0.00000000 0.00000000 [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.00016 0.05578 0.04308 0.29279 0.06814 0.55507 0.03924 0.21829 0.51122 [2,] 0.00016 0.05522 0.03461 0.29626 0.04647 0.55606 0.02918 0.21462 0.51345 [3,] 0.00005 0.06705 0.04094 0.32068 0.01653 NA 0.03571 0.15511 0.56897 [4,] 0.00002 0.08138 0.03397 0.13882 0.00726 NA 0.03599 0.02903 NA [5,] 0.00002 0.08730 0.03091 0.14040 0.00482 NA 0.03457 0.03082 NA [6,] 0.00007 0.03942 0.10067 NA 0.01774 NA 0.07790 0.07343 NA [7,] 0.00022 0.14277 NA NA 0.00213 NA 0.15907 0.19392 NA [8,] 0.00029 0.10374 NA NA 0.00421 NA 0.43287 NA NA [9,] 0.00039 0.13893 NA NA 0.00463 NA NA NA NA [10,] 0.00000 NA NA NA 0.00912 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.89288 0.66042 [2,] NA 0.53500 [3,] NA 0.43770 [4,] NA 0.57996 [5,] NA NA [6,] NA 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 0.5306 0.2879 -0.3404 0.1865 -0.3111 -0.1047 0.3497 -0.2165 s.e. 0.1295 0.1468 0.1638 0.1754 0.1667 0.1762 0.1650 0.1735 ar9 ar10 ar11 -0.1130 0.0227 0.0661 s.e. 0.1708 0.1678 0.1495 sigma^2 estimated as 197.8: log likelihood = -240.76, aic = 505.51 [[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 0.5306 0.2879 -0.3404 0.1865 -0.3111 -0.1047 0.3497 -0.2165 s.e. 0.1295 0.1468 0.1638 0.1754 0.1667 0.1762 0.1650 0.1735 ar9 ar10 ar11 -0.1130 0.0227 0.0661 s.e. 0.1708 0.1678 0.1495 sigma^2 estimated as 197.8: log likelihood = -240.76, aic = 505.51 [[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 0.5295 0.2846 -0.3325 0.1831 -0.3192 -0.0945 0.3410 -0.2104 s.e. 0.1294 0.1449 0.1530 0.1734 0.1562 0.1595 0.1518 0.1673 ar9 ar10 ar11 -0.1045 0 0.0774 s.e. 0.1588 0 0.1239 sigma^2 estimated as 197.9: log likelihood = -240.77, aic = 503.53 [[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.5517 0.264 -0.3181 0.1742 -0.3554 0 0.3101 -0.2354 -0.0904 s.e. 0.1243 0.141 0.1516 0.1737 0.1433 0 0.1437 0.1631 0.1577 ar10 ar11 0 0.0943 s.e. 0 0.1205 sigma^2 estimated as 199.1: log likelihood = -240.94, aic = 501.88 [[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.5689 0.2392 -0.3288 0.2254 -0.3822 0 0.3098 -0.2914 0 0 s.e. 0.1210 0.1345 0.1509 0.1499 0.1366 0 0.1438 0.1297 0 0 ar11 0.0562 s.e. 0.1009 sigma^2 estimated as 200.2: log likelihood = -241.1, aic = 500.21 [[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.5659 0.2360 -0.335 0.2253 -0.3970 0 0.3133 -0.2899 0 0 s.e. 0.1211 0.1354 0.151 0.1505 0.1348 0 0.1443 0.1306 0 0 ar11 0 s.e. 0 sigma^2 estimated as 201.5: log likelihood = -241.26, aic = 498.52 [[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.5149 0.2846 -0.2298 0 -0.2887 0 0.2574 -0.2352 0 0 s.e. 0.1189 0.1348 0.1376 0 0.1180 0 0.1432 0.1288 0 0 ar11 0 s.e. 0 sigma^2 estimated as 210.5: log likelihood = -242.35, aic = 498.7 [[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.4759 0.1856 0 0 -0.3586 0 0.2020 -0.1638 0 0 0 s.e. 0.1203 0.1248 0 0 0.1111 0 0.1415 0.1245 0 0 0 sigma^2 estimated as 221.2: log likelihood = -243.71, aic = 499.42 [[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.4708 0.2073 0 0 -0.3340 0 0.0933 0 0 0 0 s.e. 0.1217 0.1253 0 0 0.1119 0 0.1180 0 0 0 0 sigma^2 estimated as 229.0: log likelihood = -244.55, aic = 499.1 [[3]][[10]] 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.4532 0.1839 0 0 -0.2914 0 0 0 0 0 0 s.e. 0.1202 0.1225 0 0 0.0988 0 0 0 0 0 0 sigma^2 estimated as 231.8: log likelihood = -244.86, aic = 497.71 [[3]][[11]] NULL $aic [1] 505.5120 503.5303 501.8794 500.2073 498.5157 498.7034 499.4231 499.0952 [9] 497.7134 497.9170 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 9: 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/1wzlu1260572157.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 = 60 Frequency = 1 [1] 0.22689981 6.94661834 -23.08285061 17.69961361 -26.87283397 [6] -9.22815784 7.04346561 -5.60849186 14.54267017 -12.87629815 [11] 25.61643619 31.83527710 52.30142664 -3.80271270 16.15665798 [16] -27.95303218 -16.21329685 0.56597092 18.47327233 6.16013686 [21] -6.49313451 -7.45005011 2.54847741 -25.67347025 -12.62992363 [26] -9.37135980 15.65011973 -12.91119127 -9.69040851 0.89175738 [31] -16.01930634 -0.24316224 -8.20491266 21.22086198 -14.39673038 [36] -5.13481158 7.60399457 16.98416616 -4.71744160 -19.64444611 [41] 7.78394787 -2.30149694 -10.87240136 7.15534081 4.56183625 [46] -16.05128568 -0.35029652 6.75779451 5.43407364 -3.58361947 [51] -18.16632809 -1.41383736 -6.66432969 16.74065703 -0.03329754 [56] -22.32197413 2.32051319 -9.45680356 15.00676416 7.27420051 > postscript(file="/var/www/html/rcomp/tmp/2hpud1260572157.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/3cq8a1260572157.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/4rki61260572157.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/5cw201260572157.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/6lloa1260572157.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/792aa1260572157.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/8zkwn1260572157.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/942981260572157.tab") > system("convert tmp/1wzlu1260572157.ps tmp/1wzlu1260572157.png") > system("convert tmp/2hpud1260572157.ps tmp/2hpud1260572157.png") > system("convert tmp/3cq8a1260572157.ps tmp/3cq8a1260572157.png") > system("convert tmp/4rki61260572157.ps tmp/4rki61260572157.png") > system("convert tmp/5cw201260572157.ps tmp/5cw201260572157.png") > system("convert tmp/6lloa1260572157.ps tmp/6lloa1260572157.png") > system("convert tmp/792aa1260572157.ps tmp/792aa1260572157.png") > > > proc.time() user system elapsed 3.784 1.053 9.782