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(349 + ,336 + ,331 + ,327 + ,323 + ,322 + ,385 + ,405 + ,412 + ,411 + ,410 + ,415 + ,414 + ,411 + ,408 + ,410 + ,411 + ,416 + ,479 + ,498 + ,502 + ,498 + ,499 + ,506 + ,510 + ,509 + ,502 + ,495 + ,490 + ,490 + ,553 + ,570 + ,573 + ,572 + ,575 + ,580 + ,580 + ,574 + ,563 + ,556 + ,546 + ,545 + ,605 + ,628 + ,631 + ,626 + ,614 + ,606 + ,602 + ,589 + ,574 + ,558 + ,552 + ,546 + ,607 + ,636 + ,631 + ,623 + ,618 + ,605 + ,619 + ,596 + ,570 + ,546 + ,528 + ,506 + ,555 + ,568 + ,564 + ,553 + ,541 + ,542 + ,540 + ,521 + ,505 + ,491 + ,482 + ,478 + ,523 + ,531 + ,532 + ,540 + ,525 + ,533 + ,531 + ,508 + ,495 + ,482 + ,470 + ,466 + ,515 + ,518 + ,516 + ,511 + ,500 + ,498 + ,494 + ,476 + ,458 + ,443 + ,430 + ,424 + ,476 + ,481 + ,470 + ,460 + ,451 + ,450 + ,444 + ,429 + ,421 + ,400 + ,389 + ,384 + ,432 + ,446 + ,431 + ,423 + ,416 + ,416 + ,413 + ,399 + ,386 + ,374 + ,365 + ,365 + ,418 + ,428 + ,424 + ,421 + ,417 + ,423 + ,423 + ,419 + ,406 + ,398 + ,390 + ,391 + ,444 + ,460 + ,455 + ,456 + ,452 + ,459 + ,461 + ,451 + ,443 + ,439 + ,430 + ,436 + ,488 + ,506 + ,502 + ,501 + ,501 + ,515 + ,521 + ,520 + ,512 + ,509 + ,505 + ,511 + ,570 + ,592 + ,594 + ,586 + ,586 + ,592 + ,594 + ,586 + ,572 + ,563 + ,555 + ,554 + ,601 + ,622 + ,617 + ,606 + ,595 + ,599 + ,600 + ,592 + ,575 + ,567 + ,555 + ,555 + ,608 + ,631 + ,629 + ,624 + ,610 + ,616 + ,621 + ,604 + ,584 + ,574 + ,555 + ,545 + ,599 + ,620 + ,608 + ,590 + ,579 + ,580 + ,579 + ,572 + ,560 + ,551 + ,537 + ,541 + ,588 + ,607 + ,599 + ,578 + ,563 + ,566 + ,561 + ,554 + ,540 + ,526 + ,512 + ,505 + ,554 + ,584 + ,569 + ,540 + ,522 + ,526 + ,527 + ,516 + ,503 + ,489 + ,479 + ,475 + ,524 + ,552 + ,532 + ,511 + ,492 + ,492 + ,493 + ,481 + ,462 + ,457 + ,442 + ,439 + ,488 + ,521 + ,501 + ,485 + ,464 + ,460 + ,467 + ,460 + ,448 + ,443 + ,436 + ,431 + ,484 + ,510 + ,513 + ,503 + ,471 + ,471 + ,476 + ,475 + ,470 + ,461 + ,455 + ,456 + ,517 + ,525 + ,523 + ,519 + ,509 + ,512 + ,519 + ,517 + ,510 + ,509 + ,501 + ,507 + ,569 + ,580 + ,578 + ,565 + ,547 + ,555 + ,562 + ,561 + ,555 + ,544 + ,537 + ,543 + ,594 + ,611 + ,613 + ,611 + ,594 + ,595 + ,591 + ,589 + ,584 + ,573 + ,567 + ,569 + ,621 + ,629 + ,628 + ,612 + ,595 + ,597 + ,593 + ,590 + ,580 + ,574 + ,573 + ,573 + ,620 + ,626 + ,620 + ,588 + ,566 + ,557 + ,561 + ,549 + ,532 + ,526 + ,511 + ,499 + ,555 + ,565 + ,542 + ,527 + ,510 + ,514 + ,517 + ,508 + ,493 + ,490 + ,469 + ,478 + ,528 + ,534 + ,518 + ,506 + ,502 + ,516 + ,528 + ,533 + ,536 + ,537 + ,524 + ,536 + ,587 + ,597 + ,581 + ,564 + ,558) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = 'FALSE' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > 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 > par7 <- 3 > 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.1887125 0.02842105 0.9144962 0.3284718 0.1609338 -0.7663330 0.3596980 [2,] -0.1977930 0.01820360 0.9062417 0.3427570 0.1753145 -0.7527449 0.3529403 [3,] -0.1082992 0.00000000 0.8926109 0.2397291 0.2103267 -0.7768229 0.3405317 [4,] NA NA NA NA NA NA NA [5,] NA NA NA NA NA NA NA [6,] NA NA NA NA NA NA NA [7,] NA NA NA NA NA NA NA [8,] NA NA NA NA NA NA NA [9,] NA NA NA NA NA NA NA [10,] NA NA NA NA NA NA NA [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 [,8] [,9] [1,] 0.03685677 -0.8518510 [2,] 0.00000000 -0.8343536 [3,] 0.00000000 -0.8198690 [4,] NA NA [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 [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.00013 0.58880 0 2e-05 0.05205 0 0.00008 0.60638 0 [2,] 0.00007 0.73539 0 1e-05 0.03852 0 0.00014 NA 0 [3,] 0.00005 NA 0 0e+00 0.00000 0 0.00015 NA 0 [4,] NA NA NA NA NA NA NA NA NA [5,] NA NA NA NA NA NA NA NA NA [6,] NA NA NA NA NA NA NA NA NA [7,] NA NA NA NA NA NA NA NA NA [8,] NA NA NA NA NA NA NA NA NA [9,] NA NA NA NA NA NA NA NA NA [10,] NA 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 [[3]] [[3]][[1]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 ma2 ma3 sar1 sar2 sma1 -0.1887 0.0284 0.9145 0.3285 0.1609 -0.7663 0.3597 0.0369 -0.8519 s.e. 0.0487 0.0525 0.0465 0.0768 0.0826 0.0750 0.0900 0.0715 0.0710 sigma^2 estimated as 31.9: log likelihood = -1095.97, aic = 2211.93 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 ma2 ma3 sar1 sar2 sma1 -0.1887 0.0284 0.9145 0.3285 0.1609 -0.7663 0.3597 0.0369 -0.8519 s.e. 0.0487 0.0525 0.0465 0.0768 0.0826 0.0750 0.0900 0.0715 0.0710 sigma^2 estimated as 31.9: log likelihood = -1095.97, aic = 2211.93 [[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 ma1 ma2 ma3 sar1 sar2 sma1 -0.1978 0.0182 0.9062 0.3428 0.1753 -0.7527 0.3529 0 -0.8344 s.e. 0.0492 0.0538 0.0484 0.0773 0.0844 0.0762 0.0917 0 0.0643 sigma^2 estimated as 31.93: log likelihood = -1096.11, aic = 2210.21 [[3]][[4]] NULL [[3]][[5]] NULL [[3]][[6]] NULL [[3]][[7]] NULL [[3]][[8]] NULL [[3]][[9]] NULL $aic [1] 2211.935 2210.214 2208.387 Warning messages: 1: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : possible convergence problem: optim gave code=1 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 > postscript(file="/var/www/html/rcomp/tmp/1geoe1260619839.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 = 359 Frequency = 1 [1] 0.20149520 0.08004155 0.04817361 0.03237869 0.02221099 [6] 0.01756066 0.07368755 0.08322405 0.08056712 0.07153708 [11] 0.06406318 -0.12969719 -1.05389947 8.44160229 0.26480923 [16] 3.61402648 2.35089968 3.52769729 -2.36177430 -2.65651876 [21] -3.42834859 -2.99884786 1.99258766 2.28027601 4.37153301 [26] 3.28919124 -4.30465796 -7.56205661 -3.96472569 -1.32683161 [31] 1.15344273 -1.21036277 -0.10339327 2.86226848 3.19201503 [36] -0.48434604 -2.23734272 -1.67193083 -3.72628235 -1.19974359 [41] -4.51552148 0.78236184 -1.60798161 6.66144507 0.11561510 [46] -3.14096477 -11.95543577 -9.60458651 -0.56573054 -2.59593660 [51] -2.29858759 -6.90851594 5.75583354 -2.00548828 2.57422580 [56] 10.27223384 -7.04761285 -3.09340158 3.94489631 -8.00055683 [61] 16.89797401 -12.29544138 -12.37291717 -10.85596104 -6.60553081 [66] -12.70562864 -6.74036180 -3.28999072 4.25421478 -0.39070004 [71] -1.28505319 12.05337801 -7.21238785 1.76793712 4.57202060 [76] 4.10948518 5.14909985 8.04290388 -10.51887199 -7.67152469 [81] 3.20253937 17.16265889 -7.80963644 6.44209467 -2.56850146 [86] -7.96053252 0.44291837 0.90240090 -3.13747965 0.05861155 [91] -0.59436320 -9.83263587 -2.06944539 -2.96354673 1.49895087 [96] -4.73215337 0.42031840 1.74523389 -3.81206784 0.81044743 [101] -1.78307109 0.16321450 2.67433074 -4.57723528 -8.67907941 [106] -1.77255966 2.06381115 2.23071928 -1.39811757 1.98375073 [111] 9.37247396 -6.74227767 -0.71502489 2.14203937 -4.08093041 [116] 3.64296045 -7.74732386 0.75551680 1.17881917 2.78180429 [121] 0.66560136 -0.03642356 -0.38950446 4.82621319 -0.30247849 [126] 6.17324559 0.09939248 -5.79052465 5.84989928 1.63802667 [131] 1.34506842 5.97158098 -0.85815964 7.89732766 -1.49602390 [136] 1.26033519 -1.47904386 2.82889295 -3.62945239 2.68008913 [141] -1.42101133 2.16036332 0.29809967 3.45838882 -0.74731963 [146] -2.08623509 4.64177875 3.38181816 -1.80327782 6.33815307 [151] -4.91188075 2.58713674 -0.85714853 -2.00415872 5.12696173 [156] 8.35189503 1.45523115 8.25198216 -1.39009836 0.52151014 [161] 2.85955775 1.17713697 2.08223527 3.94730039 2.30209207 [166] -10.22044252 2.26988281 -4.33510774 -2.75959340 -1.08375313 [171] -4.65657126 -2.43276121 0.31053940 -3.01600836 -8.64256681 [176] 6.00185100 -3.18960659 -4.22561345 -5.37141272 1.18741445 [181] 1.75712465 3.93977951 -3.77134960 2.65125463 -1.89989575 [186] 1.18374453 3.50710640 5.77573710 0.60826258 2.05816886 [191] -6.29327211 0.89879284 4.45181494 -8.01541706 -6.12640390 [196] 0.88896336 -6.93547745 -8.81890476 5.24098523 4.02361697 [201] -9.12615721 -9.33337004 3.24809065 -2.06229813 0.02927899 [206] 9.48582980 4.84442772 1.79904158 -0.04586650 8.67895505 [211] -6.78878051 -1.11683524 -0.66130247 -7.98369036 -5.44139285 [216] 2.19444818 -2.53506677 2.63226706 0.32688963 -2.77381841 [221] -1.43884133 -6.10645394 2.08021000 12.10661510 -8.02775423 [226] -13.39397551 -4.59863355 5.11875368 5.48532447 -2.08437211 [231] 3.39270604 -1.48493248 2.70026695 1.84814666 -1.67866482 [236] 3.24709997 -8.48435406 -0.91591478 -4.57656328 -0.80952506 [241] 1.34854005 -0.31116344 -3.17812027 7.76253192 -3.57505148 [246] 1.73526472 -1.76129780 9.91930725 -6.38044800 -0.09276492 [251] -5.17046592 -4.34801338 6.63853034 5.54078016 4.06113912 [256] 0.44361915 6.35528726 -4.26389616 0.57102093 -1.17826873 [261] 16.51095813 0.96496316 -17.40718399 -0.52279141 0.83553128 [266] 8.50313182 5.73552894 -4.06144369 2.79137617 2.11604173 [271] 7.20331713 -18.77141408 0.58550784 8.97803171 12.49200667 [276] -2.40392576 1.87695973 1.25438411 -1.46293052 6.72871132 [281] -1.99220013 3.09877182 4.15826616 -7.45859851 0.05332119 [286] -4.41071329 -5.71849125 4.61799934 3.58961153 2.52747350 [291] 1.30446221 -5.81881391 0.81184533 2.86751838 -5.71751886 [296] -0.12378031 6.52739154 11.28855795 -4.33411209 -5.87239507 [301] -8.15122284 1.07783271 4.57433096 -0.59277043 0.41136533 [306] -0.14993300 0.20622223 -12.19075000 3.72839108 -7.10628260 [311] -0.50892480 3.30403981 -1.76792039 0.48107225 0.56191307 [316] 4.88308988 5.06547427 -0.01428170 -6.71006157 -8.38938781 [321] 0.70436483 -17.56025835 -2.88442777 -4.75130654 8.61557261 [326] -5.89752724 -1.56040600 3.53749491 -8.11860713 -6.85424970 [331] 8.84042979 1.29888334 -14.09676195 9.48883828 5.36986020 [336] 9.77164681 -1.81963420 0.58305875 -0.84838973 2.32268639 [341] -8.64597651 16.23172002 -7.10023506 -5.88936252 -1.20391878 [346] 2.65476422 14.49934427 9.47757739 5.26783087 9.95388373 [351] 10.63808642 -0.81302391 -2.48362282 2.81638570 -5.75612039 [356] -2.63274456 -7.30739341 -5.35700420 4.85353130 > postscript(file="/var/www/html/rcomp/tmp/2w81a1260619839.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/3vxyv1260619839.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/48ev71260619839.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/5jjye1260619839.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/6f7ab1260619839.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/76p1r1260619839.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/8td9g1260619839.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/99ck21260619839.tab") > system("convert tmp/1geoe1260619839.ps tmp/1geoe1260619839.png") > system("convert tmp/2w81a1260619839.ps tmp/2w81a1260619839.png") > system("convert tmp/3vxyv1260619839.ps tmp/3vxyv1260619839.png") > system("convert tmp/48ev71260619839.ps tmp/48ev71260619839.png") > system("convert tmp/5jjye1260619839.ps tmp/5jjye1260619839.png") > system("convert tmp/6f7ab1260619839.ps tmp/6f7ab1260619839.png") > system("convert tmp/76p1r1260619839.ps tmp/76p1r1260619839.png") > > > proc.time() user system elapsed 56.687 3.596 59.692