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(87.28 + ,87.28 + ,87.09 + ,86.92 + ,87.59 + ,90.72 + ,90.69 + ,90.3 + ,89.55 + ,88.94 + ,88.41 + ,87.82 + ,87.07 + ,86.82 + ,86.4 + ,86.02 + ,85.66 + ,85.32 + ,85 + ,84.67 + ,83.94 + ,82.83 + ,81.95 + ,81.19 + ,80.48 + ,78.86 + ,69.47 + ,68.77 + ,70.06 + ,73.95 + ,75.8 + ,77.79 + ,81.57 + ,83.07 + ,84.34 + ,85.1 + ,85.25 + ,84.26 + ,83.63 + ,86.44 + ,85.3 + ,84.1 + ,83.36 + ,82.48 + ,81.58 + ,80.47 + ,79.34 + ,82.13 + ,81.69 + ,80.7 + ,79.88 + ,79.16 + ,78.38 + ,77.42 + ,76.47 + ,75.46 + ,74.48 + ,78.27 + ,80.7 + ,79.91 + ,78.75 + ,77.78 + ,81.14 + ,81.08 + ,80.03 + ,78.91 + ,78.01 + ,76.9 + ,75.97 + ,81.93 + ,80.27 + ,78.67 + ,77.42 + ,76.16 + ,74.7 + ,76.39 + ,76.04 + ,74.65 + ,73.29 + ,71.79 + ,74.39 + ,74.91 + ,74.54 + ,73.08 + ,72.75 + ,71.32 + ,70.38 + ,70.35 + ,70.01 + ,69.36 + ,67.77 + ,69.26 + ,69.8 + ,68.38 + ,67.62 + ,68.39 + ,66.95 + ,65.21 + ,66.64 + ,63.45 + ,60.66 + ,62.34 + ,60.32 + ,58.64 + ,60.46 + ,58.59 + ,61.87 + ,61.85 + ,67.44 + ,77.06 + ,91.74 + ,93.15 + ,94.15 + ,93.11 + ,91.51 + ,89.96 + ,88.16 + ,86.98 + ,88.03 + ,86.24 + ,84.65 + ,83.23 + ,81.7 + ,80.25 + ,78.8 + ,77.51 + ,76.2 + ,75.04 + ,74 + ,75.49 + ,77.14 + ,76.15 + ,76.27 + ,78.19 + ,76.49 + ,77.31 + ,76.65 + ,74.99 + ,73.51 + ,72.07 + ,70.59 + ,71.96 + ,76.29 + ,74.86 + ,74.93 + ,71.9 + ,71.01 + ,77.47 + ,75.78 + ,76.6 + ,76.07 + ,74.57 + ,73.02 + ,72.65 + ,73.16 + ,71.53 + ,69.78 + ,67.98 + ,69.96 + ,72.16 + ,70.47 + ,68.86 + ,67.37 + ,65.87 + ,72.16 + ,71.34 + ,69.93 + ,68.44 + ,67.16 + ,66.01 + ,67.25 + ,70.91 + ,69.75 + ,68.59 + ,67.48 + ,66.31 + ,64.81 + ,66.58 + ,65.97 + ,64.7 + ,64.7 + ,60.94 + ,59.08 + ,58.42 + ,57.77 + ,57.11 + ,53.31 + ,49.96 + ,49.4 + ,48.84 + ,48.3 + ,47.74 + ,47.24 + ,46.76 + ,46.29 + ,48.9 + ,49.23 + ,48.53 + ,48.03 + ,54.34 + ,53.79 + ,53.24 + ,52.96 + ,52.17 + ,51.7 + ,58.55 + ,78.2 + ,77.03 + ,76.19 + ,77.15 + ,75.87 + ,95.47 + ,109.67 + ,112.28 + ,112.01 + ,107.93 + ,105.96 + ,105.06 + ,102.98 + ,102.2 + ,105.23 + ,101.85 + ,99.89 + ,96.23 + ,94.76 + ,91.51 + ,91.63 + ,91.54 + ,85.23 + ,87.83 + ,87.38 + ,84.44 + ,85.19 + ,84.03 + ,86.73 + ,102.52 + ,104.45 + ,106.98 + ,107.02 + ,99.26 + ,94.45 + ,113.44 + ,157.33 + ,147.38 + ,171.89 + ,171.95 + ,132.71 + ,126.02 + ,121.18 + ,115.45 + ,110.48 + ,117.85 + ,117.63 + ,124.65 + ,109.59 + ,111.27 + ,99.78 + ,98.21 + ,99.2 + ,97.97 + ,89.55 + ,87.91 + ,93.34 + ,94.42 + ,93.2 + ,90.29 + ,91.46 + ,89.98 + ,88.35 + ,88.41 + ,82.44 + ,79.89 + ,75.69 + ,75.66 + ,84.5 + ,96.73 + ,87.48 + ,82.39 + ,83.48 + ,79.31 + ,78.16 + ,72.77 + ,72.45 + ,68.46 + ,67.62 + ,68.76 + ,70.07 + ,68.55 + ,65.3 + ,58.96 + ,59.17 + ,62.37 + ,66.28 + ,55.62 + ,55.23 + ,55.85 + ,56.75 + ,50.89 + ,53.88 + ,52.95 + ,55.08 + ,53.61 + ,58.78 + ,61.85 + ,55.91 + ,53.32 + ,46.41 + ,44.57 + ,50 + ,50 + ,53.36 + ,46.23 + ,50.45 + ,49.07 + ,45.85 + ,48.45 + ,49.96 + ,46.53 + ,50.51 + ,47.58 + ,48.05 + ,46.84 + ,47.67 + ,49.16 + ,55.54 + ,55.82 + ,58.22 + ,56.19 + ,57.77 + ,63.19 + ,54.76 + ,55.74 + ,62.54 + ,61.39 + ,69.6 + ,79.23 + ,80 + ,93.68 + ,107.63 + ,100.18 + ,97.3 + ,90.45 + ,80.64 + ,80.58 + ,75.82 + ,85.59 + ,89.35 + ,89.42 + ,104.73 + ,95.32 + ,89.27 + ,90.44 + ,86.97 + ,79.98 + ,81.22 + ,87.35 + ,83.64 + ,82.22 + ,94.4 + ,102.18) > par9 = '0' > par8 = '0' > par7 = '0' > par6 = '3' > par5 = '12' > par4 = '0' > 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.1164790 0.008977714 0.1192126 -0.2592376 -0.1240444 0.07969951 [2,] 0.1174634 0.000000000 0.1201806 -0.2592468 -0.1227133 0.07757791 [3,] 0.1161815 0.000000000 0.1237709 -0.2575087 -0.1266259 0.07018371 [4,] 0.1117720 0.000000000 0.1277968 -0.2483063 -0.1321461 0.07012413 [5,] 0.1120965 0.000000000 0.1247254 -0.2417407 -0.1216909 0.06583075 [6,] 0.1030264 0.000000000 0.1314250 -0.2426991 -0.1152592 0.00000000 [7,] 0.1094912 0.000000000 0.1278138 -0.2352525 -0.1098435 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 [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.1343331 -0.03873743 -0.04564183 0.03121074 0.09700107 [2,] 0.1332266 -0.03824876 -0.04455024 0.03102119 0.09673650 [3,] 0.1377398 -0.03806480 -0.04122336 0.00000000 0.10022953 [4,] 0.1329699 0.00000000 -0.04559719 0.00000000 0.09636572 [5,] 0.1317715 0.00000000 0.00000000 0.00000000 0.09439003 [6,] 0.1395983 0.00000000 0.00000000 0.00000000 0.08605237 [7,] 0.1174432 0.00000000 0.00000000 0.00000000 0.00000000 [8,] NA NA NA NA NA [9,] NA NA NA NA NA [10,] NA NA NA NA NA [11,] NA NA NA NA NA [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.02774 0.86631 0.02542 0e+00 0.02442 0.14825 0.01494 0.46869 0.39057 [2,] 0.02556 NA 0.02344 0e+00 0.02448 0.14824 0.01506 0.47364 0.39846 [3,] 0.02714 NA 0.01889 0e+00 0.01949 0.17846 0.01120 0.47599 0.43209 [4,] 0.03237 NA 0.01485 0e+00 0.01387 0.17921 0.01364 NA 0.38197 [5,] 0.03202 NA 0.01728 0e+00 0.02018 0.20575 0.01460 NA NA [6,] 0.04704 NA 0.01196 0e+00 0.02733 NA 0.00939 NA NA [7,] 0.03508 NA 0.01477 1e-05 0.03583 NA 0.02439 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 [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.55678 0.06801 [2,] 0.55911 0.06866 [3,] NA 0.05779 [4,] NA 0.06684 [5,] NA 0.07265 [6,] NA 0.09967 [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 [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.1165 0.0090 0.1192 -0.2592 -0.1240 0.0797 0.1343 -0.0387 s.e. 0.0527 0.0533 0.0531 0.0535 0.0549 0.0550 0.0549 0.0534 ar9 ar10 ar11 -0.0456 0.0312 0.097 s.e. 0.0531 0.0531 0.053 sigma^2 estimated as 26.03: log likelihood = -1094.7, aic = 2213.41 [[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.1165 0.0090 0.1192 -0.2592 -0.1240 0.0797 0.1343 -0.0387 s.e. 0.0527 0.0533 0.0531 0.0535 0.0549 0.0550 0.0549 0.0534 ar9 ar10 ar11 -0.0456 0.0312 0.097 s.e. 0.0531 0.0531 0.053 sigma^2 estimated as 26.03: log likelihood = -1094.7, aic = 2213.41 [[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 ar9 0.1175 0 0.1202 -0.2592 -0.1227 0.0776 0.1332 -0.0382 -0.0446 s.e. 0.0524 0 0.0528 0.0535 0.0543 0.0535 0.0545 0.0533 0.0527 ar10 ar11 0.0310 0.0967 s.e. 0.0531 0.0530 sigma^2 estimated as 26.03: log likelihood = -1094.72, aic = 2211.44 [[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.1162 0 0.1238 -0.2575 -0.1266 0.0702 0.1377 -0.0381 -0.0412 s.e. 0.0524 0 0.0525 0.0534 0.0540 0.0521 0.0540 0.0533 0.0524 ar10 ar11 0 0.1002 s.e. 0 0.0527 sigma^2 estimated as 26.05: log likelihood = -1094.89, aic = 2209.78 [[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.1118 0 0.1278 -0.2483 -0.1321 0.0701 0.1330 0 -0.0456 0 s.e. 0.0520 0 0.0522 0.0519 0.0534 0.0521 0.0536 0 0.0521 0 ar11 0.0964 s.e. 0.0524 sigma^2 estimated as 26.09: log likelihood = -1095.14, aic = 2208.29 [[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.1121 0 0.1247 -0.2417 -0.1217 0.0658 0.1318 0 0 0 s.e. 0.0521 0 0.0521 0.0514 0.0521 0.0519 0.0537 0 0 0 ar11 0.0944 s.e. 0.0524 sigma^2 estimated as 26.15: log likelihood = -1095.53, aic = 2207.05 [[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.1030 0 0.1314 -0.2427 -0.1153 0 0.1396 0 0 0 s.e. 0.0517 0 0.0520 0.0515 0.0520 0 0.0534 0 0 0 ar11 0.0861 s.e. 0.0521 sigma^2 estimated as 26.27: log likelihood = -1096.33, aic = 2206.65 [[3]][[8]] NULL [[3]][[9]] NULL [[3]][[10]] NULL [[3]][[11]] NULL $aic [1] 2213.408 2211.436 2209.777 2208.286 2207.052 2206.655 2207.368 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/www/html/rcomp/tmp/16jxb1260559158.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 = 360 Frequency = 1 [1] 8.727995e-02 -1.029540e-05 -1.805766e-01 -1.412127e-01 6.534379e-01 [6] 3.001363e+00 -3.698466e-01 -4.673803e-01 -9.830997e-01 2.985024e-01 [11] -2.391703e-02 -5.745938e-01 -1.272963e+00 -3.170279e-01 -4.465690e-01 [16] -3.953964e-01 -7.222099e-01 -3.182625e-01 -2.498545e-01 -2.211151e-01 [21] -6.950954e-01 -1.012507e+00 -7.353040e-01 -5.755755e-01 -6.320476e-01 [26] -1.703919e+00 -9.385960e+00 2.077357e-01 1.499326e+00 4.666553e+00 [31] -7.899473e-01 5.396229e-01 3.617802e+00 3.346762e+00 1.914395e+00 [36] 7.095861e-01 6.176981e-01 1.771395e-01 -3.643343e-01 2.547334e+00 [41] -1.719533e+00 -1.559222e+00 -1.530018e+00 -3.907826e-01 -5.953016e-01 [46] -1.363996e+00 -1.675566e+00 2.872070e+00 -6.487093e-01 -1.011772e+00 [51] -1.605828e+00 1.929344e-01 -1.027078e-01 -8.414322e-01 -1.383342e+00 [56] -9.399989e-01 -7.883468e-01 3.904636e+00 1.691481e+00 -1.119430e+00 [61] -1.711760e+00 -1.597953e-01 4.793304e+00 3.855911e-02 -1.735389e+00 [66] -2.080003e+00 1.241381e-01 -2.603057e-01 -1.120922e+00 5.103094e+00 [71] -2.399318e+00 -1.433481e+00 -1.982278e+00 2.627464e-01 -6.757252e-01 [76] 1.645232e+00 -1.581935e+00 -1.302755e+00 -1.619593e+00 -8.174758e-01 [81] 2.710085e+00 3.998374e-01 -8.149546e-01 -2.127961e+00 5.126740e-01 [86] -6.060065e-01 -5.666867e-01 -6.196088e-01 -3.503189e-01 -7.078442e-01 [91] -1.579156e+00 1.405203e+00 5.408198e-01 -1.300549e+00 -1.140511e+00 [96] 1.031551e+00 -8.161194e-01 -1.471301e+00 9.545294e-01 -3.094920e+00 [101] -2.239240e+00 1.434154e+00 -1.863039e+00 -1.560047e+00 1.092579e+00 [106] -1.840094e+00 3.775895e+00 -7.242833e-01 6.001108e+00 8.527867e+00 [111] 1.478107e+01 -4.778796e-01 1.061288e+00 -3.773379e-01 3.140814e+00 [116] -4.193422e-01 -2.280431e+00 -3.252976e+00 6.719792e-01 -2.842842e+00 [121] -2.548653e+00 -2.927927e+00 -9.345801e-01 -1.231589e+00 -1.451973e+00 [126] -1.476321e+00 -1.138265e+00 -9.858738e-01 -9.702192e-01 1.412337e+00 [131] 1.538775e+00 -1.116591e+00 -5.765861e-02 2.247072e+00 -9.088003e-01 [136] 1.199238e+00 -1.178794e+00 -1.006375e+00 -1.370012e+00 -1.124965e+00 [141] -1.575392e+00 1.333367e+00 3.798302e+00 -2.119857e+00 -4.213797e-01 [146] -3.091473e+00 9.493584e-01 6.957906e+00 -2.153567e+00 -9.333048e-02 [151] -1.705184e+00 3.595532e-01 -8.637248e-01 -3.847929e-01 -6.761103e-02 [156] -1.674073e+00 -1.936244e+00 -1.804607e+00 2.114300e+00 2.250990e+00 [161] -2.311600e+00 -2.360256e+00 -9.835610e-01 1.544692e-02 6.782659e+00 [166] -2.178038e+00 -1.842421e+00 -2.320668e+00 7.146138e-01 -2.692321e-01 [171] 1.137668e+00 2.443689e+00 -1.615314e+00 -1.305040e+00 -9.660260e-01 [176] -2.345713e-01 -8.555874e-01 1.603422e+00 -1.424398e+00 -1.149831e+00 [181] -3.397863e-01 -3.374893e+00 -1.401370e+00 -5.376886e-01 -3.814921e-01 [186] -1.080458e+00 -4.252086e+00 -3.118558e+00 1.063040e-02 7.415467e-02 [191] -8.389377e-01 -1.591056e+00 -4.750452e-01 1.325571e-01 -1.810305e-02 [196] 2.660093e+00 7.326009e-02 -4.439720e-01 -5.738432e-01 7.015404e+00 [201] -6.119853e-01 -4.473973e-01 -1.570820e+00 7.818914e-01 4.164995e-01 [206] 6.848588e+00 1.781128e+01 -3.308322e+00 -1.687828e+00 1.544718e-01 [211] 3.900716e+00 2.193610e+01 1.080687e+01 -1.267590e+00 -3.083523e+00 [216] -1.151340e+00 3.089262e+00 9.632859e-02 -3.851210e+00 -3.238142e+00 [221] 1.833307e+00 -3.716457e+00 -3.234872e+00 -5.232265e+00 -1.021892e-01 [226] -2.998447e+00 5.305653e-01 -1.276815e+00 -6.102923e+00 2.728724e+00 [231] -4.734581e-01 -2.127887e+00 -8.606035e-02 -1.122486e+00 3.723875e+00 [236] 1.565522e+01 2.155433e-01 1.833718e+00 -1.356107e+00 -3.436061e+00 [241] -2.116471e+00 1.997859e+01 4.130344e+01 -1.605237e+01 2.072420e+01 [246] -4.416886e+00 -2.537315e+01 -2.719214e+00 -2.225598e+00 -3.365084e+00 [251] -1.096025e+01 -6.359323e-01 -3.814497e+00 7.448328e+00 -1.682836e+01 [256] 3.042857e+00 -1.099489e+01 7.341922e+00 -2.368120e+00 -7.027869e-01 [261] -1.116882e+01 -7.796322e-02 4.951200e+00 3.065668e+00 -3.685945e+00 [266] -3.708708e+00 2.483837e+00 1.611930e+00 -9.026437e-01 -1.615915e+00 [271] -5.878041e+00 -1.050180e+00 -3.963994e+00 3.834130e-01 7.849896e+00 [276] 1.089678e+01 -1.157728e+01 -5.057452e+00 2.632412e+00 1.647062e+00 [281] -8.877486e-01 -8.436575e+00 -1.026627e+00 -3.039611e+00 2.328582e-01 [286] -1.084963e+00 5.477295e-01 -1.593297e+00 -2.716534e+00 -6.046597e+00 [291] 2.428120e+00 3.603805e+00 3.754264e+00 -1.315907e+01 1.634632e-01 [296] 1.473129e+00 4.341850e+00 -8.180021e+00 1.873020e+00 -1.516968e+00 [301] 5.319545e+00 -3.364518e+00 5.132007e+00 1.914230e+00 -3.917974e+00 [306] -3.152595e+00 -5.884839e+00 6.187613e-01 5.581649e+00 -1.943537e+00 [311] 1.277712e+00 -8.786891e+00 6.548414e+00 -1.110768e+00 -1.332614e+00 [316] 7.870901e-01 1.848766e+00 -2.885341e+00 4.204799e+00 -4.334983e+00 [321] 2.081450e+00 -2.279540e+00 2.160938e+00 5.164072e-01 6.759449e+00 [326] -1.004398e+00 2.422593e+00 -2.854018e+00 3.936574e+00 5.286753e+00 [331] -8.062728e+00 4.937219e-01 6.201235e+00 3.484123e-01 6.933602e+00 [336] 6.387094e+00 9.115848e-01 1.399662e+01 1.317287e+01 -6.790177e+00 [341] -2.919389e+00 -5.398470e+00 -4.591419e+00 4.363035e-01 -7.221956e+00 [346] 6.901363e+00 -1.977624e-01 -5.012680e-01 1.263566e+01 -9.489927e+00 [351] -2.401625e+00 1.143875e+00 5.955423e-01 -6.037273e+00 -7.511399e-01 [356] 4.317291e+00 -3.657315e+00 -2.776142e+00 1.084659e+01 7.810337e+00 > postscript(file="/var/www/html/rcomp/tmp/2bkps1260559158.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/39ejg1260559158.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/4lyxy1260559158.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/5un0p1260559158.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/6l85f1260559158.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/7f2om1260559158.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/8s2xr1260559158.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/9cl6i1260559158.tab") > > system("convert tmp/16jxb1260559158.ps tmp/16jxb1260559158.png") > system("convert tmp/2bkps1260559158.ps tmp/2bkps1260559158.png") > system("convert tmp/39ejg1260559158.ps tmp/39ejg1260559158.png") > system("convert tmp/4lyxy1260559158.ps tmp/4lyxy1260559158.png") > system("convert tmp/5un0p1260559158.ps tmp/5un0p1260559158.png") > system("convert tmp/6l85f1260559158.ps tmp/6l85f1260559158.png") > system("convert tmp/7f2om1260559158.ps tmp/7f2om1260559158.png") > > > proc.time() user system elapsed 3.978 1.171 4.360