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(8.9634 + ,8.9522 + ,8.8682 + ,8.7331 + ,8.3188 + ,8.3462 + ,8.3087 + ,8.3836 + ,8.8412 + ,9.5001 + ,10.1883 + ,10.2931 + ,10.1945 + ,10.3014 + ,10.0675 + ,9.6715 + ,9.5019 + ,9.4597 + ,9.4362 + ,9.5919 + ,10.0167 + ,10.322 + ,11.166 + ,11.5454 + ,11.3712 + ,11.0723 + ,10.813 + ,10.3016 + ,10.4227 + ,10.3162 + ,10.4519 + ,10.8567 + ,11.2716 + ,11.4341 + ,12.1273 + ,11.9814 + ,11.8352 + ,11.9847 + ,11.545 + ,11.5285 + ,11.5539 + ,11.622 + ,11.6578 + ,11.6767 + ,11.8752 + ,13.2643 + ,14.2297 + ,14.308 + ,13.7915 + ,13.7633 + ,13.9775 + ,13.6478 + ,13.2247 + ,13.0971 + ,13.1039 + ,13.206 + ,13.7901 + ,14.6457 + ,15.5764 + ,15.6102 + ,15.8855 + ,16.0137 + ,15.6186 + ,15.384 + ,15.2751 + ,15.0912 + ,14.9222 + ,15.6231 + ,16.6737 + ,17.6805 + ,19.1919 + ,19.1711 + ,18.5658 + ,18.1285 + ,16.791 + ,16.9468 + ,17.3164 + ,17.1816 + ,16.7627 + ,17.239 + ,17.8838 + ,18.9038 + ,20.0274 + ,20.0087 + ,19.6366 + ,19.8163 + ,18.8602 + ,17.9206 + ,17.6889 + ,17.84 + ,17.678 + ,17.7258 + ,18.5865 + ,19.9804 + ,21.1584 + ,21.2921 + ,20.9445 + ,20.5731 + ,19.3274 + ,17.7866 + ,17.7483 + ,17.5648 + ,17.4763 + ,17.7264 + ,18.5736 + ,19.9236 + ,21.3286 + ,20.7249 + ,20.3334 + ,19.7658 + ,18.7569 + ,17.6963 + ,17.7978 + ,18.1771 + ,18.3738 + ,18.1996 + ,18.8443 + ,20.1001 + ,21.2458 + ,20.8381 + ,20.1967 + ,19.8159 + ,18.5784 + ,19.21 + ,19.3419 + ,19.12 + ,19.1563 + ,18.9783 + ,20.2913 + ,22.5439 + ,23.2821 + ,22.6191 + ,22.1599 + ,21.2766 + ,19.0846 + ,18.9096 + ,18.8095 + ,20.1164 + ,20.7762 + ,20.9044 + ,22.0026 + ,23.6401 + ,25.04 + ,24.7185 + ,24.1752 + ,24.1382 + ,22.3949 + ,21.3743 + ,21.4911 + ,21.2187 + ,21.2137 + ,21.6735 + ,22.5096 + ,24.3097 + ,25.7989 + ,25.4376 + ,23.878 + ,23.6966 + ,23.3544 + ,21.1993 + ,22.0431 + ,22.0203 + ,21.886 + ,21.9771 + ,23.0759 + ,24.9859 + ,26.2614 + ,26.1127 + ,25.6296 + ,25.2926 + ,22.8146 + ,22.2974 + ,22.8868 + ,22.4612 + ,22.3165 + ,22.7319 + ,23.2692 + ,24.9432 + ,27.8272 + ,27.4059 + ,26.6232 + ,26.8779 + ,25.105 + ,23.601 + ,23.5374 + ,23.5248 + ,22.9465 + ,23.6633 + ,25.5932 + ,27.7683 + ,29.4691 + ,28.3472 + ,28.3879 + ,27.9696 + ,26.0075 + ,24.2533 + ,24.4999 + ,23.8988 + ,23.6683 + ,23.9427 + ,26.0155 + ,28.9529 + ,30.302 + ,29.874 + ,28.2257 + ,28.0811 + ,26.3398 + ,25.4847 + ,25.4823 + ,24.9697 + ,25.2282 + ,25.9257 + ,28.7818 + ,27.9552 + ,33.3475 + ,32.7834 + ,31.6586 + ,31.6613 + ,29.1839 + ,28.8825 + ,27.6334 + ,27.7511 + ,27.3792 + ,27.7748 + ,31.4329 + ,33.2735 + ,35.0962 + ,34.9537 + ,31.8307 + ,30.9984 + ,28.629 + ,26.4379 + ,25.4408 + ,24.6681 + ,24.0994 + ,24.6043 + ,27.2492 + ,29.5511 + ,29.8522 + ,31.6989 + ,29.6357 + ,30.5197 + ,32.7823 + ,24.9942 + ,23.5187 + ,24.0249 + ,24.5692 + ,24.402 + ,26.7089 + ,31.6874 + ,32.8801 + ,32.7906 + ,30.8785 + ,30.3024 + ,28.3679 + ,25.6578 + ,25.1598 + ,24.6143 + ,24.528 + ,25.2905 + ,30.0016 + ,34.2728 + ,34.4408 + ,34.1907 + ,33.6636 + ,33.9073 + ,30.2175 + ,28.5274 + ,25.9505 + ,26.2398 + ,26.2819 + ,26.7362 + ,28.8395 + ,31.0951 + ,33.7015 + ,33.8091 + ,32.1126 + ,32 + ,29.122 + ,26.8124 + ,25.4654 + ,23.8331 + ,24.714 + ,28.3288 + ,29.6391 + ,32.4542 + ,33.5657 + ,33.1856 + ,33.297 + ,33.51 + ,31.3789 + ,29.4555 + ,27.2699 + ,27.2586 + ,27.8591 + ,29.6362 + ,30.9587 + ,31.8633 + ,33.8188 + ,33.7531 + ,33.6103 + ,32.9052 + ,29.5005 + ,27.3634 + ,27.2298 + ,26.5211 + ,26.5228 + ,27.2991 + ,29.1726 + ,30.297 + ,32.5287 + ,32.487 + ,32.4197 + ,30.854 + ,28.6995 + ,27.7881 + ,26.5609 + ,25.9431 + ,25.5578 + ,27.1275 + ,30.2556 + ,34.0976 + ,34.5614 + ,34.2948 + ,33.3418 + ,31.8187 + ,29.0818 + ,27.3444 + ,26.6233 + ,26.1869 + ,26.2953 + ,28.7043 + ,32.0653 + ,34.5401 + ,34.6636 + ,34.2557 + ,32.0526 + ,30.6892 + ,28.012 + ,26.1528 + ,23.2276 + ,24.244 + ,24.8141 + ,27.8632 + ,29.6233 + ,32.4245 + ,33.3417 + ,33.0442 + ,32.0526 + ,30.2182 + ,28.9292 + ,26.8221 + ,26.1032 + ,25.9792 + ,27.1443 + ,29.4993 + ,31.656 + ,33.3665 + ,35.0521 + ,34.4076 + ,33.069 + ,31.5816 + ,30.0695 + ,29.0035 + ,28.6813 + ,28.359 + ,30.0447 + ,31.5073 + ,34.16 + ,35.57 + ,36.42 + ,35.12 + ,33.14 + ,30.29 + ,28.2 + ,26.5 + ,25.47 + ,24.96 + ,25.6 + ,27.76 + ,30.13 + ,32.35 + ,32.8 + ,32.54 + ,29.78 + ,28.79 + ,26.8 + ,25.41 + ,24.34 + ,24.39 + ,25 + ,26.27 + ,27.88 + ,29.35 + ,29.83 + ,29.46) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '2' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '-0.5' > 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.5346755 -0.05783052 -0.6912633 0.07310814 -0.08689525 -0.7627868 [2,] 0.5751321 0.00000000 -0.7545340 0.06973729 -0.08256271 -0.7601139 [3,] 0.5687199 0.00000000 -0.7519940 0.00000000 -0.10944639 -0.7136836 [4,] 0.5546123 0.00000000 -0.7403381 0.00000000 0.00000000 -1.3224594 [5,] NA NA NA NA NA NA [6,] NA 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 [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.00025 0.36985 0 0.34627 0.18480 0 [2,] 0.00000 NA 0 0.37029 0.20769 0 [3,] 0.00000 NA 0 NA 0.05835 0 [4,] 0.00000 NA 0 NA NA 0 [5,] NA NA NA NA NA NA [6,] NA 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 ma1 sar1 sar2 sma1 0.5347 -0.0578 -0.6913 0.0731 -0.0869 -0.7628 s.e. 0.1448 0.0644 0.1371 0.0775 0.0654 0.0656 sigma^2 estimated as 9.326e-06: log likelihood = 1669.29, aic = -3324.58 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ma1 sar1 sar2 sma1 0.5347 -0.0578 -0.6913 0.0731 -0.0869 -0.7628 s.e. 0.1448 0.0644 0.1371 0.0775 0.0654 0.0656 sigma^2 estimated as 9.326e-06: log likelihood = 1669.29, aic = -3324.58 [[3]][[3]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ma1 sar1 sar2 sma1 0.5751 0 -0.7545 0.0697 -0.0826 -0.7601 s.e. 0.1103 0 0.0863 0.0777 0.0654 0.0655 sigma^2 estimated as 9.349e-06: log likelihood = 1668.88, aic = -3325.75 [[3]][[4]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ma1 sar1 sar2 sma1 0.5687 0 -0.7520 0 -0.1094 -0.7137 s.e. 0.1096 0 0.0856 0 0.0576 0.0477 sigma^2 estimated as 9.375e-06: log likelihood = 1668.48, aic = -3326.97 [[3]][[5]] NULL [[3]][[6]] NULL $aic [1] -3324.580 -3325.751 -3326.965 -3325.516 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 > postscript(file="/var/fisher/rcomp/tmp/1opc01354655124.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 = 396 Frequency = 1 [1] 1.928426e-04 8.640356e-05 5.789900e-05 4.543723e-05 4.377566e-05 [6] 3.589957e-05 3.146889e-05 2.605973e-05 1.458804e-05 1.832427e-06 [11] -8.987995e-06 -2.051737e-04 -1.242405e-03 -1.453383e-03 1.394364e-03 [16] 3.156032e-03 -3.800252e-03 7.140458e-04 -3.625927e-04 -9.876079e-04 [21] 1.491356e-03 5.926743e-03 4.657539e-04 -1.985469e-03 6.395643e-04 [26] 4.426662e-03 1.601845e-03 3.154285e-03 -5.203822e-03 8.894479e-04 [31] -2.362925e-03 -3.704833e-03 9.954565e-04 4.621255e-03 3.337667e-03 [36] 5.630496e-03 1.353837e-03 -2.010700e-03 2.686220e-03 -4.423779e-03 [41] -3.364589e-03 -2.306943e-03 -8.538560e-04 2.559668e-03 4.511848e-03 [46] -8.193110e-03 -2.955536e-04 -4.704716e-04 2.524831e-03 7.970920e-04 [51] -5.466316e-03 -1.156957e-03 1.382755e-03 1.145487e-03 2.808101e-04 [56] 1.121278e-03 -9.192307e-07 1.874331e-03 2.787769e-03 2.026893e-03 [61] -4.208638e-03 -1.797577e-03 9.002533e-04 -2.394737e-03 -2.265463e-03 [66] 1.326808e-04 1.406905e-03 -3.413313e-03 -2.630698e-03 -1.994168e-04 [71] -5.880357e-04 6.107403e-04 2.609525e-03 3.363079e-03 7.015141e-03 [76] -2.528751e-03 -3.681369e-03 -1.500421e-04 2.589274e-03 2.857620e-04 [81] 2.144474e-03 2.403106e-03 3.845829e-03 1.859084e-03 5.351824e-04 [86] -1.193365e-03 1.544829e-03 4.253082e-03 1.768231e-03 -8.805248e-04 [91] 6.003389e-04 2.810108e-03 6.109933e-04 1.616821e-04 2.559966e-03 [96] 4.231314e-04 4.556213e-04 2.422246e-03 3.651484e-03 7.139041e-03 [101] 7.787614e-04 2.139335e-03 9.588584e-04 1.473039e-03 1.156511e-03 [106] 6.826780e-04 1.215396e-03 4.139851e-03 1.183680e-03 3.073638e-03 [111] 1.758887e-03 3.201679e-03 -1.735807e-04 -2.684352e-03 -2.314581e-03 [116] 3.113935e-03 1.894626e-03 1.042126e-03 2.434360e-03 2.209136e-03 [121] 2.225881e-03 1.779112e-03 2.886273e-03 -7.622933e-03 -1.980318e-03 [126] 8.734420e-04 -8.659447e-04 2.051811e-03 -2.160466e-03 -3.952294e-03 [131] 3.104586e-03 2.445883e-03 2.418595e-04 3.335250e-03 6.903847e-03 [136] 1.607633e-04 1.473330e-03 -7.276184e-03 -4.802925e-03 -1.097073e-03 [141] -4.709237e-04 6.873086e-04 2.981230e-04 -2.130798e-04 -3.083472e-05 [146] -2.224139e-03 -2.640053e-04 1.354400e-03 -7.978682e-04 3.517595e-03 [151] 1.478242e-03 -8.494700e-04 1.667428e-03 4.783131e-04 8.960390e-04 [156] 4.504097e-04 4.303422e-03 2.703687e-04 -5.040676e-03 6.403488e-03 [161] -3.243632e-03 2.175247e-04 8.693309e-04 7.873383e-04 3.895990e-04 [166] 5.091080e-04 1.368456e-03 -5.846406e-04 -1.554622e-03 -6.410946e-04 [171] 4.281910e-03 -1.784312e-03 -1.552096e-03 2.822497e-03 1.431465e-03 [176] -7.482533e-04 3.116926e-03 1.856104e-03 -4.216193e-03 -1.432167e-04 [181] -1.614023e-05 -2.596953e-03 -1.834780e-03 2.039487e-03 1.494924e-03 [186] 4.222199e-04 2.960509e-03 -1.233072e-03 -3.299623e-03 -4.909861e-04 [191] 1.317155e-03 2.252454e-03 -2.834908e-03 3.444794e-04 2.872785e-04 [196] 1.766819e-03 2.443536e-04 3.006463e-03 1.041747e-03 1.056633e-03 [201] -2.057235e-03 -2.261208e-03 1.498373e-03 -6.114193e-04 3.073107e-03 [206] -2.112228e-04 -7.635558e-04 -2.041928e-03 9.346774e-04 1.229684e-03 [211] -1.354346e-03 -1.443175e-03 -4.468283e-03 1.028778e-02 -8.515485e-03 [216] -8.385098e-04 -8.604296e-04 -1.257011e-03 4.389039e-05 -3.946835e-03 [221] 4.053954e-03 -1.010974e-03 9.786937e-04 7.663464e-04 -4.147790e-03 [226] -5.588365e-04 4.080372e-03 -9.237565e-04 5.552481e-03 2.815721e-03 [231] 1.332070e-03 4.494283e-03 4.582750e-03 4.133354e-03 3.254176e-03 [236] 1.081351e-03 -8.819741e-04 -6.899150e-04 5.713284e-03 -5.619450e-03 [241] 1.229476e-03 -3.855349e-03 -1.406674e-02 1.712424e-02 6.625674e-03 [246] -1.683543e-03 -2.397657e-03 2.650439e-03 5.582799e-05 -9.597219e-03 [251] 1.323402e-03 5.342778e-05 5.890427e-04 1.788862e-03 3.173865e-03 [256] 1.069125e-04 -1.408042e-04 2.331373e-03 9.817842e-04 -1.481862e-03 [261] -7.505764e-03 -4.624469e-03 3.683272e-03 1.389236e-05 -3.671760e-03 [266] -2.279322e-03 3.824174e-03 -2.638678e-03 6.623204e-03 -1.343967e-03 [271] -3.847305e-04 4.133461e-04 3.990474e-03 2.461462e-03 -2.208507e-03 [276] 2.467172e-05 6.171145e-04 4.732560e-04 3.215158e-03 -5.657159e-04 [281] 7.727436e-04 6.863461e-03 -2.317063e-03 -1.141686e-02 3.058510e-03 [286] -1.442571e-04 1.912969e-03 1.410707e-03 -4.464435e-03 -1.502629e-03 [291] -7.663677e-04 -3.947439e-03 2.320772e-03 -2.459194e-03 -1.657001e-03 [296] -1.376422e-03 4.149168e-03 6.787772e-03 7.581932e-05 8.244375e-04 [301] -1.801364e-03 1.891640e-03 4.099252e-03 8.838878e-05 -4.278845e-03 [306] 1.237829e-03 8.443557e-04 1.301663e-03 1.747610e-03 4.006248e-03 [311] -6.776529e-04 5.144124e-04 -2.094372e-03 3.611714e-03 -2.294232e-04 [316] -4.592013e-03 -3.444510e-05 -1.537400e-04 2.032584e-03 -1.144016e-03 [321] -2.979591e-03 -4.558334e-03 2.559774e-03 3.030666e-04 5.097127e-04 [326] 2.726560e-03 1.931318e-03 9.245478e-05 -1.646200e-03 -3.208981e-04 [331] -1.235542e-04 -3.288554e-03 -2.825266e-03 2.877866e-04 2.935718e-03 [336] 9.806034e-04 4.074831e-03 2.907031e-03 1.994379e-03 9.295159e-04 [341] 9.067825e-03 -4.130285e-03 -1.373191e-03 -5.571295e-03 1.325723e-03 [346] -1.949457e-03 3.051072e-04 7.097719e-05 -3.263880e-04 2.636114e-03 [351] -3.186895e-03 4.827572e-04 -3.656958e-03 -3.744326e-04 -3.883142e-03 [356] -1.754190e-03 1.434779e-04 2.325470e-03 -9.217141e-04 9.888913e-04 [361] 1.110381e-03 1.000821e-03 -1.780442e-03 -3.290802e-03 -3.782111e-03 [366] -8.875201e-04 -4.500342e-03 1.401345e-03 6.996068e-05 2.756080e-03 [371] 1.606462e-03 2.703036e-03 2.687758e-03 5.544337e-03 1.742900e-03 [376] 1.632201e-03 5.964114e-04 2.292215e-03 7.588868e-04 -6.814142e-04 [381] -4.015605e-05 -2.940098e-04 1.461507e-03 -4.097553e-04 4.499637e-03 [386] -8.403007e-04 7.074100e-04 -5.219231e-04 6.286662e-05 -9.359705e-04 [391] -2.523110e-04 2.303641e-03 1.997674e-03 1.963843e-03 1.682167e-03 [396] 8.184155e-04 > postscript(file="/var/fisher/rcomp/tmp/2oivg1354655124.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/37s821354655124.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/4sgcc1354655124.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/5hysd1354655124.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/659io1354655124.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/75kth1354655124.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/80yhy1354655124.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/9irki1354655124.tab") > > try(system("convert tmp/1opc01354655124.ps tmp/1opc01354655124.png",intern=TRUE)) character(0) > try(system("convert tmp/2oivg1354655124.ps tmp/2oivg1354655124.png",intern=TRUE)) character(0) > try(system("convert tmp/37s821354655124.ps tmp/37s821354655124.png",intern=TRUE)) character(0) > try(system("convert tmp/4sgcc1354655124.ps tmp/4sgcc1354655124.png",intern=TRUE)) character(0) > try(system("convert tmp/5hysd1354655124.ps tmp/5hysd1354655124.png",intern=TRUE)) character(0) > try(system("convert tmp/659io1354655124.ps tmp/659io1354655124.png",intern=TRUE)) character(0) > try(system("convert tmp/75kth1354655124.ps tmp/75kth1354655124.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 21.879 1.157 23.025