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(12.1,12,11.8,12.7,12.3,11.9,12,12.3,12.8,12.4,12.3,12.7,12.7,12.9,13,12.2,12.3,12.8,12.8,12.8,12.2,12.6,12.8,12.5,12.4,12.3,11.9,11.7,12,12.1,11.7,11.8,11.8,11.8,11.3,11.3,11.3,11.2,11.4,12.2,12.9,13.1,13.5,13.6,14.4,14.1,15.1,15.8,15.9,15.4,15.5,14.8,13.2,12.7,12.1,11.9,10.6,10.7,9.8,9,8.3,9.3,9,9.1,10) > 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] [,7] [1,] 0.09870512 0.1581196 0.1590436 0.2726412 -0.1450465 -0.01562591 0.1084207 [2,] 0.10003012 0.1538033 0.1593699 0.2710705 -0.1477008 0.00000000 0.1067567 [3,] 0.09687402 0.1451046 0.1901867 0.2841946 -0.1361349 0.00000000 0.0000000 [4,] 0.09011478 0.1518535 0.2047675 0.2496910 -0.1519211 0.00000000 0.0000000 [5,] 0.00000000 0.1556803 0.2178121 0.2596855 -0.1219028 0.00000000 0.0000000 [6,] 0.00000000 0.1159103 0.2083898 0.2909576 -0.1245400 0.00000000 0.0000000 [7,] 0.00000000 0.1039889 0.1922467 0.2662047 0.0000000 0.00000000 0.0000000 [8,] 0.00000000 0.0000000 0.2114399 0.2761734 0.0000000 0.00000000 0.0000000 [9,] 0.00000000 0.0000000 0.1915980 0.2744225 0.0000000 0.00000000 0.0000000 [10,] 0.00000000 0.0000000 0.0000000 0.3206627 0.0000000 0.00000000 0.0000000 [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 [15,] NA NA NA NA NA NA NA [16,] NA NA NA NA NA NA NA [17,] NA NA NA NA NA NA NA [18,] NA NA NA NA NA NA NA [19,] NA NA NA NA NA NA NA [20,] NA NA NA NA NA NA NA [21,] NA NA NA NA NA NA NA [22,] NA NA NA NA NA NA NA [,8] [,9] [,10] [,11] [1,] -0.1138563 -0.2279561 -0.2004133 0.1279462 [2,] -0.1153783 -0.2290560 -0.2052774 0.1300642 [3,] -0.1042581 -0.2223800 -0.1928881 0.1567691 [4,] 0.0000000 -0.2420316 -0.2092625 0.1409610 [5,] 0.0000000 -0.2505843 -0.2344519 0.1251458 [6,] 0.0000000 -0.2289089 -0.2057937 0.0000000 [7,] 0.0000000 -0.2741349 -0.1950786 0.0000000 [8,] 0.0000000 -0.2579594 -0.2057128 0.0000000 [9,] 0.0000000 -0.3131196 0.0000000 0.0000000 [10,] 0.0000000 -0.3040383 0.0000000 0.0000000 [11,] NA NA NA NA [12,] NA NA NA NA [13,] NA NA NA NA [14,] NA NA NA NA [15,] NA NA NA NA [16,] NA NA NA NA [17,] NA NA NA NA [18,] NA NA NA NA [19,] NA NA NA NA [20,] NA NA NA NA [21,] NA NA NA NA [22,] NA NA NA NA [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.43274 0.20066 0.21201 0.04657 0.29927 0.91098 0.43162 0.41080 0.10717 [2,] 0.42459 0.19009 0.21051 0.04653 0.28338 NA 0.43604 0.40230 0.10458 [3,] 0.43857 0.21635 0.11684 0.03551 0.32275 NA NA 0.44809 0.11768 [4,] 0.47352 0.19576 0.08840 0.04685 0.26720 NA NA NA 0.08507 [5,] NA 0.18486 0.06761 0.03722 0.35169 NA NA NA 0.07393 [6,] NA 0.28914 0.07967 0.01754 0.34604 NA NA NA 0.09969 [7,] NA 0.34530 0.10509 0.02727 NA NA NA NA 0.03858 [8,] NA NA 0.07484 0.02057 NA NA NA NA 0.05041 [9,] NA NA 0.10865 0.02471 NA NA NA NA 0.01542 [10,] NA NA NA 0.00787 NA NA NA NA 0.02083 [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.17132 0.38441 [2,] 0.14243 0.37266 [3,] 0.16728 0.27155 [4,] 0.13057 0.31810 [5,] 0.07821 0.36877 [6,] 0.11153 NA [7,] 0.13404 NA [8,] 0.11592 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.0987 0.1581 0.1590 0.2726 -0.1450 -0.0156 0.1084 -0.1139 s.e. 0.1249 0.1220 0.1259 0.1338 0.1384 0.1391 0.1368 0.1373 ar9 ar10 ar11 -0.2280 -0.2004 0.1279 s.e. 0.1391 0.1445 0.1459 sigma^2 estimated as 0.1902: log likelihood = -38.87, aic = 101.75 [[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.0987 0.1581 0.1590 0.2726 -0.1450 -0.0156 0.1084 -0.1139 s.e. 0.1249 0.1220 0.1259 0.1338 0.1384 0.1391 0.1368 0.1373 ar9 ar10 ar11 -0.2280 -0.2004 0.1279 s.e. 0.1391 0.1445 0.1459 sigma^2 estimated as 0.1902: log likelihood = -38.87, aic = 101.75 [[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.1000 0.1538 0.1594 0.2711 -0.1477 0 0.1068 -0.1154 -0.2291 s.e. 0.1243 0.1159 0.1258 0.1331 0.1363 0 0.1360 0.1367 0.1388 ar10 ar11 -0.2053 0.1301 s.e. 0.1379 0.1447 sigma^2 estimated as 0.1903: log likelihood = -38.88, aic = 99.76 [[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.0969 0.1451 0.1902 0.2842 -0.1361 0 0 -0.1043 -0.2224 s.e. 0.1242 0.1160 0.1194 0.1318 0.1364 0 0 0.1365 0.1399 ar10 ar11 -0.1929 0.1568 s.e. 0.1378 0.1411 sigma^2 estimated as 0.1924: log likelihood = -39.18, aic = 98.37 [[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.0901 0.1519 0.2048 0.2497 -0.1519 0 0 0 -0.2420 -0.2093 s.e. 0.1249 0.1160 0.1181 0.1228 0.1356 0 0 0 0.1381 0.1364 ar11 0.1410 s.e. 0.1399 sigma^2 estimated as 0.1943: log likelihood = -39.47, aic = 96.95 [[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 0.1557 0.2178 0.2597 -0.1219 0 0 0 -0.2506 -0.2345 s.e. 0 0.1160 0.1169 0.1217 0.1298 0 0 0 0.1376 0.1307 ar11 0.1251 s.e. 0.1381 sigma^2 estimated as 0.1958: log likelihood = -39.73, aic = 95.47 [[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 0.1159 0.2084 0.291 -0.1245 0 0 0 -0.2289 -0.2058 s.e. 0 0.1083 0.1168 0.119 0.1311 0 0 0 0.1368 0.1274 ar11 0 s.e. 0 sigma^2 estimated as 0.1991: log likelihood = -40.14, aic = 94.27 [[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 0.1040 0.1922 0.2662 0 0 0 0 -0.2741 -0.1951 0 s.e. 0 0.1093 0.1168 0.1176 0 0 0 0 0.1296 0.1284 0 sigma^2 estimated as 0.2022: log likelihood = -40.58, aic = 93.17 [[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 0 0.2114 0.2762 0 0 0 0 -0.2580 -0.2057 0 s.e. 0 0 0.1166 0.1161 0 0 0 0 0.1292 0.1290 0 sigma^2 estimated as 0.2051: log likelihood = -41.04, aic = 92.07 [[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 0 0.1916 0.2744 0 0 0 0 -0.3131 0 0 s.e. 0 0 0.1177 0.1192 0 0 0 0 0.1256 0 0 sigma^2 estimated as 0.2141: log likelihood = -42.26, aic = 92.53 [[3]][[11]] NULL $aic [1] 101.74535 99.75799 98.36804 96.94880 95.46733 94.27178 93.16873 [8] 92.07330 92.52620 93.14756 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/183ij1261150782.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 = 65 Frequency = 1 [1] 0.0120999921 -0.0874672984 -0.1723002698 0.7898814518 -0.3850246159 [6] -0.2849423095 -0.0315472180 0.0811414149 0.7399303146 -0.2638127345 [11] -0.2162336004 0.1592503533 0.2212355865 0.2036809511 -0.0744447811 [16] -0.8784570235 0.1556162731 0.5825154965 0.0005883205 0.1690662049 [21] -0.5979934129 0.2627887741 0.2626239145 -0.1537292468 -0.2624813841 [26] -0.2167766222 -0.2408453062 -0.0985134651 0.3466020445 0.0162096991 [31] -0.1266635916 0.1600290069 -0.1954224066 0.0178849949 -0.4407027758 [36] -0.1526900741 -0.0626239145 0.0897348684 0.3685231832 0.6747521710 [41] 0.7504717566 0.1891226465 0.1918371150 -0.4102163430 0.5695846850 [46] -0.4315236877 0.8397592627 0.5819032746 0.1884370944 -0.3900875571 [51] -0.2459171327 -0.7860076867 -1.5003312913 -0.1314529155 -0.5872595216 [56] 0.6117720780 -0.5459413797 0.3834819792 -0.8535867164 -0.4647261611 [61] -0.5815943126 0.6440046330 -0.0563011849 0.2657848134 0.8378738085 > postscript(file="/var/www/html/rcomp/tmp/2bw7v1261150782.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/3ppw11261150782.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/48mma1261150782.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/5exlb1261150782.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/6qh2t1261150782.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/7gnfo1261150782.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/8puis1261150783.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/98sud1261150783.tab") > > try(system("convert tmp/183ij1261150782.ps tmp/183ij1261150782.png",intern=TRUE)) character(0) > try(system("convert tmp/2bw7v1261150782.ps tmp/2bw7v1261150782.png",intern=TRUE)) character(0) > try(system("convert tmp/3ppw11261150782.ps tmp/3ppw11261150782.png",intern=TRUE)) character(0) > try(system("convert tmp/48mma1261150782.ps tmp/48mma1261150782.png",intern=TRUE)) character(0) > try(system("convert tmp/5exlb1261150782.ps tmp/5exlb1261150782.png",intern=TRUE)) character(0) > try(system("convert tmp/6qh2t1261150782.ps tmp/6qh2t1261150782.png",intern=TRUE)) character(0) > try(system("convert tmp/7gnfo1261150782.ps tmp/7gnfo1261150782.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.021 1.041 3.847