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.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.1165054 0.009023554 0.1193391 -0.2595537 -0.1240166 0.07970273 [2,] 0.1174948 0.000000000 0.1203112 -0.2595617 -0.1226786 0.07757031 [3,] 0.1162107 0.000000000 0.1239145 -0.2578177 -0.1265947 0.07016967 [4,] 0.1117958 0.000000000 0.1279448 -0.2485990 -0.1321221 0.07010914 [5,] 0.1121209 0.000000000 0.1248597 -0.2420279 -0.1216582 0.06581656 [6,] 0.1030506 0.000000000 0.1315789 -0.2429789 -0.1152304 0.00000000 [7,] 0.1095164 0.000000000 0.1279715 -0.2354941 -0.1098165 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.1344453 -0.03878088 -0.04567073 0.03121766 0.09709039 [2,] 0.1333327 -0.03828958 -0.04457333 0.03102721 0.09682409 [3,] 0.1378453 -0.03810447 -0.04124890 0.00000000 0.10031368 [4,] 0.1330680 0.00000000 -0.04562772 0.00000000 0.09644332 [5,] 0.1318686 0.00000000 0.00000000 0.00000000 0.09446810 [6,] 0.1396906 0.00000000 0.00000000 0.00000000 0.08612690 [7,] 0.1175060 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.02813 0.866 0.02574 0e+00 0.02485 0.14936 0.01514 0.46939 0.39155 [2,] 0.02593 NA 0.02374 0e+00 0.02491 0.14941 0.01526 0.47436 0.39948 [3,] 0.02752 NA 0.01913 0e+00 0.01985 0.17974 0.01136 0.47672 0.43305 [4,] 0.03281 NA 0.01505 0e+00 0.01414 0.18050 0.01383 NA 0.38294 [5,] 0.03246 NA 0.01752 0e+00 0.02055 0.20710 0.01480 NA NA [6,] 0.04760 NA 0.01213 0e+00 0.02779 NA 0.00954 NA NA [7,] 0.03554 NA 0.01497 1e-05 0.03638 NA 0.02470 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.55778 0.06851 [2,] 0.56012 0.06917 [3,] NA 0.05827 [4,] NA 0.06737 [5,] NA 0.07320 [6,] NA 0.10030 [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.1193 -0.2596 -0.124 0.0797 0.1344 -0.0388 -0.0457 s.e. 0.0528 0.0534 0.0533 0.0536 0.055 0.0552 0.0551 0.0535 0.0532 ar10 ar11 0.0312 0.0971 s.e. 0.0532 0.0531 sigma^2 estimated as 26.17: log likelihood = -1089.58, aic = 2203.17 [[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.1193 -0.2596 -0.124 0.0797 0.1344 -0.0388 -0.0457 s.e. 0.0528 0.0534 0.0533 0.0536 0.055 0.0552 0.0551 0.0535 0.0532 ar10 ar11 0.0312 0.0971 s.e. 0.0532 0.0531 sigma^2 estimated as 26.17: log likelihood = -1089.58, aic = 2203.17 [[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.1203 -0.2596 -0.1227 0.0776 0.1333 -0.0383 -0.0446 s.e. 0.0525 0 0.0530 0.0536 0.0545 0.0537 0.0547 0.0535 0.0528 ar10 ar11 0.0310 0.0968 s.e. 0.0532 0.0531 sigma^2 estimated as 26.17: log likelihood = -1089.6, aic = 2201.2 [[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.1239 -0.2578 -0.1266 0.0702 0.1378 -0.0381 -0.0412 s.e. 0.0525 0 0.0526 0.0536 0.0541 0.0522 0.0542 0.0535 0.0526 ar10 ar11 0 0.1003 s.e. 0 0.0528 sigma^2 estimated as 26.20: log likelihood = -1089.77, aic = 2199.54 [[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.1279 -0.2486 -0.1321 0.0701 0.1331 0 -0.0456 0 s.e. 0.0522 0 0.0524 0.0520 0.0536 0.0522 0.0538 0 0.0522 0 ar11 0.0964 s.e. 0.0526 sigma^2 estimated as 26.23: log likelihood = -1090.02, aic = 2198.04 [[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.1249 -0.2420 -0.1217 0.0658 0.1319 0 0 0 s.e. 0.0522 0 0.0523 0.0515 0.0523 0.0521 0.0538 0 0 0 ar11 0.0945 s.e. 0.0526 sigma^2 estimated as 26.29: log likelihood = -1090.4, aic = 2196.8 [[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.1316 -0.2430 -0.1152 0 0.1397 0 0 0 s.e. 0.0518 0 0.0522 0.0516 0.0522 0 0.0536 0 0 0 ar11 0.0861 s.e. 0.0523 sigma^2 estimated as 26.41: log likelihood = -1091.2, aic = 2196.4 [[3]][[8]] NULL [[3]][[9]] NULL [[3]][[10]] NULL [[3]][[11]] NULL $aic [1] 2203.167 2201.196 2199.535 2198.042 2196.805 2196.398 2197.102 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/1m0j51260631090.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 = 358 Frequency = 1 [1] 0.08708995 -0.16056063 0.65472437 2.90084570 -0.34129875 [6] -0.40648521 -0.89912249 0.24006789 -0.02978802 -0.56840283 [11] -1.20898147 -0.36405146 -0.44655429 -0.39540135 -0.72253210 [16] -0.31818638 -0.24981463 -0.22102106 -0.69505640 -1.01244632 [21] -0.73522714 -0.57543591 -0.63200312 -1.70399518 -9.38595922 [26] 0.20797886 1.49954275 4.66763935 -0.79241984 0.53957375 [31] 3.61776867 3.34836959 1.91457937 0.70941114 0.61821113 [36] 0.17778053 -0.36424654 2.54705743 -1.71985657 -1.55963404 [41] -1.53078818 -0.39008040 -0.59551594 -1.36419956 -1.67589241 [46] 2.87210444 -0.64864793 -1.01175658 -1.60664578 0.19400311 [51] -0.10254948 -0.84139209 -1.38360061 -0.93992612 -0.78819810 [56] 3.90471970 1.69116508 -1.11948864 -1.71240743 -0.15890369 [61] 4.79416726 0.03851400 -1.73581860 -2.08088638 0.12529068 [66] -0.26005571 -1.12120825 5.10248090 -2.39944619 -1.43339933 [71] -1.98320878 0.26455923 -0.67597753 1.64522418 -1.58255227 [76] -1.30261797 -1.61996172 -0.81668945 2.70986115 0.39986344 [81] -0.81511366 -2.12860776 0.51362213 -0.60563650 -0.56653345 [86] -0.62014706 -0.35009288 -0.70794642 -1.57911081 1.40514921 [91] 0.54088278 -1.30037539 -1.14102096 1.03200469 -0.81564463 [96] -1.47134550 0.95414588 -3.09451988 -2.23914050 1.43374481 [101] -1.86232029 -1.56041002 1.09193811 -1.83935216 3.77582214 [106] -0.72468987 6.00192856 8.52673106 14.78220008 -0.47915480 [111] 1.06138559 -0.37724228 3.14458024 -0.42013654 -2.28074216 [116] -3.25460476 0.67169983 -2.84348704 -2.54950810 -2.92927515 [121] -0.93390456 -1.23174630 -1.45192670 -1.47637952 -1.13811744 [126] -0.98569986 -0.97013771 1.41230741 1.53885509 -1.11650562 [131] -0.05789674 2.24749655 -0.90806037 1.19913982 -1.17908887 [136] -1.00561868 -1.37045155 -1.12448304 -1.57559842 1.33321918 [141] 3.79812237 -2.12004226 -0.42191857 -3.09145219 0.95089571 [146] 6.95757825 -2.15319910 -0.09429180 -1.70612011 0.36176314 [151] -0.86429592 -0.38463637 -0.06803271 -1.67410075 -1.93638813 [156] -1.80458714 2.11440472 2.25100974 -2.31184645 -2.36098094 [161] -0.98299264 0.01657870 6.78260048 -2.17858306 -1.84262226 [166] -2.32169232 0.71686192 -0.26940463 1.13752822 2.44302534 [171] -1.61534506 -1.30524700 -0.96593185 -0.23372810 -0.85564325 [176] 1.60332815 -1.42476463 -1.14967839 -0.34022130 -3.37425066 [181] -1.40147042 -0.53775660 -0.38093787 -1.08106894 -4.25217618 [186] -3.11838592 0.01086516 0.07480413 -0.83929737 -1.59172455 [191] -0.47466469 0.13300099 -0.01778191 2.66013981 0.07324790 [196] -0.44369456 -0.57404432 7.01619723 -0.61192682 -0.44742883 [201] -1.57209707 0.78376970 0.41636826 6.84858567 17.81040121 [206] -3.30891133 -1.68885960 0.15346150 3.90577731 21.93544791 [211] 10.80546054 -1.26923574 -3.08682145 -1.14788525 3.09176985 [216] 0.09539333 -3.85243303 -3.24017060 1.83271756 -3.71628519 [221] -3.23631055 -5.23371915 -0.10082168 -2.99893083 0.53113195 [226] -1.27769207 -6.10234797 2.72832698 -0.47298417 -2.12702429 [231] -0.08760061 -1.12139044 3.72443575 15.65492196 0.21563669 [236] 1.83294230 -1.35753084 -3.43161760 -2.11667334 19.97913383 [241] 41.30287243 -16.05509977 20.72024359 -4.41898550 -25.36034831 [246] -2.72578395 -2.22024221 -3.36366959 -10.96856934 -0.63771411 [251] -3.81637627 7.44798380 -16.82953391 3.04408035 -10.99575620 [256] 7.34987170 -2.37293854 -0.69975833 -11.17203031 -0.07626059 [261] 4.95104683 3.06753668 -3.68841752 -3.70869983 2.48529571 [266] 1.61386845 -0.90226421 -1.61741020 -5.87741130 -1.04949274 [271] -3.96396465 0.38398433 7.84867253 10.89691300 -11.57846210 [276] -5.05801227 2.63347307 1.65213574 -0.88980625 -8.43824425 [281] -1.02634199 -3.03945785 0.23405428 -1.08712805 0.54785473 [286] -1.59351152 -2.71591646 -6.04642895 2.42952017 3.60400071 [291] 3.75459330 -13.16097842 0.16390728 1.47378824 4.34497811 [296] -8.18319506 1.87308221 -1.51711298 5.32215951 -3.36667478 [301] 5.13289503 1.91305648 -3.91586385 -3.15396606 -5.88372045 [306] 0.62028920 5.58091390 -1.94385844 1.27592201 -8.78773467 [311] 6.55050713 -1.11129113 -1.33060261 0.78436842 1.85049405 [316] -2.88518443 4.20441584 -4.33528559 2.08252397 -2.28111997 [321] 2.16292211 0.51492658 6.76023394 -1.00515922 2.42270054 [326] -2.85482097 3.93869013 5.28586677 -8.06180225 0.49242175 [331] 6.20094201 0.35073301 6.93104053 6.38574461 0.91288248 [336] 13.99541694 13.17344629 -6.78891914 -2.92167318 -5.39687116 [341] -4.58755814 0.43392018 -7.22266915 6.89925458 -0.20056760 [346] -0.50015263 12.63243220 -9.48813902 -2.40007603 1.14223098 [351] 0.60085307 -6.03894777 -0.75257521 4.31723805 -3.65725191 [356] -2.77782123 10.84611954 7.81147178 > postscript(file="/var/www/html/rcomp/tmp/2c2dr1260631090.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/3mtgz1260631090.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/463zl1260631090.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/5ixlj1260631090.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/6addy1260631090.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/7mv621260631090.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/8v9dz1260631090.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/9qokt1260631090.tab") > try(system("convert tmp/1m0j51260631090.ps tmp/1m0j51260631090.png",intern=TRUE)) character(0) > try(system("convert tmp/2c2dr1260631090.ps tmp/2c2dr1260631090.png",intern=TRUE)) character(0) > try(system("convert tmp/3mtgz1260631090.ps tmp/3mtgz1260631090.png",intern=TRUE)) character(0) > try(system("convert tmp/463zl1260631090.ps tmp/463zl1260631090.png",intern=TRUE)) character(0) > try(system("convert tmp/5ixlj1260631090.ps tmp/5ixlj1260631090.png",intern=TRUE)) character(0) > try(system("convert tmp/6addy1260631090.ps tmp/6addy1260631090.png",intern=TRUE)) character(0) > try(system("convert tmp/7mv621260631090.ps tmp/7mv621260631090.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.124 1.104 4.661