R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(541 + ,48 + ,52 + ,53 + ,65 + ,68 + ,64 + ,57 + ,55 + ,54 + ,59 + ,66 + ,83 + ,100 + ,101 + ,98 + ,92 + ,85 + ,92 + ,94 + ,90 + ,99 + ,108 + ,106 + ,99 + ,100 + ,99 + ,93 + ,92 + ,93 + ,98 + ,95 + ,86 + ,85 + ,83 + ,85 + ,80 + ,84 + ,86 + ,87 + ,85 + ,83 + ,76 + ,70 + ,78 + ,83 + ,88 + ,90 + ,90 + ,97 + ,102 + ,101 + ,98 + ,98 + ,100 + ,102 + ,108 + ,112 + ,110 + ,110 + ,117 + ,120 + ,119 + ,113 + ,123 + ,120 + ,129 + ,132 + ,136 + ,141 + ,122 + ,137 + ,145 + ,155 + ,148 + ,153 + ,172 + ,169 + ,180 + ,190 + ,233 + ,231 + ,245 + ,299 + ,385 + ,381 + ,322 + ,317 + ,323 + ,393 + ,372 + ,387 + ,413 + ,405 + ,407 + ,392 + ,363 + ,358 + ,375 + ,370 + ,386 + ,353 + ,347 + ,363 + ,350 + ,347 + ,333 + ,327 + ,328 + ,309 + ,286 + ,319 + ,285 + ,301 + ,315 + ,388 + ,383 + ,417 + ,423 + ,430 + ,486 + ,394 + ,411 + ,431 + ,447 + ,432 + ,457 + ,453 + ,441 + ,416 + ,451 + ,432 + ,436 + ,429 + ,421 + ,425 + ,437 + ,432 + ,413 + ,419 + ,436 + ,421 + ,424 + ,402 + ,403 + ,400 + ,426 + ,418 + ,403 + ,405 + ,394 + ,400 + ,376 + ,367 + ,354 + ,348 + ,364 + ,329 + ,348 + ,330 + ,351 + ,336 + ,332 + ,349 + ,384 + ,370 + ,346 + ,338 + ,335 + ,338 + ,347 + ,372 + ,376 + ,373 + ,392 + ,374 + ,385 + ,372 + ,372 + ,352 + ,353 + ,330 + ,348 + ,346 + ,361 + ,364 + ,375 + ,369 + ,342 + ,338 + ,337 + ,333 + ,336 + ,322 + ,329 + ,322 + ,325 + ,331 + ,311 + ,318 + ,312 + ,315 + ,333 + ,311 + ,321 + ,316 + ,284 + ,281 + ,280 + ,266 + ,268 + ,278 + ,292 + ,263 + ,265 + ,266 + ,251 + ,256 + ,280 + ,283 + ,289 + ,308 + ,293 + ,281 + ,274 + ,277 + ,278 + ,250 + ,265 + ,269 + ,262 + ,258 + ,251 + ,243 + ,247 + ,224 + ,241 + ,255 + ,261 + ,267 + ,264 + ,270 + ,275 + ,281 + ,301 + ,321 + ,355 + ,319 + ,299 + ,319 + ,328 + ,348 + ,335 + ,333 + ,331 + ,318 + ,325 + ,318 + ,313 + ,313 + ,315 + ,298 + ,311 + ,309 + ,297 + ,294 + ,291 + ,292 + ,290 + ,287 + ,281 + ,295 + ,289 + ,286 + ,295 + ,291 + ,315 + ,306 + ,304 + ,309 + ,307 + ,299 + ,294 + ,295 + ,296 + ,294 + ,292 + ,290 + ,289 + ,310 + ,297 + ,301 + ,302 + ,297 + ,305 + ,298 + ,299 + ,273 + ,267 + ,266 + ,284 + ,276 + ,284 + ,285 + ,267 + ,273 + ,262 + ,246 + ,251 + ,248 + ,255 + ,245 + ,251 + ,261 + ,259 + ,271 + ,258 + ,253 + ,239 + ,241 + ,281 + ,285 + ,289 + ,290 + ,290 + ,305 + ,289 + ,302 + ,294 + ,301 + ,299 + ,312 + ,310 + ,312 + ,309 + ,292 + ,284 + ,290 + ,292 + ,297 + ,316 + ,320 + ,304 + ,301 + ,322 + ,309 + ,308 + ,311 + ,328 + ,343 + ,345 + ,342 + ,350 + ,322 + ,311 + ,319 + ,328 + ,320 + ,321 + ,331 + ,342 + ,322 + ,307 + ,302 + ,307 + ,301 + ,315 + ,342 + ,333 + ,332 + ,332 + ,330 + ,322 + ,319 + ,345 + ,324 + ,322 + ,325 + ,325 + ,335 + ,335 + ,335 + ,341 + ,320 + ,324 + ,328 + ,329 + ,338 + ,336 + ,361 + ,353 + ,352 + ,393 + ,393 + ,420 + ,435 + ,468 + ,466 + ,481 + ,511 + ,508 + ,480 + ,496 + ,487 + ,473 + ,473 + ,488 + ,479 + ,501 + ,503 + ,497 + ,496 + ,490 + ,482 + ,486 + ,493 + ,522 + ,546 + ,534 + ,570 + ,624 + ,640 + ,589 + ,559 + ,570 + ,590 + ,588 + ,566 + ,630 + ,576 + ,642 + ,626 + ,718 + ,750 + ,690 + ,667 + ,689 + ,666 + ,662 + ,666 + ,681 + ,705 + ,783 + ,758 + ,776 + ,812 + ,824 + ,887 + ,984 + ,1016 + ,897 + ,980 + ,957 + ,969 + ,1063 + ,1048 + ,968 + ,1022 + ,1014 + ,1035 + ,1069 + ,1038 + ,1133 + ,1260 + ,1207 + ,1235 + ,1297 + ,1179 + ,1332 + ,1323 + ,1248 + ,1248 + ,1260 + ,1260 + ,1317 + ,1308 + ,1380 + ,1327 + ,1327) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '0.3' > 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 > 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.01582629 -0.05595447 -0.1372845 -0.1121157 -0.1271517 -0.01378668 [2,] 0.00000000 -0.05406089 -0.1361610 -0.1270934 -0.1267651 -0.01387793 [3,] 0.00000000 -0.05515283 -0.1370513 -0.1272429 -0.1245404 0.00000000 [4,] 0.00000000 0.00000000 -0.1411719 -0.1374787 -0.1189146 0.00000000 [5,] 0.00000000 0.00000000 -0.1624982 -0.1397262 0.0000000 0.00000000 [6,] 0.00000000 0.00000000 -0.1558122 0.0000000 0.0000000 0.00000000 [7,] 0.00000000 0.00000000 0.0000000 0.0000000 0.0000000 0.00000000 [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 [13,] NA NA NA NA NA NA [14,] NA NA NA NA NA NA [,7] [1,] -0.8778400 [2,] -0.8778607 [3,] -0.8796911 [4,] -0.8823613 [5,] -0.8934448 [6,] -0.8953843 [7,] -0.9006128 [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA [13,] NA [14,] NA [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.96625 0.57437 0.14633 0.75765 0.18942 0.88303 0 [2,] NA 0.54994 0.13425 0.13863 0.18934 0.88228 0 [3,] NA 0.54055 0.13027 0.13772 0.18973 NA 0 [4,] NA NA 0.11801 0.11959 0.20785 NA 0 [5,] NA NA 0.06762 0.11058 NA NA 0 [6,] NA NA 0.08049 NA NA NA 0 [7,] NA NA NA NA NA NA 0 [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 [[3]] [[3]][[1]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 -0.0158 -0.0560 -0.1373 -0.1121 -0.1272 -0.0138 -0.8778 s.e. 0.3738 0.0996 0.0944 0.3631 0.0968 0.0937 0.0433 sigma^2 estimated as 0.03378: log likelihood = 117.81, aic = -219.62 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 -0.0158 -0.0560 -0.1373 -0.1121 -0.1272 -0.0138 -0.8778 s.e. 0.3738 0.0996 0.0944 0.3631 0.0968 0.0937 0.0433 sigma^2 estimated as 0.03378: log likelihood = 117.81, aic = -219.62 [[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 sar1 sar2 sma1 0 -0.0541 -0.1362 -0.1271 -0.1268 -0.0139 -0.8779 s.e. 0 0.0904 0.0908 0.0857 0.0964 0.0937 0.0433 sigma^2 estimated as 0.03378: log likelihood = 117.81, aic = -221.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 ma1 sar1 sar2 sma1 0 -0.0552 -0.1371 -0.1272 -0.1245 0 -0.8797 s.e. 0 0.0901 0.0904 0.0856 0.0948 0 0.0410 sigma^2 estimated as 0.03379: log likelihood = 117.8, aic = -223.6 [[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 ma1 sar1 sar2 sma1 0 0 -0.1412 -0.1375 -0.1189 0 -0.8824 s.e. 0 0 0.0901 0.0882 0.0943 0 0.0399 sigma^2 estimated as 0.03381: log likelihood = 117.61, aic = -225.23 [[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 ma1 sar1 sar2 sma1 0 0 -0.1625 -0.1397 0 0 -0.8934 s.e. 0 0 0.0887 0.0874 0 0 0.0361 sigma^2 estimated as 0.03402: log likelihood = 116.83, aic = -225.65 [[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 ma1 sar1 sar2 sma1 0 0 -0.1558 0 0 0 -0.8954 s.e. 0 0 0.0890 0 0 0 0.0350 sigma^2 estimated as 0.03419: log likelihood = 115.61, aic = -225.23 $aic [1] -219.6200 -221.6182 -223.5963 -225.2253 -225.6525 -225.2280 -224.1593 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 > postscript(file="/var/fisher/rcomp/tmp/1ro0c1356119927.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 = 479 Frequency = 1 [1] 3.814156e-03 -9.372109e-04 -5.479368e-04 -3.918701e-04 -1.246612e-04 [6] -5.986765e-05 -1.107659e-04 -2.085735e-04 -2.192290e-04 -2.146222e-04 [11] -1.099399e-04 -2.086731e-03 -2.407332e-02 2.670961e+00 -4.840949e-02 [16] -4.030121e-02 2.060716e-01 -1.109463e-01 1.091804e-01 1.063987e-01 [21] -2.774203e-02 1.144474e-01 -1.764291e-01 -1.019277e-01 -2.302192e-01 [26] 1.342241e+00 -6.196105e-02 -8.879276e-02 1.427946e-01 2.233208e-02 [31] 3.225141e-02 2.136654e-02 -5.773049e-02 -4.610740e-02 -2.566119e-01 [36] -2.293214e-02 -1.350317e-01 9.585067e-01 -6.629152e-04 2.132699e-02 [41] 9.287596e-02 -1.490132e-02 -1.104678e-01 -3.298045e-02 1.661416e-01 [46] 2.051957e-02 -1.135360e-01 1.601250e-02 -2.089893e-02 7.745040e-01 [51] 3.048321e-02 3.000232e-03 6.662593e-02 1.875825e-02 2.666735e-02 [56] 8.027525e-02 8.493157e-02 1.023463e-02 -1.588620e-01 -1.941598e-02 [61] 5.212084e-02 5.537005e-01 -4.652285e-02 -3.685718e-02 1.808084e-01 [66] -2.529435e-02 7.855418e-02 9.156707e-02 3.434826e-02 2.101809e-02 [71] -2.866579e-01 1.229326e-01 4.100681e-02 4.890280e-01 -6.648463e-02 [76] 7.494528e-02 2.113027e-01 -2.231527e-02 7.817682e-02 1.304300e-01 [81] 2.859640e-01 -4.183654e-02 3.824589e-02 3.070639e-01 3.728360e-01 [86] 3.483212e-01 -2.549112e-01 4.736561e-02 3.499004e-02 3.044799e-01 [91] -1.271988e-01 8.327007e-02 1.145564e-01 -8.546778e-02 -4.969815e-02 [96] -1.477334e-01 -2.469514e-01 2.797273e-01 9.009792e-02 -4.383762e-02 [101] 7.177314e-02 -1.735098e-01 -4.143652e-02 8.605514e-02 -1.564067e-01 [106] -4.236951e-02 -1.200675e-01 -1.180514e-01 -6.884985e-02 1.542379e-01 [111] -1.230199e-01 1.863042e-01 -2.084718e-01 6.203645e-02 9.998831e-02 [116] 3.134345e-01 -5.720573e-02 1.459548e-01 3.531370e-02 -3.524643e-02 [121] 1.882151e-01 -1.366538e-01 1.045650e-01 1.035521e-01 2.608032e-02 [126] -6.621982e-02 1.012351e-01 -6.212841e-02 -1.001627e-01 -1.270110e-01 [131] 9.460270e-02 -1.441822e-01 -8.746150e-02 2.561719e-01 -3.559271e-02 [136] -1.144886e-02 6.231597e-02 -3.340378e-02 -1.081774e-01 -1.437867e-02 [141] 4.126220e-02 -9.756131e-02 -4.606206e-02 -1.242053e-01 -8.245700e-02 [146] 2.207107e-01 1.147665e-01 -6.387306e-02 -5.993311e-02 2.387393e-02 [151] -7.062747e-02 -3.004901e-02 -1.420192e-01 -5.916035e-02 -1.163172e-01 [156] -7.081782e-02 4.327731e-03 2.247463e-02 9.356943e-02 -1.012287e-01 [161] 9.405333e-02 -6.578051e-02 -4.204866e-02 5.874552e-02 1.392489e-01 [166] -7.075163e-02 -1.474849e-01 -2.990949e-02 -9.306476e-02 2.012336e-01 [171] 3.024762e-02 1.082141e-01 2.586082e-02 -5.204248e-03 1.046056e-01 [176] -1.308186e-01 1.660109e-02 -4.086468e-02 -4.025350e-02 -1.010399e-01 [181] -6.155888e-02 6.576557e-02 6.398668e-02 -3.221466e-02 5.737482e-02 [186] 3.118671e-02 3.642298e-02 -5.239384e-02 -1.645042e-01 -1.168189e-03 [191] -3.223455e-02 -4.205698e-02 -3.790178e-02 1.012196e-01 1.409175e-02 [196] -5.353965e-02 -2.907390e-04 3.581822e-02 -1.294987e-01 1.021261e-02 [201] -4.337331e-02 1.065622e-02 8.079769e-02 -1.169139e-01 9.830530e-03 [206] 1.516028e-01 -2.155789e-01 -2.254613e-02 -1.459458e-02 -1.150608e-01 [211] 4.999793e-03 2.734319e-02 5.581328e-02 -1.575080e-01 -6.820745e-03 [216] 3.504234e-02 -1.653096e-01 1.799349e-01 1.471951e-01 -8.099107e-03 [221] 3.602574e-02 1.353393e-01 -8.492309e-02 -9.678844e-02 -4.197101e-02 [226] 3.169217e-02 -3.220657e-02 -1.629222e-01 6.596311e-02 1.524833e-01 [231] -8.170040e-02 -2.029081e-02 -4.666125e-02 -6.423554e-02 2.600246e-02 [236] -1.807185e-01 9.142913e-02 1.159728e-01 -1.055195e-02 8.409488e-02 [241] -4.043794e-02 1.529892e-01 3.080824e-02 2.412267e-02 1.166073e-01 [246] 1.123353e-01 1.799993e-01 -1.698653e-01 -1.143617e-01 1.464281e-01 [251] -4.220992e-03 1.061591e-01 -8.059209e-02 9.203493e-02 -2.160112e-03 [256] -8.890255e-02 2.084547e-02 -5.059467e-02 -5.497308e-02 1.999001e-02 [261] -5.661118e-03 -1.012751e-01 4.877062e-02 8.336904e-04 -1.035571e-01 [266] 7.948231e-02 -2.605859e-02 -5.789206e-03 -3.056871e-02 -2.641586e-02 [271] -4.543976e-02 9.004766e-02 -4.650475e-02 -1.619057e-02 3.575660e-02 [276] -1.787433e-02 1.169876e-01 3.607971e-02 -1.916389e-02 4.724233e-02 [281] -3.185214e-02 -4.958447e-02 -3.066131e-02 6.488247e-03 -6.355915e-03 [286] -7.544956e-03 -4.174613e-02 1.354245e-03 -3.203330e-02 1.875384e-01 [291] -7.580497e-02 1.574973e-02 1.359014e-02 -3.750115e-02 4.383670e-02 [296] -3.584254e-02 -3.191081e-03 -1.331253e-01 -6.871759e-02 6.500510e-03 [301] 6.144286e-02 1.140444e-03 5.082143e-02 1.502516e-02 -1.243278e-01 [306] 4.824638e-02 -7.346460e-02 -1.102683e-01 3.304197e-02 -6.321039e-03 [311] 8.600199e-03 -4.698939e-02 7.269434e-03 1.217144e-01 -2.207932e-02 [316] 6.954673e-02 -6.733064e-02 -3.267891e-02 -7.840819e-02 1.798502e-02 [321] 2.318920e-01 3.269385e-02 4.217272e-03 5.964692e-02 -2.489615e-02 [326] 1.273119e-01 -8.602297e-02 5.659917e-02 -2.277744e-02 2.869404e-02 [331] 7.843330e-03 7.950601e-02 -3.668668e-02 2.913905e-02 -2.621518e-02 [336] -8.602315e-02 -6.974684e-02 5.859944e-02 7.975426e-03 -1.126538e-03 [341] 1.200238e-01 2.362249e-02 -7.503356e-02 6.682317e-03 8.842044e-02 [346] -6.587061e-02 -2.632319e-02 5.256350e-02 6.066793e-02 9.664854e-02 [351] 2.306395e-02 -2.301567e-02 5.051488e-02 -1.434966e-01 -4.635930e-02 [356] 5.537759e-02 -1.245801e-02 -2.716435e-02 -3.611471e-03 7.274020e-02 [361] 2.472751e-02 -9.172058e-02 -6.413685e-02 -3.816183e-02 4.502694e-03 [366] -3.223410e-02 9.130923e-02 1.450835e-01 -8.708732e-02 3.348082e-02 [371] 6.673971e-03 -1.194973e-02 -7.008689e-02 4.348252e-03 1.472567e-01 [376] -1.297587e-01 -2.026870e-02 5.320600e-02 -6.858191e-03 3.546198e-02 [381] -2.450605e-02 2.326719e-02 2.273239e-02 -1.018509e-01 9.081923e-04 [386] 4.539399e-02 -1.238471e-02 4.761093e-02 -1.211244e-02 1.364185e-01 [391] -2.135037e-02 -2.492781e-02 1.901630e-01 1.472090e-02 1.018003e-01 [396] 1.126576e-01 1.169749e-01 2.569743e-02 7.106380e-02 1.312684e-01 [401] -1.662010e-02 -1.032283e-01 9.408158e-02 -5.282775e-02 -1.171155e-01 [406] 2.910351e-02 2.527973e-02 -3.870185e-02 5.386895e-02 2.932196e-02 [411] -3.558137e-02 -1.109722e-02 -2.440670e-02 -2.770151e-02 1.826272e-02 [416] 1.359806e-02 7.414000e-02 1.074381e-01 -7.131191e-02 1.570776e-01 [421] 1.603783e-01 5.493971e-02 -1.537527e-01 -9.617463e-02 4.770790e-02 [426] 5.355723e-02 -2.221745e-02 -8.262222e-02 1.897543e-01 -1.795065e-01 [431] 1.865548e-01 -2.511791e-02 2.062972e-01 1.328629e-01 -1.751492e-01 [436] -3.618587e-02 7.897787e-02 -9.522699e-02 -2.045741e-02 2.039417e-02 [441] -2.375792e-02 9.573599e-02 1.870696e-01 -6.826872e-02 -1.338225e-02 [446] 1.260362e-01 5.313095e-02 1.698970e-01 2.451665e-01 9.615482e-02 [451] -2.610771e-01 2.394455e-01 -1.013625e-01 -2.494259e-03 1.906145e-01 [456] -4.011487e-02 -2.602051e-01 1.400555e-01 1.608654e-03 -3.776646e-03 [461] 5.980177e-02 -6.945572e-02 2.544012e-01 2.490304e-01 -1.667340e-01 [466] 1.053593e-01 8.370372e-02 -2.520183e-01 2.722640e-01 -3.635187e-02 [471] -1.620502e-01 2.544262e-02 -2.311420e-02 -1.138717e-02 1.200403e-01 [476] -7.020952e-02 1.103820e-01 -8.146800e-02 -9.470255e-02 > postscript(file="/var/fisher/rcomp/tmp/2ecaw1356119927.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/fisher/rcomp/tmp/32pwn1356119927.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/fisher/rcomp/tmp/427vi1356119927.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/fisher/rcomp/tmp/5a7a71356119927.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/fisher/rcomp/tmp/6mt4x1356119927.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/fisher/rcomp/tmp/7qafu1356119927.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/848xy1356119927.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/fisher/rcomp/tmp/9p3p11356119927.tab") > > try(system("convert tmp/1ro0c1356119927.ps tmp/1ro0c1356119927.png",intern=TRUE)) character(0) > try(system("convert tmp/2ecaw1356119927.ps tmp/2ecaw1356119927.png",intern=TRUE)) character(0) > try(system("convert tmp/32pwn1356119927.ps tmp/32pwn1356119927.png",intern=TRUE)) character(0) > try(system("convert tmp/427vi1356119927.ps tmp/427vi1356119927.png",intern=TRUE)) character(0) > try(system("convert tmp/5a7a71356119927.ps tmp/5a7a71356119927.png",intern=TRUE)) character(0) > try(system("convert tmp/6mt4x1356119927.ps tmp/6mt4x1356119927.png",intern=TRUE)) character(0) > try(system("convert tmp/7qafu1356119927.ps tmp/7qafu1356119927.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 28.905 2.642 31.570