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.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.00 + ,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.00 + ,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.00 + ,50.00 + ,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.00 + ,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.1165249 0.009012119 0.1191873 -0.2595448 -0.1239923 0.07976238 [2,] 0.1175127 0.000000000 0.1201590 -0.2595528 -0.1226563 0.07763235 [3,] 0.1162274 0.000000000 0.1237575 -0.2578038 -0.1265782 0.07022092 [4,] 0.1118119 0.000000000 0.1277879 -0.2485842 -0.1321060 0.07016049 [5,] 0.1121359 0.000000000 0.1247169 -0.2420200 -0.1216518 0.06586801 [6,] 0.1030596 0.000000000 0.1314205 -0.2429696 -0.1152171 0.00000000 [7,] 0.1095271 0.000000000 0.1278061 -0.2354826 -0.1098008 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.1344329 -0.03878538 -0.04564016 0.03127833 0.09710791 [2,] 0.1333218 -0.03829459 -0.04454442 0.03108780 0.09684197 [3,] 0.1378422 -0.03810929 -0.04121042 0.00000000 0.10033967 [4,] 0.1330644 0.00000000 -0.04558963 0.00000000 0.09646909 [5,] 0.1318665 0.00000000 0.00000000 0.00000000 0.09449408 [6,] 0.1396942 0.00000000 0.00000000 0.00000000 0.08614809 [7,] 0.1175043 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.02789 0.86599 0.02565 0e+00 0.02468 0.14848 0.01501 0.46873 0.39121 [2,] 0.02570 NA 0.02365 0e+00 0.02474 0.14850 0.01513 0.47370 0.39914 [3,] 0.02729 NA 0.01906 0e+00 0.01970 0.17881 0.01125 0.47607 0.43284 [4,] 0.03254 NA 0.01499 0e+00 0.01402 0.17956 0.01370 NA 0.38268 [5,] 0.03219 NA 0.01743 0e+00 0.02038 0.20611 0.01466 NA NA [6,] 0.04727 NA 0.01208 0e+00 0.02760 NA 0.00944 NA NA [7,] 0.03527 NA 0.01491 1e-05 0.03615 NA 0.02451 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.55646 0.06808 [2,] 0.55879 0.06874 [3,] NA 0.05787 [4,] NA 0.06693 [5,] NA 0.07274 [6,] NA 0.09977 [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 ar9 0.1165 0.0090 0.1192 -0.2595 -0.124 0.0798 0.1344 -0.0388 -0.0456 s.e. 0.0528 0.0534 0.0532 0.0536 0.055 0.0551 0.0550 0.0535 0.0532 ar10 ar11 0.0313 0.0971 s.e. 0.0531 0.0531 sigma^2 estimated as 26.10: log likelihood = -1092.14, aic = 2208.28 [[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 ar9 0.1165 0.0090 0.1192 -0.2595 -0.124 0.0798 0.1344 -0.0388 -0.0456 s.e. 0.0528 0.0534 0.0532 0.0536 0.055 0.0551 0.0550 0.0535 0.0532 ar10 ar11 0.0313 0.0971 s.e. 0.0531 0.0531 sigma^2 estimated as 26.10: log likelihood = -1092.14, aic = 2208.28 [[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.2596 -0.1227 0.0776 0.1333 -0.0383 -0.0445 s.e. 0.0525 0 0.0529 0.0536 0.0544 0.0536 0.0546 0.0534 0.0528 ar10 ar11 0.0311 0.0968 s.e. 0.0531 0.0530 sigma^2 estimated as 26.1: log likelihood = -1092.15, aic = 2206.3 [[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.2578 -0.1266 0.0702 0.1378 -0.0381 -0.0412 s.e. 0.0524 0 0.0525 0.0535 0.0540 0.0521 0.0541 0.0534 0.0525 ar10 ar11 0 0.1003 s.e. 0 0.0527 sigma^2 estimated as 26.12: log likelihood = -1092.32, aic = 2204.65 [[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.2486 -0.1321 0.0702 0.1331 0 -0.0456 0 s.e. 0.0521 0 0.0523 0.0519 0.0535 0.0522 0.0537 0 0.0522 0 ar11 0.0965 s.e. 0.0525 sigma^2 estimated as 26.16: log likelihood = -1092.58, aic = 2203.16 [[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.2420 -0.1217 0.0659 0.1319 0 0 0 s.e. 0.0521 0 0.0522 0.0515 0.0522 0.0520 0.0538 0 0 0 ar11 0.0945 s.e. 0.0525 sigma^2 estimated as 26.22: log likelihood = -1092.96, aic = 2201.92 [[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.1031 0 0.1314 -0.2430 -0.1152 0 0.1397 0 0 0 s.e. 0.0518 0 0.0521 0.0516 0.0521 0 0.0535 0 0 0 ar11 0.0861 s.e. 0.0522 sigma^2 estimated as 26.34: log likelihood = -1093.76, aic = 2201.52 [[3]][[8]] NULL [[3]][[9]] NULL [[3]][[10]] NULL [[3]][[11]] NULL $aic [1] 2208.276 2206.305 2204.647 2203.156 2201.918 2201.519 2202.231 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/10rac1260461091.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > resid <- arimaSelectplot(selection) > dev.off() null device 1 > resid Time Series: Start = 1 End = 359 Frequency = 1 [1] 0.08727995 -0.17945021 -0.14142924 0.65270456 2.92300166 [6] -0.44754716 -0.46679056 -0.89815077 0.30790400 -0.02331201 [11] -0.56797655 -1.20400604 -0.31711772 -0.44662737 -0.39551523 [16] -0.72261754 -0.31823475 -0.24985409 -0.22104742 -0.69508501 [21] -1.01246968 -0.73524797 -0.57551901 -0.63215430 -1.70409799 [26] -9.38603269 0.20798038 1.49932053 4.66617543 -0.79244729 [31] 0.53991113 3.61839334 3.34862761 1.91483045 0.70996537 [36] 0.61840037 0.17810817 -0.36414143 2.54702186 -1.72013811 [41] -1.55976009 -1.53035828 -0.39035254 -0.59575311 -1.36430687 [46] -1.67602509 2.87199114 -0.64880348 -1.01189318 -1.60622614 [51] 0.19395744 -0.10270343 -0.84148004 -1.38367655 -0.94000275 [56] -0.78829702 3.90462438 1.69093602 -1.11963157 -1.71175318 [61] -0.15850976 4.79399672 0.03829494 -1.73594368 -2.08030907 [66] 0.12529731 -0.26023315 -1.12144181 5.10230757 -2.39963554 [71] -1.43348088 -1.98220260 0.26419682 -0.67627831 1.64510208 [76] -1.58273190 -1.30279252 -1.61962189 -0.81670455 2.70951358 [81] 0.39968264 -0.81529689 -2.12813292 0.51374526 -0.60569577 [86] -0.56678559 -0.62017430 -0.35026890 -0.70804434 -1.57904481 [91] 1.40506867 0.54076411 -1.30061021 -1.14071773 1.03211267 [96] -0.81586867 -1.47142117 0.95430477 -3.09475256 -2.23936517 [101] 1.43406825 -1.86286497 -1.56082921 1.09232415 -1.83965588 [106] 3.77556459 -0.72434819 6.00166898 8.52716995 14.78217815 [111] -0.47839344 1.06281553 -0.37505997 3.14458388 -0.42023152 [116] -2.28091608 -3.25496810 0.67148913 -2.84386786 -2.54984146 [121] -2.92936486 -0.93419342 -1.23199630 -1.45207347 -1.47654415 [126] -1.13826289 -0.98583983 -0.97026852 1.41212400 1.53873051 [131] -1.11661801 -0.05759198 2.24779391 -0.90823476 1.19919584 [136] -1.17875823 -1.00587952 -1.37028839 -1.12453749 -1.57589157 [141] 1.33299362 3.79793590 -2.12028276 -0.42169045 -3.09071884 [146] 0.95062602 6.95757221 -2.15368857 -0.09437454 -1.70502030 [151] 0.36148336 -0.86424113 -0.38477988 -0.06826594 -1.67432515 [156] -1.93633633 -1.80444567 2.11403164 2.25076451 -2.31212937 [161] -2.36060271 -0.98258644 0.01631691 6.78235981 -2.17885629 [166] -1.84279044 -2.32060666 0.71675113 -0.26972921 1.13728554 [171] 2.44285719 -1.61549137 -1.30497575 -0.96530086 -0.23408092 [176] -0.85583288 1.60321760 -1.42492174 -1.14985338 -0.33987147 [181] -3.37436592 -1.40172881 -0.53768985 -0.38149211 -1.08129693 [186] -4.25217788 -3.11839175 0.01078186 0.07424199 -0.83974934 [191] -1.59172417 -0.47461633 0.13298584 -0.01782765 2.66009310 [196] 0.07317644 -0.44367835 -0.57354096 7.01624971 -0.61211898 [201] -0.44748779 -1.57107661 0.78364263 0.41622191 6.84856980 [206] 17.81014603 -3.30915727 -1.68773272 0.15653461 3.90517866 [211] 21.93508847 10.80544570 -1.26962957 -3.08372168 -1.14578639 [216] 3.09167793 0.09474288 -3.85314929 -3.24045578 1.83262507 [221] -3.71657916 -3.23677277 -5.23348047 -0.10139354 -2.99922368 [226] 0.53073441 -1.27783497 -6.10276795 2.72850396 -0.47294990 [231] -2.12807896 -0.08701921 -1.12136730 3.72402810 15.65510358 [236] 0.21540206 1.83335220 -1.35505069 -3.43136401 -2.11648217 [241] 19.97913416 41.30144322 -16.05620937 20.72350391 -4.41242729 [246] -25.36289175 -2.72206541 -2.22038932 -3.37032601 -10.96901284 [251] -0.63783644 -3.81761854 7.44652849 -16.82807279 3.04367763 [256] -10.99473675 7.34837831 -2.37249709 -0.70129778 -11.17208748 [261] -0.07570005 4.95071641 3.06619886 -3.68873544 -3.70738591 [266] 2.48543332 1.61385615 -0.90267546 -1.61720754 -5.87759605 [271] -1.04951590 -3.96385194 0.38297894 7.84830615 10.89630321 [276] -11.57844291 -5.05647589 2.63541439 1.65047951 -0.89065296 [281] -8.43779603 -1.02688590 -3.03949042 0.23332229 -1.08729700 [286] 0.54704349 -1.59341486 -2.71553382 -6.04621347 2.42941222 [291] 3.60350827 3.75372111 -13.16087623 0.16468300 1.47440788 [296] 4.34320444 -8.18324666 1.87339986 -1.51694333 5.32139635 [301] -3.36618126 5.13274146 1.91322963 -3.91588462 -3.15311112 [306] -5.88324912 0.61928689 5.58066413 -1.94498033 1.27573801 [311] -8.78681965 6.55058622 -1.11095430 -1.33180864 0.78519329 [316] 1.85036291 -2.88561713 4.20497159 -4.33519398 2.08196364 [321] -2.28054192 2.16261965 0.51487270 6.76010528 -1.00502666 [326] 2.42289786 -2.85389111 3.93875074 5.28605740 -8.06214197 [331] 0.49270189 6.20182836 0.34923913 6.93118780 6.38670956 [336] 0.91251162 13.99660945 13.17482599 -6.78918034 -2.91968622 [341] -5.39462473 -4.58904349 0.43328896 -7.22365212 6.89762198 [346] -0.20066003 -0.50081470 12.63375835 -9.48796939 -2.39998710 [351] 1.14473714 0.59931933 -6.03979697 -0.75214402 4.31679281 [356] -3.65857046 -2.77753796 10.84717901 7.81038894 > postscript(file="/var/www/html/rcomp/tmp/2t1lp1260461091.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/37zok1260461091.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/4zgx11260461091.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/5731c1260461091.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/6urwv1260461091.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/7fr6d1260461091.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/8agn11260461091.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/9puvn1260461091.tab") > > system("convert tmp/10rac1260461091.ps tmp/10rac1260461091.png") > system("convert tmp/2t1lp1260461091.ps tmp/2t1lp1260461091.png") > system("convert tmp/37zok1260461091.ps tmp/37zok1260461091.png") > system("convert tmp/4zgx11260461091.ps tmp/4zgx11260461091.png") > system("convert tmp/5731c1260461091.ps tmp/5731c1260461091.png") > system("convert tmp/6urwv1260461091.ps tmp/6urwv1260461091.png") > system("convert tmp/7fr6d1260461091.ps tmp/7fr6d1260461091.png") > > > proc.time() user system elapsed 4.223 1.178 5.019