R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(25.2609 + ,16.8622 + ,13.3181 + ,12.5621 + ,14.2754 + ,12.2961 + ,10.0871 + ,13.5117 + ,13.9921 + ,13.6932 + ,14.4211 + ,15.3397 + ,16.5182 + ,15.2809 + ,15.6204 + ,15.5698 + ,15.9458 + ,16.4063 + ,17.55 + ,17.0353 + ,16.0591 + ,16.3643 + ,14.6527 + ,13.4664 + ,13.3266 + ,13.1823 + ,12.113 + ,13.354 + ,13.4537 + ,13.2715 + ,13.1959 + ,13.5542 + ,12.124 + ,10.967 + ,10.9201 + ,12.5971 + ,14.3177 + ,14.2471 + ,16.0926 + ,17.1334 + ,16.5866 + ,16.361 + ,15.8494 + ,15.5932 + ,16.6387 + ,16.8312 + ,16.5044 + ,16.5556 + ,16.7469 + ,15.9543 + ,15.5888 + ,14.3945 + ,13.8889 + ,12.9999 + ,14.1022 + ,19.6245 + ,24.7658 + ,25.9843 + ,22.9635 + ,19.6288 + ,17.3363 + ,13.311 + ,14.6359 + ,15.834 + ,16.2415 + ,15.9808 + ,16.9726 + ,16.8708 + ,16.923 + ,18.1138 + ,16.7716 + ,14.0299 + ,13.822 + ,14.2537 + ,14.3985 + ,15.2454 + ,15.6683 + ,16.1721 + ,14.8679 + ,14.1948 + ,14.7056 + ,15.3819 + ,15.5001 + ,14.7886 + ,14.563 + ,15.5528 + ,15.9781 + ,15.5139 + ,15.3603 + ,15.0512 + ,14.7874 + ,14.9624 + ,13.9188 + ,14.5146 + ,13.7115 + ,12.0738 + ,12.5688 + ,12.2547 + ,11.8741 + ,13.0261 + ,13.8681 + ,14.2137 + ,14.4743 + ,13.9764 + ,13.1558 + ,13.0991 + ,13.7831 + ,13.2546 + ,13.3426 + ,13.5011 + ,12.8245 + ,13.6596 + ,13.8754 + ,12.9011 + ,11.871 + ,12.3954 + ,12.8179 + ,12.1219 + ,12.6176 + ,13.6362 + ,13.5422 + ,13.362 + ,14.5735 + ,15.8357 + ,14.9927 + ,14.5078 + ,15.2648 + ,15.7163 + ,17.7969 + ,19.0408 + ,17.8571 + ,18.815 + ,19.0961 + ,17.6215 + ,17.0163 + ,15.8286 + ,16.7818 + ,15.8726 + ,16.6621 + ,17.5709 + ,16.9914 + ,18.0412 + ,16.9764 + ,15.7649 + ,14.3928 + ,13.5061 + ,12.7433 + ,13.017 + ,13.0171 + ,12.2412 + ,11.8878 + ,11.2511 + ,11.8583 + ,11.1202 + ,10.185 + ,8.7563 + ,9.5267 + ,9.4106 + ,11.878 + ,14.4228 + ,14.896 + ,15.6664 + ,18.147 + ,19.3069 + ,21.6807 + ,20.7934 + ,23.4241 + ,24.8273 + ,24.9276 + ,27.4256 + ,28.1746 + ,24.5615 + ,30.2532 + ,31.2514 + ,30.4733 + ,33.3047 + ,37.2103 + ,36.7711 + ,37.7163 + ,28.8488 + ,27.4682 + ,29.8793 + ,28.0598 + ,29.7733 + ,32.6926 + ,32.4803 + ,29.4168 + ,28.7054 + ,28.7614 + ,23.8075 + ,21.6987 + ,21.4691 + ,22.5709 + ,23.4546 + ,27.8976 + ,29.2965 + ,28.1191 + ,25.812 + ,25.931 + ,26.9925 + ,28.9213 + ,27.8898 + ,24.2473 + ,27.1056 + ,28.2833 + ,29.8076 + ,27.1826 + ,22.8764 + ,21.938 + ,23.3076 + ,24.9572 + ,26.4694 + ,23.9297 + ,24.7033 + ,24.646 + ,24.0496 + ,24.2096 + ,24.0717 + ,26.6673 + ,27.6457 + ,30.8791 + ,29.3278 + ,30.7268 + ,34.1204 + ,35.0205 + ,39.3565 + ,34.4724 + ,29.9762 + ,33.6008 + ,35.2464 + ,40.4137 + ,41.3922 + ,39.4243 + ,45.7259 + ,48.2549 + ,52.0461 + ,52.1871 + ,49.3474 + ,47.8653 + ,48.5179 + ,52.4815 + ,51.8171 + ,52.5811 + ,57.5617 + ,55.7091 + ,55.4378 + ,58.7493 + ,57.794 + ,50.282 + ,47.6976 + ,46.7381 + ,47.4282 + ,42.2269 + ,44.9066 + ,47.2648 + ,50.2325 + ,50.2504 + ,52.5685 + ,55.2325 + ,52.3674 + ,55.1692 + ,57.7252 + ,62.8232 + ,62.7599 + ,62.4387 + ,64.0862 + ,66.1209 + ,69.8474 + ,80.1039 + ,85.9319 + ,85.2843 + ,77.0383 + ,69.9981 + ,55.2039 + ,43.1188 + ,32.077 + ,34.2974 + ,34.5613 + ,36.5235 + ,39.0474 + ,42.8033 + ,49.5164 + ,46.459 + ,51.1313 + ,46.9331 + ,49.7654 + ,52.0729 + ,51.6425 + ,53.9784 + ,54.4891 + ,59.0665 + ,63.9929 + ,61.6167 + ,62.1816 + ,58.9178 + ,59.9151) > par9 = '1' > par8 = '2' > par7 = '0' > par6 = '3' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-0.4' > 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 <- 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.2635374 -0.11240930 0.04876471 -0.53719730 -0.06627285 0.5285303 [2,] 0.2592476 -0.10141045 0.00000000 -0.50002828 -0.06891912 0.4803327 [3,] 0.2622845 -0.09954696 0.00000000 -0.02348900 -0.04354564 0.0000000 [4,] 0.2617315 -0.10005948 0.00000000 0.00000000 -0.04322616 0.0000000 [5,] 0.2633615 -0.09556356 0.00000000 0.00000000 0.00000000 0.0000000 [6,] 0.2445012 0.00000000 0.00000000 0.00000000 0.00000000 0.0000000 [7,] NA NA NA NA NA NA [8,] NA NA NA NA NA NA [9,] NA NA NA NA NA NA [10,] NA NA NA NA NA NA [11,] NA NA NA NA NA NA [12,] NA NA NA NA NA NA [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2e-05 0.07220 0.43287 0.40807 0.33191 0.41866 [2,] 2e-05 0.09660 NA 0.45964 0.30316 0.48004 [3,] 1e-05 0.10276 NA 0.71715 0.51362 NA [4,] 2e-05 0.10078 NA NA 0.51680 NA [5,] 1e-05 0.11450 NA NA NA NA [6,] 4e-05 NA NA NA NA NA [7,] NA NA NA NA NA NA [8,] NA NA NA NA NA NA [9,] NA NA NA NA NA NA [10,] NA NA NA NA NA NA [11,] NA NA NA NA NA NA [12,] 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 sar1 sar2 sma1 0.2635 -0.1124 0.0488 -0.5372 -0.0663 0.5285 s.e. 0.0599 0.0623 0.0621 0.6484 0.0682 0.6526 sigma^2 estimated as 0.0001060: log likelihood = 931.21, aic = -1848.42 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 sar1 sar2 sma1 0.2635 -0.1124 0.0488 -0.5372 -0.0663 0.5285 s.e. 0.0599 0.0623 0.0621 0.6484 0.0682 0.6526 sigma^2 estimated as 0.0001060: log likelihood = 931.21, aic = -1848.42 [[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 sar1 sar2 sma1 0.2592 -0.1014 0 -0.5000 -0.0689 0.4803 s.e. 0.0597 0.0608 0 0.6753 0.0668 0.6793 sigma^2 estimated as 0.0001062: log likelihood = 930.9, aic = -1849.8 [[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 sar1 sar2 sma1 0.2623 -0.0995 0 -0.0235 -0.0435 0 s.e. 0.0596 0.0608 0 0.0648 0.0666 0 sigma^2 estimated as 0.0001065: log likelihood = 930.64, aic = -1851.27 [[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 sar1 sar2 sma1 0.2617 -0.1001 0 0 -0.0432 0 s.e. 0.0595 0.0608 0 0 0.0666 0 sigma^2 estimated as 0.0001065: log likelihood = 930.57, aic = -1853.14 [[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 sar1 sar2 sma1 0.2634 -0.0956 0 0 0 0 s.e. 0.0595 0.0604 0 0 0 0 sigma^2 estimated as 0.0001067: log likelihood = 930.36, aic = -1854.72 $aic [1] -1848.424 -1849.804 -1851.273 -1853.141 -1854.721 -1854.226 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 > postscript(file="/var/www/rcomp/tmp/145ot1292171320.ps",horizontal=F,onefile=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 = 296 Frequency = 1 [1] 2.748022e-04 4.659297e-02 2.028695e-02 4.584070e-03 -1.727298e-02 [6] 2.681516e-02 2.288696e-02 -4.970317e-02 9.518077e-03 1.258667e-04 [11] -8.461695e-03 -6.205591e-03 -8.265575e-03 1.207884e-02 -6.589106e-03 [16] 2.191518e-03 -3.562933e-03 -2.864724e-03 -8.003308e-03 5.737709e-03 [21] 5.851326e-03 -4.131024e-03 1.615602e-02 7.609972e-03 -2.009283e-04 [26] 2.281119e-03 1.200155e-02 -1.719152e-02 3.834541e-03 8.628130e-04 [31] 2.033418e-04 -3.827239e-03 1.715710e-02 1.049026e-02 -1.778687e-03 [36] -2.007842e-02 -1.243647e-02 3.415041e-03 -1.834393e-02 -3.754873e-03 [41] 4.766798e-03 -9.639192e-05 4.111340e-03 1.235087e-03 -8.711228e-03 [46] 9.653623e-04 2.121748e-03 -1.216209e-03 -1.142481e-03 6.697594e-03 [51] 1.262647e-03 1.059481e-02 2.407248e-03 9.086274e-03 -1.347284e-02 [56] -3.904153e-02 -1.680136e-02 -2.260416e-03 1.257585e-02 1.436218e-02 [61] 1.192819e-02 3.330044e-02 -2.112301e-02 -3.705565e-03 -1.824237e-03 [66] 1.999389e-03 -8.734818e-03 3.048130e-03 -1.353818e-03 -8.476192e-03 [71] 1.205838e-02 2.054571e-02 -3.289095e-03 -2.535302e-03 -6.873111e-05 [76] -7.818748e-03 -1.745780e-03 -3.963681e-03 1.198754e-02 2.995076e-03 [81] -5.458876e-03 -4.194757e-03 1.127645e-04 6.027605e-03 3.324173e-04 [86] -8.839237e-03 -1.038578e-03 4.008790e-03 -4.151166e-05 2.761026e-03 [91] 1.805714e-03 -1.968644e-03 1.059267e-02 -8.570141e-03 1.037608e-02 [96] 1.568024e-02 -9.954862e-03 6.997027e-03 3.124967e-03 -1.438851e-02 [101] -4.857420e-03 -2.379863e-03 -2.450052e-03 5.174130e-03 7.016124e-03 [106] -1.167071e-03 -6.549444e-03 7.475009e-03 -3.082026e-03 -8.966554e-04 [111] 7.686513e-03 -1.107235e-02 8.697054e-04 1.003983e-02 9.241302e-03 [116] -8.590594e-03 -2.024333e-03 8.812916e-03 -8.471187e-03 -8.769974e-03 [121] 3.335293e-03 5.780258e-04 -1.250248e-02 -7.823480e-03 9.119012e-03 [126] 1.482589e-03 -7.389013e-03 -1.648658e-03 -1.575266e-02 -4.555944e-03 [131] 8.681292e-03 -9.442926e-03 6.559226e-04 9.897784e-03 1.648955e-03 [136] 9.233677e-03 -9.721436e-03 1.021210e-02 -9.016058e-03 -4.449324e-03 [141] 5.479754e-03 -9.412809e-03 1.016423e-02 6.914495e-03 1.049920e-02 [146] 6.549057e-03 7.146712e-03 -4.398307e-03 1.598001e-03 8.624064e-03 [151] 1.979540e-03 7.982956e-03 -9.665882e-03 1.255445e-02 1.034044e-02 [156] 2.196117e-02 -1.910709e-02 8.016616e-03 -3.813262e-02 -1.801975e-02 [161] -5.663544e-04 -8.269519e-03 -1.763181e-02 -3.323318e-03 -1.366226e-02 [166] 7.842691e-03 -1.644518e-02 -2.403987e-03 -5.107936e-05 -1.085964e-02 [171] -1.661408e-04 1.460602e-02 -2.641115e-02 3.974463e-03 1.302584e-03 [176] -9.890045e-03 -8.085706e-03 3.081073e-03 -3.703802e-03 2.722787e-02 [181] -2.043133e-03 -7.622662e-03 9.348855e-03 -8.736475e-03 -7.198711e-03 [186] 2.545450e-03 8.972273e-03 -3.949735e-05 8.644642e-05 2.078936e-02 [191] 5.219172e-03 4.025956e-04 -5.124181e-03 -2.732448e-03 -1.837814e-02 [196] -5.395280e-04 3.818891e-03 7.553990e-03 -2.506775e-03 -3.320894e-03 [201] -6.194758e-03 5.314710e-03 1.350888e-02 -1.581922e-02 1.539134e-04 [206] -5.434321e-03 1.066773e-02 1.599428e-02 7.342544e-04 -6.409205e-03 [211] -5.363189e-03 -5.070133e-03 1.206429e-02 -7.089481e-03 2.254137e-03 [216] 2.325464e-03 -1.437418e-03 1.096061e-03 -1.148275e-02 -8.257862e-04 [221] -1.153278e-02 7.936169e-03 -7.268184e-03 -8.663668e-03 -2.353154e-04 [226] -1.133190e-02 1.518248e-02 9.601681e-03 -1.393069e-02 -2.946665e-04 [231] -1.267961e-02 7.606642e-04 3.784763e-03 -1.462022e-02 -7.050242e-04 [236] -6.370888e-03 1.000935e-03 4.107254e-03 1.333409e-03 -1.384481e-03 [241] -5.995836e-03 2.661857e-03 -2.104954e-03 -6.869803e-03 4.407736e-03 [246] -9.905963e-04 -4.457564e-03 2.539696e-03 1.052390e-02 1.597188e-03 [251] 1.647356e-03 -1.288688e-03 1.065547e-02 -8.234877e-03 -2.020584e-03 [256] -4.501771e-03 9.030216e-04 -4.215297e-03 -3.033576e-03 5.028308e-03 [261] -5.759041e-03 -2.080382e-03 -6.026383e-03 1.462914e-03 -2.560186e-04 [266] -2.078963e-03 -1.792999e-03 -3.626584e-03 -8.913341e-03 -2.615850e-03 [271] 8.414719e-04 6.419127e-03 5.076719e-03 1.707150e-02 1.674098e-02 [276] 2.411335e-02 -1.194290e-02 3.656785e-03 -5.730414e-03 -4.930264e-03 [281] -7.186236e-03 -1.100260e-02 7.943032e-03 -1.073040e-02 9.876919e-03 [286] -7.645914e-03 -1.765215e-03 1.200767e-03 -4.160909e-03 2.564875e-04 [291] -6.560623e-03 -4.552955e-03 3.901386e-03 -2.051543e-03 4.639078e-03 [296] -2.477886e-03 > postscript(file="/var/www/rcomp/tmp/245ot1292171320.ps",horizontal=F,onefile=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/rcomp/tmp/345ot1292171320.ps",horizontal=F,onefile=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/rcomp/tmp/4efne1292171320.ps",horizontal=F,onefile=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/rcomp/tmp/5efne1292171320.ps",horizontal=F,onefile=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/rcomp/tmp/6efne1292171320.ps",horizontal=F,onefile=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/rcomp/tmp/7efne1292171320.ps",horizontal=F,onefile=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/83ykq1292171320.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/rcomp/tmp/9ep1a1292171320.tab") > > try(system("convert tmp/145ot1292171320.ps tmp/145ot1292171320.png",intern=TRUE)) character(0) > try(system("convert tmp/245ot1292171320.ps tmp/245ot1292171320.png",intern=TRUE)) character(0) > try(system("convert tmp/345ot1292171320.ps tmp/345ot1292171320.png",intern=TRUE)) character(0) > try(system("convert tmp/4efne1292171320.ps tmp/4efne1292171320.png",intern=TRUE)) character(0) > try(system("convert tmp/5efne1292171320.ps tmp/5efne1292171320.png",intern=TRUE)) character(0) > try(system("convert tmp/6efne1292171320.ps tmp/6efne1292171320.png",intern=TRUE)) character(0) > try(system("convert tmp/7efne1292171320.ps tmp/7efne1292171320.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.560 3.140 8.741