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(325412,326011,328282,317480,317539,313737,312276,309391,302950,300316,304035,333476,337698,335932,323931,313927,314485,313218,309664,302963,298989,298423,310631,329765,335083,327616,309119,295916,291413,291542,284678,276475,272566,264981,263290,296806,303598,286994,276427,266424,267153,268381,262522,255542,253158,243803,250741,280445,285257,270976,261076,255603,260376,263903,264291,263276,262572,256167,264221,293860,300713,287224) > par9 = '0' > par8 = '0' > par7 = '0' > par6 = '0' > par5 = '12' > par4 = '1' > 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.04103478 -0.03194331 0.2575798 0.12220837 0.1592601 -0.05983016 [2,] -0.04385651 -0.03312590 0.2575779 0.12335311 0.1580559 -0.06241330 [3,] -0.04042919 0.00000000 0.2600738 0.12317430 0.1481169 -0.06554500 [4,] 0.00000000 0.00000000 0.2604902 0.11035997 0.1426427 -0.07206465 [5,] 0.00000000 0.00000000 0.2605015 0.11650276 0.1488685 -0.05692239 [6,] 0.00000000 0.00000000 0.2420550 0.11281148 0.1444202 0.00000000 [7,] 0.00000000 0.00000000 0.2351912 0.09040088 0.1416781 0.00000000 [8,] 0.00000000 0.00000000 0.2304804 0.00000000 0.1355450 0.00000000 [9,] 0.00000000 0.00000000 0.2239409 0.00000000 0.0000000 0.00000000 [10,] 0.00000000 0.00000000 0.2109308 0.00000000 0.0000000 0.00000000 [11,] 0.00000000 0.00000000 0.0000000 0.00000000 0.0000000 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.05293134 -0.1748425 0.04910895 -0.01802212 0.3693682 [2,] -0.05854309 -0.1740337 0.05241762 0.00000000 0.3709235 [3,] -0.06242587 -0.1741932 0.04930622 0.00000000 0.3721678 [4,] -0.06002419 -0.1744160 0.05252448 0.00000000 0.3760369 [5,] -0.06164136 -0.1809487 0.00000000 0.00000000 0.3746072 [6,] -0.05526643 -0.1751005 0.00000000 0.00000000 0.3711741 [7,] 0.00000000 -0.1672599 0.00000000 0.00000000 0.3683880 [8,] 0.00000000 -0.1587723 0.00000000 0.00000000 0.3714786 [9,] 0.00000000 -0.1189060 0.00000000 0.00000000 0.3673271 [10,] 0.00000000 0.0000000 0.00000000 0.00000000 0.3278760 [11,] 0.00000000 0.0000000 0.00000000 0.00000000 0.3518888 [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.75639 0.81932 0.06854 0.40717 0.26803 0.67630 0.71974 0.22906 0.72385 [2,] 0.73646 0.81231 0.06852 0.40162 0.26909 0.65985 0.67712 0.23047 0.70070 [3,] 0.75436 NA 0.06544 0.40203 0.27856 0.64280 0.65459 0.23043 0.71617 [4,] NA NA 0.06507 0.43365 0.29025 0.60510 0.66617 0.22909 0.69732 [5,] NA NA 0.06476 0.40727 0.26728 0.67036 0.65877 0.20915 NA [6,] NA NA 0.06925 0.42117 0.27847 NA 0.69049 0.21994 NA [7,] NA NA 0.07456 0.48072 0.28671 NA NA 0.23797 NA [8,] NA NA 0.08352 NA 0.31340 NA NA 0.26320 NA [9,] NA NA 0.10016 NA NA NA NA 0.39502 NA [10,] NA NA 0.12306 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.89946 0.01224 [2,] NA 0.01151 [3,] NA 0.01105 [4,] NA 0.00994 [5,] NA 0.01031 [6,] NA 0.01058 [7,] NA 0.01114 [8,] NA 0.01098 [9,] NA 0.01358 [10,] NA 0.02236 [11,] NA 0.01600 [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.0410 -0.0319 0.2576 0.1222 0.1593 -0.0598 -0.0529 -0.1748 s.e. 0.1316 0.1391 0.1384 0.1462 0.1422 0.1425 0.1467 0.1436 ar9 ar10 ar11 0.0491 -0.0180 0.3694 s.e. 0.1382 0.1419 0.1421 sigma^2 estimated as 22510461: log likelihood = -485.3, aic = 994.6 [[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.0410 -0.0319 0.2576 0.1222 0.1593 -0.0598 -0.0529 -0.1748 s.e. 0.1316 0.1391 0.1384 0.1462 0.1422 0.1425 0.1467 0.1436 ar9 ar10 ar11 0.0491 -0.0180 0.3694 s.e. 0.1382 0.1419 0.1421 sigma^2 estimated as 22510461: log likelihood = -485.3, aic = 994.6 [[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.0439 -0.0331 0.2576 0.1234 0.1581 -0.0624 -0.0585 -0.1740 s.e. 0.1296 0.1388 0.1384 0.1458 0.1415 0.1410 0.1398 0.1434 ar9 ar10 ar11 0.0524 0 0.3709 s.e. 0.1356 0 0.1415 sigma^2 estimated as 22515525: log likelihood = -485.31, aic = 992.62 [[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.0404 0 0.2601 0.1232 0.1481 -0.0655 -0.0624 -0.1742 0.0493 s.e. 0.1285 0 0.1382 0.1458 0.1353 0.1405 0.1387 0.1435 0.1349 ar10 ar11 0 0.3722 s.e. 0 0.1412 sigma^2 estimated as 22533232: log likelihood = -485.34, aic = 990.67 [[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 0 0.2605 0.1104 0.1426 -0.0721 -0.0600 -0.1744 0.0525 0 s.e. 0 0 0.1383 0.1399 0.1335 0.1385 0.1384 0.1433 0.1343 0 ar11 0.3760 s.e. 0.1406 sigma^2 estimated as 22566859: log likelihood = -485.39, aic = 988.77 [[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 0.2605 0.1165 0.1489 -0.0569 -0.0616 -0.1809 0 0 s.e. 0 0 0.1382 0.1395 0.1328 0.1330 0.1388 0.1424 0 0 ar11 0.3746 s.e. 0.1409 sigma^2 estimated as 22655631: log likelihood = -485.46, aic = 986.93 [[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 0.2421 0.1128 0.1444 0 -0.0553 -0.1751 0 0 s.e. 0 0 0.1306 0.1392 0.1319 0 0.1381 0.1411 0 0 ar11 0.3712 s.e. 0.1402 sigma^2 estimated as 22731739: log likelihood = -485.55, aic = 985.11 [[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 0.2352 0.0904 0.1417 0 0 -0.1673 0 0 0.3684 s.e. 0 0 0.1294 0.1273 0.1317 0 0 0.1402 0 0 0.1403 sigma^2 estimated as 22813709: log likelihood = -485.63, aic = 983.27 [[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.2305 0 0.1355 0 0 -0.1588 0 0 0.3715 s.e. 0 0 0.1308 0 0.1333 0 0 0.1405 0 0 0.1413 sigma^2 estimated as 23080558: log likelihood = -485.88, aic = 981.77 [[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.2239 0 0 0 0 -0.1189 0 0 0.3673 s.e. 0 0 0.1340 0 0 0 0 0.1388 0 0 0.1443 sigma^2 estimated as 23657286: log likelihood = -486.39, aic = 980.78 [[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 0 0.2109 0 0 0 0 0 0 0 0.3279 s.e. 0 0 0.1348 0 0 0 0 0 0 0 0.1398 sigma^2 estimated as 24138744: log likelihood = -486.75, aic = 979.5 $aic [1] 994.6008 992.6169 990.6740 988.7734 986.9258 985.1091 983.2690 981.7668 [9] 980.7787 979.4987 979.8796 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/1wtht1261090123.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 = 62 Frequency = 1 [1] 1.878767e+02 8.448493e+01 5.722766e+01 3.312842e+01 2.648063e+01 [6] 1.853581e+01 1.451293e+01 9.981136e+00 2.775841e+00 -7.943517e-03 [11] 3.546378e+00 -1.408688e+02 -1.065256e+03 -2.161583e+03 -1.305008e+04 [16] 7.566387e+02 1.059573e+03 5.581892e+03 -2.107746e+03 -3.456857e+03 [21] 1.743694e+03 2.595461e+03 9.918050e+03 -1.034469e+04 1.435222e+03 [26] -2.812145e+03 -4.583581e+03 -3.593790e+03 -4.689649e+03 3.452451e+03 [31] -1.384058e+03 -1.243349e+03 -9.075070e+02 -9.104158e+03 -1.020276e+04 [36] 1.400894e+04 4.823744e+03 -4.075390e+03 5.945268e+03 4.548468e+03 [41] 6.701560e+03 5.115882e+02 8.224912e+02 9.809808e+01 3.594549e+03 [46] 2.575163e+03 3.655519e+03 -4.616959e+03 1.389150e+03 -2.097179e+03 [51] 4.218651e+02 3.232196e+03 3.193672e+03 1.828794e+03 4.890491e+03 [56] 4.611985e+03 1.775411e+03 -1.196927e+03 1.107661e+03 2.298307e+02 [61] 6.570982e+02 3.379079e+02 > postscript(file="/var/www/html/rcomp/tmp/2zdz01261090123.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/3duz41261090123.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/4n31c1261090123.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/5lyej1261090123.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/60u281261090123.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/7d1bv1261090123.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/8gf291261090123.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/92v911261090123.tab") > > try(system("convert tmp/1wtht1261090123.ps tmp/1wtht1261090123.png",intern=TRUE)) character(0) > try(system("convert tmp/2zdz01261090123.ps tmp/2zdz01261090123.png",intern=TRUE)) character(0) > try(system("convert tmp/3duz41261090123.ps tmp/3duz41261090123.png",intern=TRUE)) character(0) > try(system("convert tmp/4n31c1261090123.ps tmp/4n31c1261090123.png",intern=TRUE)) character(0) > try(system("convert tmp/5lyej1261090123.ps tmp/5lyej1261090123.png",intern=TRUE)) character(0) > try(system("convert tmp/60u281261090123.ps tmp/60u281261090123.png",intern=TRUE)) character(0) > try(system("convert tmp/7d1bv1261090123.ps tmp/7d1bv1261090123.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.684 1.066 5.335