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(7.6,7.5,7.6,7.9,7.9,8.1,8.2,8,7.5,6.8,6.5,6.6,7.6,8,8.1,7.7,7.5,7.6,7.8,7.8,7.8,7.5,7.5,7.1,7.5,7.5,7.6,7.7,7.7,7.9,8.1,8.2,8.2,8.2,7.9,7.3,6.9,6.6,6.7,6.9,7,7.1,7.2,7.1,6.9,7,6.8,6.4,6.7,6.6,6.4,6.3,6.2,6.5,6.8,6.8,6.4,6.1,5.8,6.1,7.2,7.3,6.9,6.1,5.8,6.2,7.1,7.7,7.9,7.7,7.4,7.5) > 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.3872773 -0.05968914 -0.4163925 -0.2551153 0.06293221 0.08631995 [2,] 0.3849987 -0.05148843 -0.4135392 -0.2623449 0.06417487 0.09791803 [3,] 0.3681162 0.00000000 -0.4333851 -0.2665269 0.07982116 0.10919595 [4,] 0.3448307 0.00000000 -0.4360546 -0.2501712 0.00000000 0.12873462 [5,] 0.3347596 0.00000000 -0.4288374 -0.2553570 0.00000000 0.10291984 [6,] 0.3434552 0.00000000 -0.4070393 -0.2454257 0.00000000 0.10798780 [7,] 0.3303272 0.00000000 -0.4563390 -0.2349478 0.00000000 0.00000000 [8,] 0.3289725 0.00000000 -0.4193270 -0.2009888 0.00000000 0.00000000 [9,] 0.4117790 0.00000000 -0.4962817 0.0000000 0.00000000 0.00000000 [10,] 0.3698739 0.00000000 -0.4981497 0.0000000 0.00000000 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.2033523 -0.2102253 0.08466113 -0.04383881 -0.09996495 [2,] -0.1914429 -0.2125663 0.07475986 0.00000000 -0.10954855 [3,] -0.1948880 -0.2195316 0.08246225 0.00000000 -0.11150272 [4,] -0.1901717 -0.2425033 0.06425062 0.00000000 -0.10335232 [5,] -0.1923965 -0.2227872 0.00000000 0.00000000 -0.10409734 [6,] -0.1552084 -0.1795518 0.00000000 0.00000000 0.00000000 [7,] -0.1154345 -0.2049580 0.00000000 0.00000000 0.00000000 [8,] 0.0000000 -0.2340374 0.00000000 0.00000000 0.00000000 [9,] 0.0000000 -0.1556024 0.00000000 0.00000000 0.00000000 [10,] 0.0000000 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.00186 0.64112 0.00180 0.06853 0.65187 0.53381 0.14820 0.12686 0.52866 [2,] 0.00193 0.68191 0.00187 0.05818 0.64485 0.46597 0.15890 0.12248 0.56827 [3,] 0.00161 NA 0.00050 0.05392 0.55170 0.40655 0.15076 0.10817 0.52544 [4,] 0.00165 NA 0.00047 0.06501 NA 0.31366 0.16026 0.06468 0.61134 [5,] 0.00185 NA 0.00055 0.05978 NA 0.38098 0.15579 0.07505 NA [6,] 0.00148 NA 0.00080 0.07023 NA 0.35894 0.22535 0.11586 NA [7,] 0.00201 NA 0.00004 0.08425 NA NA 0.33764 0.06663 NA [8,] 0.00229 NA 0.00005 0.12823 NA NA NA 0.03169 NA [9,] 0.00002 NA 0.00000 NA NA NA NA 0.10734 NA [10,] 0.00009 NA 0.00000 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.74283 0.44171 [2,] NA 0.38770 [3,] NA 0.37972 [4,] NA 0.41408 [5,] NA 0.41082 [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.3873 -0.0597 -0.4164 -0.2551 0.0629 0.0863 -0.2034 -0.2102 s.e. 0.1189 0.1274 0.1274 0.1375 0.1388 0.1379 0.1388 0.1358 ar9 ar10 ar11 0.0847 -0.0438 -0.1000 s.e. 0.1336 0.1330 0.1291 sigma^2 estimated as 0.05753: log likelihood = -0.34, aic = 24.68 [[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.3873 -0.0597 -0.4164 -0.2551 0.0629 0.0863 -0.2034 -0.2102 s.e. 0.1189 0.1274 0.1274 0.1375 0.1388 0.1379 0.1388 0.1358 ar9 ar10 ar11 0.0847 -0.0438 -0.1000 s.e. 0.1336 0.1330 0.1291 sigma^2 estimated as 0.05753: log likelihood = -0.34, aic = 24.68 [[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.3850 -0.0515 -0.4135 -0.2623 0.0642 0.0979 -0.1914 -0.2126 s.e. 0.1188 0.1250 0.1272 0.1359 0.1385 0.1335 0.1342 0.1357 ar9 ar10 ar11 0.0748 0 -0.1095 s.e. 0.1303 0 0.1259 sigma^2 estimated as 0.05764: log likelihood = -0.4, aic = 22.79 [[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.3681 0 -0.4334 -0.2665 0.0798 0.1092 -0.1949 -0.2195 0.0825 s.e. 0.1116 0 0.1179 0.1356 0.1334 0.1307 0.1340 0.1347 0.1291 ar10 ar11 0 -0.1115 s.e. 0 0.1260 sigma^2 estimated as 0.05777: log likelihood = -0.48, aic = 20.96 [[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 0.3448 0 -0.4361 -0.2502 0 0.1287 -0.1902 -0.2425 0.0643 s.e. 0.1049 0 0.1181 0.1332 0 0.1267 0.1338 0.1290 0.1258 ar10 ar11 0 -0.1034 s.e. 0 0.1257 sigma^2 estimated as 0.05806: log likelihood = -0.66, aic = 19.32 [[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.3348 0 -0.4288 -0.2554 0 0.1029 -0.1924 -0.2228 0 0 s.e. 0.1030 0 0.1178 0.1332 0 0.1167 0.1340 0.1231 0 0 ar11 -0.1041 s.e. 0.1257 sigma^2 estimated as 0.05827: log likelihood = -0.79, aic = 17.58 [[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.3435 0 -0.4070 -0.2454 0 0.1080 -0.1552 -0.1796 0 0 s.e. 0.1035 0 0.1157 0.1333 0 0.1169 0.1268 0.1127 0 0 ar11 0 s.e. 0 sigma^2 estimated as 0.05894: log likelihood = -1.13, aic = 16.26 [[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 0.3303 0 -0.4563 -0.2349 0 0 -0.1154 -0.2050 0 0 s.e. 0.1027 0 0.1038 0.1340 0 0 0.1195 0.1099 0 0 ar11 0 s.e. 0 sigma^2 estimated as 0.05966: log likelihood = -1.55, aic = 15.11 [[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.3290 0 -0.4193 -0.2010 0 0 0 -0.2340 0 0 0 s.e. 0.1038 0 0.0971 0.1305 0 0 0 0.1067 0 0 0 sigma^2 estimated as 0.06055: log likelihood = -2.01, aic = 14.03 [[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.4118 0 -0.4963 0 0 0 0 -0.1556 0 0 0 s.e. 0.0906 0 0.0848 0 0 0 0 0.0954 0 0 0 sigma^2 estimated as 0.06277: log likelihood = -3.18, aic = 14.36 [[3]][[11]] NULL $aic [1] 24.68351 22.79205 20.96154 19.31899 17.57932 16.25755 15.10594 14.02658 [9] 14.35597 14.92531 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/1cm5s1260549445.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 = 72 Frequency = 1 [1] 0.0075999932 -0.0750080228 0.1165777527 0.1868319505 -0.1590954935 [6] 0.2636784520 0.1656353546 -0.2583797853 -0.3399960055 -0.4600425713 [11] -0.0954507833 0.0220735984 0.6114249272 -0.1295430247 0.0004768072 [16] 0.0239832848 0.0854230536 0.1230622612 -0.0863713028 -0.1660518929 [21] 0.2052306079 -0.1385026890 0.1390939472 -0.4622409762 0.3847066140 [26] -0.1491513602 -0.0673921815 0.2573347685 -0.0411779011 0.2029474353 [31] 0.1672723653 -0.0445967783 0.1203194099 0.0992563348 -0.2348115886 [36] -0.4609060528 -0.1529325936 -0.2530524098 -0.0431148131 -0.0241303266 [41] -0.1312403043 0.1084502663 0.1113977016 -0.1849111980 -0.1714349077 [46] 0.1853032374 -0.2752458244 -0.3857800446 0.5299000157 -0.3072297939 [51] -0.3417745245 0.1156800603 -0.1395707544 0.2574818103 0.0957176413 [56] -0.2354028468 -0.2044347657 -0.0019641376 -0.2075867849 0.2094607896 [61] 0.8120215506 -0.4551606817 -0.2456126667 -0.0893785544 0.0168103997 [66] 0.2783403015 0.2915823245 0.1271951204 0.3226079477 0.1798579485 [71] 0.0178838303 0.1983080856 > postscript(file="/var/www/html/rcomp/tmp/2vtjz1260549445.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/3dpss1260549445.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/4ftv91260549445.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/5cur21260549445.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/6lu011260549445.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/7tsw11260549445.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/8hha31260549445.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/9a5551260549445.tab") > > system("convert tmp/1cm5s1260549445.ps tmp/1cm5s1260549445.png") > system("convert tmp/2vtjz1260549445.ps tmp/2vtjz1260549445.png") > system("convert tmp/3dpss1260549445.ps tmp/3dpss1260549445.png") > system("convert tmp/4ftv91260549445.ps tmp/4ftv91260549445.png") > system("convert tmp/5cur21260549445.ps tmp/5cur21260549445.png") > system("convert tmp/6lu011260549445.ps tmp/6lu011260549445.png") > system("convert tmp/7tsw11260549445.ps tmp/7tsw11260549445.png") > > > proc.time() user system elapsed 3.274 1.050 3.578