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(117.09,116.77,119.39,122.49,124.08,118.29,112.94,113.79,114.43,118.70,120.36,118.27,118.34,117.82,117.65,118.18,121.02,124.78,131.16,130.14,131.75,134.73,135.35,140.32,136.35,131.60,128.90,133.89,138.25,146.23,144.76,149.30,156.80,159.08,165.12,163.14,153.43,151.01,154.72,154.58,155.63,161.67,163.51,162.91,164.80,164.98,154.54,148.60,149.19,150.61) > 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.2798298 -0.1665887 0.08435553 -0.1663902 -0.06221159 0.13858673 [2,] 0.2747495 -0.1646922 0.08848497 -0.1722746 -0.05600337 0.12257358 [3,] 0.2877632 -0.1707847 0.09953629 -0.1974163 0.00000000 0.09991365 [4,] 0.2782650 -0.1249679 0.00000000 -0.1690768 0.00000000 0.10280753 [5,] 0.2687798 -0.1492200 0.00000000 -0.1559025 0.00000000 0.00000000 [6,] 0.2503847 -0.1389124 0.00000000 -0.1646802 0.00000000 0.00000000 [7,] 0.1962955 0.0000000 0.00000000 -0.1584421 0.00000000 0.00000000 [8,] 0.2093137 0.0000000 0.00000000 0.0000000 0.00000000 0.00000000 [9,] 0.2133991 0.0000000 0.00000000 0.0000000 0.00000000 0.00000000 [10,] 0.2285043 0.0000000 0.00000000 0.0000000 0.00000000 0.00000000 [11,] 0.0000000 0.0000000 0.00000000 0.0000000 0.00000000 0.00000000 [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.0408376 -0.1624319 0.1015162 0.1745347 0.3054889 [2,] 0.0000000 -0.1791655 0.1073359 0.1720370 0.3132263 [3,] 0.0000000 -0.1801303 0.1158408 0.1728512 0.3011772 [4,] 0.0000000 -0.1893700 0.1356543 0.1690773 0.2784706 [5,] 0.0000000 -0.1887547 0.1299588 0.1459456 0.2872286 [6,] 0.0000000 -0.1475818 0.0000000 0.1981580 0.2791248 [7,] 0.0000000 -0.1713905 0.0000000 0.2336550 0.2754075 [8,] 0.0000000 -0.1490122 0.0000000 0.2145540 0.3017188 [9,] 0.0000000 0.0000000 0.0000000 0.2088045 0.3010392 [10,] 0.0000000 0.0000000 0.0000000 0.0000000 0.3679292 [11,] 0.0000000 0.0000000 0.0000000 0.0000000 0.4384914 [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.04581 0.23592 0.53953 0.25587 0.66511 0.34284 0.77816 0.25602 0.49186 [2,] 0.04753 0.24003 0.51732 0.23482 0.69349 0.36226 NA 0.16875 0.46197 [3,] 0.03334 0.22203 0.45850 0.13181 NA 0.41226 NA 0.16570 0.42485 [4,] 0.03958 0.31900 NA 0.18059 NA 0.40530 NA 0.14536 0.34590 [5,] 0.04614 0.22970 NA 0.21581 NA NA NA 0.15195 0.36889 [6,] 0.06272 0.26275 NA 0.19869 NA NA NA 0.23376 NA [7,] 0.11831 NA NA 0.21254 NA NA NA 0.17119 NA [8,] 0.10173 NA NA NA NA NA NA 0.23024 NA [9,] 0.09612 NA NA NA NA NA NA NA NA [10,] 0.08005 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.23797 0.03882 [2,] 0.24348 0.03102 [3,] 0.24320 0.03418 [4,] 0.25603 0.04563 [5,] 0.31905 0.04197 [6,] 0.14808 0.04769 [7,] 0.08258 0.05507 [8,] 0.11868 0.03763 [9,] 0.13284 0.04275 [10,] NA 0.01088 [11,] NA 0.00178 [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.2798 -0.1666 0.0844 -0.1664 -0.0622 0.1386 -0.0408 -0.1624 s.e. 0.1355 0.1383 0.1363 0.1442 0.1426 0.1443 0.1439 0.1409 ar9 ar10 ar11 0.1015 0.1745 0.3055 s.e. 0.1463 0.1456 0.1427 sigma^2 estimated as 9.929: log likelihood = -127.28, aic = 278.57 [[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.2798 -0.1666 0.0844 -0.1664 -0.0622 0.1386 -0.0408 -0.1624 s.e. 0.1355 0.1383 0.1363 0.1442 0.1426 0.1443 0.1439 0.1409 ar9 ar10 ar11 0.1015 0.1745 0.3055 s.e. 0.1463 0.1456 0.1427 sigma^2 estimated as 9.929: log likelihood = -127.28, aic = 278.57 [[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.2747 -0.1647 0.0885 -0.1723 -0.056 0.1226 0 -0.1792 0.1073 s.e. 0.1343 0.1380 0.1354 0.1428 0.141 0.1330 0 0.1278 0.1445 ar10 ar11 0.1720 0.3132 s.e. 0.1453 0.1400 sigma^2 estimated as 9.945: log likelihood = -127.32, aic = 276.65 [[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.2878 -0.1708 0.0995 -0.1974 0 0.0999 0 -0.1801 0.1158 s.e. 0.1306 0.1377 0.1330 0.1283 0 0.1206 0 0.1276 0.1437 ar10 ar11 0.1729 0.3012 s.e. 0.1459 0.1373 sigma^2 estimated as 9.99: log likelihood = -127.4, aic = 274.81 [[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.2783 -0.1250 0 -0.1691 0 0.1028 0 -0.1894 0.1357 0.1691 s.e. 0.1309 0.1239 0 0.1241 0 0.1223 0 0.1276 0.1423 0.1468 ar11 0.2785 s.e. 0.1351 sigma^2 estimated as 10.12: log likelihood = -127.68, aic = 273.36 [[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.2688 -0.1492 0 -0.1559 0 0 0 -0.1888 0.1300 0.1459 s.e. 0.1308 0.1224 0 0.1241 0 0 0 0.1294 0.1431 0.1447 ar11 0.2872 s.e. 0.1369 sigma^2 estimated as 10.29: log likelihood = -128.03, aic = 272.06 [[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.2504 -0.1389 0 -0.1647 0 0 0 -0.1476 0 0.1982 s.e. 0.1310 0.1224 0 0.1262 0 0 0 0.1222 0 0.1345 ar11 0.2791 s.e. 0.1369 sigma^2 estimated as 10.48: log likelihood = -128.44, aic = 270.88 [[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.1963 0 0 -0.1584 0 0 0 -0.1714 0 0.2337 0.2754 s.e. 0.1232 0 0 0.1253 0 0 0 0.1232 0 0.1315 0.1397 sigma^2 estimated as 10.75: log likelihood = -129.07, aic = 270.14 [[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.2093 0 0 0 0 0 0 -0.1490 0 0.2146 0.3017 s.e. 0.1253 0 0 0 0 0 0 0.1225 0 0.1349 0.1409 sigma^2 estimated as 11.16: log likelihood = -129.85, aic = 269.71 [[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.2134 0 0 0 0 0 0 0 0 0.2088 0.3010 s.e. 0.1256 0 0 0 0 0 0 0 0 0.1365 0.1445 sigma^2 estimated as 11.55: log likelihood = -130.57, aic = 269.14 [[3]][[11]] 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.2285 0 0 0 0 0 0 0 0 0 0.3679 s.e. 0.1277 0 0 0 0 0 0 0 0 0 0.1387 sigma^2 estimated as 12.19: log likelihood = -131.69, aic = 269.38 $aic [1] 278.5682 276.6488 274.8058 273.3604 272.0615 270.8779 270.1397 269.7055 [9] 269.1444 269.3795 270.5507 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 10: 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/1u9gx1261304300.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 = 50 Frequency = 1 [1] 0.11708993 -0.28532406 2.50283452 2.22070391 0.70522582 -5.74912152 [7] -3.51917120 2.10795022 0.38266839 3.79430104 0.48959840 -2.32243985 [13] 0.66531125 -1.49996985 -1.19175836 -0.01616173 4.84920291 5.07946922 [19] 5.20808415 -2.71333188 0.27201659 2.00134564 0.70802937 4.80257231 [25] -4.91434298 -3.78029012 -1.80960725 4.56204252 1.83634988 4.63633302 [31] -2.91817619 4.28353522 5.36616159 0.33810193 3.69040207 -1.89948674 [37] -7.50989778 0.79218525 2.42701351 -2.59192219 -1.85408456 6.34092648 [43] -1.21056438 -3.77991697 1.18822394 -2.47416553 -9.75263092 0.01817718 [49] 2.83770401 -0.07983491 > postscript(file="/var/www/html/rcomp/tmp/2w1q51261304300.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/3la5f1261304300.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/4nbza1261304300.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/5ukwk1261304300.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/6ni6g1261304300.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/7pgk91261304300.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/8mizy1261304300.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/9uqhs1261304300.tab") > > try(system("convert tmp/1u9gx1261304300.ps tmp/1u9gx1261304300.png",intern=TRUE)) character(0) > try(system("convert tmp/2w1q51261304300.ps tmp/2w1q51261304300.png",intern=TRUE)) character(0) > try(system("convert tmp/3la5f1261304300.ps tmp/3la5f1261304300.png",intern=TRUE)) character(0) > try(system("convert tmp/4nbza1261304300.ps tmp/4nbza1261304300.png",intern=TRUE)) character(0) > try(system("convert tmp/5ukwk1261304300.ps tmp/5ukwk1261304300.png",intern=TRUE)) character(0) > try(system("convert tmp/6ni6g1261304300.ps tmp/6ni6g1261304300.png",intern=TRUE)) character(0) > try(system("convert tmp/7pgk91261304300.ps tmp/7pgk91261304300.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.132 1.045 4.072