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) > 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.10733457 0.01246565 0.1212155 -0.2631053 -0.1245925 0.08492635 [2,] 0.10875366 0.00000000 0.1225426 -0.2630986 -0.1227507 0.08195130 [3,] 0.10424713 0.00000000 0.1267104 -0.2537552 -0.1284014 0.08182960 [4,] 0.10310412 0.00000000 0.1311815 -0.2513354 -0.1334312 0.07195762 [5,] 0.10319831 0.00000000 0.1284537 -0.2454012 -0.1238811 0.06807570 [6,] 0.09402406 0.00000000 0.1352897 -0.2463157 -0.1172197 0.00000000 [7,] 0.09849804 0.00000000 0.1326380 -0.2403330 -0.1127830 0.00000000 [8,] 0.00000000 0.00000000 0.1316610 -0.2311235 -0.1361120 0.00000000 [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.1347711 -0.03923653 -0.04312910 0.04149431 0.08472699 [2,] 0.1332289 -0.03854721 -0.04162994 0.04116583 0.08442903 [3,] 0.1284285 0.00000000 -0.04604924 0.04092952 0.08059149 [4,] 0.1343533 0.00000000 -0.04183602 0.00000000 0.08578257 [5,] 0.1333126 0.00000000 0.00000000 0.00000000 0.08370693 [6,] 0.1413336 0.00000000 0.00000000 0.00000000 0.07535014 [7,] 0.1224633 0.00000000 0.00000000 0.00000000 0.00000000 [8,] 0.1268842 0.00000000 0.00000000 0.00000000 0.00000000 [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.04309 0.8149 0.02279 0e+00 0.02347 0.12325 0.01440 0.46196 0.41626 [2,] 0.03916 NA 0.02062 0e+00 0.02410 0.12635 0.01484 0.46919 0.42928 [3,] 0.04659 NA 0.01615 0e+00 0.01725 0.12727 0.01802 NA 0.37912 [4,] 0.04913 NA 0.01232 0e+00 0.01282 0.16741 0.01255 NA 0.42207 [5,] 0.04909 NA 0.01412 0e+00 0.01785 0.18996 0.01332 NA NA [6,] 0.07100 NA 0.00963 0e+00 0.02461 NA 0.00845 NA NA [7,] 0.05894 NA 0.01131 0e+00 0.03078 NA 0.01879 NA NA [8,] NA NA 0.01233 1e-05 0.00768 NA 0.01534 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.43682 0.11344 [2,] 0.44034 0.11466 [3,] 0.44330 0.13041 [4,] NA 0.10488 [5,] NA 0.11344 [6,] NA 0.15201 [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.1073 0.0125 0.1212 -0.2631 -0.1246 0.0849 0.1348 -0.0392 s.e. 0.0529 0.0532 0.0530 0.0534 0.0547 0.0550 0.0548 0.0533 ar9 ar10 ar11 -0.0431 0.0415 0.0847 s.e. 0.0530 0.0533 0.0534 sigma^2 estimated as 25.9: log likelihood = -1090.8, aic = 2205.6 [[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.1073 0.0125 0.1212 -0.2631 -0.1246 0.0849 0.1348 -0.0392 s.e. 0.0529 0.0532 0.0530 0.0534 0.0547 0.0550 0.0548 0.0533 ar9 ar10 ar11 -0.0431 0.0415 0.0847 s.e. 0.0530 0.0533 0.0534 sigma^2 estimated as 25.9: log likelihood = -1090.8, aic = 2205.6 [[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.1088 0 0.1225 -0.2631 -0.1228 0.0820 0.1332 -0.0385 -0.0416 s.e. 0.0525 0 0.0527 0.0534 0.0542 0.0535 0.0544 0.0532 0.0526 ar10 ar11 0.0412 0.0844 s.e. 0.0533 0.0534 sigma^2 estimated as 25.91: log likelihood = -1090.83, aic = 2203.65 [[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.1042 0 0.1267 -0.2538 -0.1284 0.0818 0.1284 0 -0.0460 s.e. 0.0522 0 0.0524 0.0518 0.0537 0.0535 0.0540 0 0.0523 ar10 ar11 0.0409 0.0806 s.e. 0.0533 0.0532 sigma^2 estimated as 25.94: log likelihood = -1091.09, aic = 2202.17 [[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.1031 0 0.1312 -0.2513 -0.1334 0.072 0.1344 0 -0.0418 0 s.e. 0.0522 0 0.0521 0.0518 0.0533 0.052 0.0535 0 0.0520 0 ar11 0.0858 s.e. 0.0528 sigma^2 estimated as 25.99: log likelihood = -1091.38, aic = 2200.76 [[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.1032 0 0.1285 -0.2454 -0.1239 0.0681 0.1333 0 0 0 s.e. 0.0523 0 0.0521 0.0513 0.0521 0.0518 0.0536 0 0 0 ar11 0.0837 s.e. 0.0527 sigma^2 estimated as 26.04: log likelihood = -1091.7, aic = 2199.41 [[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.0940 0 0.1353 -0.2463 -0.1172 0 0.1413 0 0 0 s.e. 0.0519 0 0.0520 0.0514 0.0519 0 0.0534 0 0 0 ar11 0.0754 s.e. 0.0525 sigma^2 estimated as 26.16: log likelihood = -1092.56, aic = 2199.13 [[3]][[8]] 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 ar11 0.0985 0 0.1326 -0.2403 -0.1128 0 0.1225 0 0 0 0 s.e. 0.0520 0 0.0521 0.0514 0.0520 0 0.0519 0 0 0 0 sigma^2 estimated as 26.32: log likelihood = -1093.59, aic = 2199.18 [[3]][[9]] NULL [[3]][[10]] NULL [[3]][[11]] NULL $aic [1] 2205.595 2203.650 2202.175 2200.763 2199.409 2199.129 2199.183 2200.755 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 7: 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/1rbwp1260460010.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] 8.727995e-02 -9.480540e-06 -1.811136e-01 -1.431448e-01 6.539392e-01 [6] 3.018560e+00 -3.499394e-01 -4.701872e-01 -9.848928e-01 3.189276e-01 [11] -5.156767e-02 -6.174813e-01 -1.218522e+00 -3.333448e-01 -4.655325e-01 [16] -3.488763e-01 -4.615004e-01 -3.285977e-01 -2.929905e-01 -2.975789e-01 [21] -7.511603e-01 -1.066533e+00 -7.956134e-01 -6.478096e-01 -6.589373e-01 [26] -1.743258e+00 -9.425898e+00 1.265657e-01 1.453405e+00 4.646761e+00 [31] -7.866741e-01 4.963586e-01 3.497499e+00 3.112613e+00 1.827370e+00 [36] 6.624694e-01 5.326992e-01 -6.129627e-01 -4.025963e-01 2.715134e+00 [41] -1.347398e+00 -1.380691e+00 -1.350652e+00 -6.999118e-02 -4.899767e-01 [46] -1.263020e+00 -1.561254e+00 2.865333e+00 -7.361742e-01 -1.074431e+00 [51] -1.381545e+00 7.243033e-02 -2.329173e-01 -9.235790e-01 -1.410343e+00 [56] -1.024607e+00 -9.006093e-01 3.794264e+00 1.942242e+00 -1.153724e+00 [61] -1.816757e+00 -2.613778e-01 4.695472e+00 -3.287956e-02 -1.747452e+00 [66] -2.123778e+00 1.314143e-02 -3.754934e-01 -8.124398e-01 5.371906e+00 [71] -2.435089e+00 -1.552828e+00 -2.094466e+00 5.210151e-01 -7.145032e-01 [76] 1.541743e+00 -1.560088e+00 -1.402383e+00 -1.744298e+00 -9.250407e-01 [81] 3.192904e+00 2.495523e-01 -9.128462e-01 -2.239437e+00 3.707506e-01 [86] -7.636604e-01 -4.520774e-01 -6.046618e-01 -4.550267e-01 -8.274141e-01 [91] -1.730393e+00 1.618896e+00 5.694784e-01 -1.341742e+00 -1.269528e+00 [96] 9.936426e-01 -9.500698e-01 -1.583011e+00 9.739800e-01 -3.106642e+00 [101] -2.330340e+00 1.277622e+00 -1.709224e+00 -1.540009e+00 9.454240e-01 [106] -1.867365e+00 3.781684e+00 -8.743834e-01 5.882195e+00 8.637562e+00 [111] 1.451823e+01 -6.351593e-01 1.155352e+00 -5.448431e-01 2.930929e+00 [116] -2.150864e-01 -2.288124e+00 -2.725407e+00 6.973162e-01 -2.330107e+00 [121] -1.737227e+00 -1.693319e+00 -8.436269e-01 -1.179743e+00 -1.558336e+00 [126] -1.593426e+00 -1.299265e+00 -1.164967e+00 -1.092760e+00 1.479998e+00 [131] 1.374343e+00 -1.263539e+00 -2.029146e-01 2.090556e+00 -1.051151e+00 [136] 1.047054e+00 -1.260719e+00 -1.096598e+00 -1.496040e+00 -1.216036e+00 [141] -1.419251e+00 1.446879e+00 3.742724e+00 -2.092365e+00 -2.856732e-01 [146] -3.267635e+00 9.696233e-01 6.864299e+00 -2.236635e+00 -1.460707e-01 [151] -1.848116e+00 2.199641e-01 -8.175366e-01 -3.156783e-02 -8.060600e-02 [156] -1.687957e+00 -2.182483e+00 -1.894105e+00 2.638032e+00 2.092685e+00 [161] -2.227055e+00 -2.398588e+00 -1.150757e+00 -1.627259e-01 6.713688e+00 [166] -2.061939e+00 -1.939371e+00 -2.506994e+00 5.152112e-01 -1.421003e-01 [171] 1.303247e+00 2.420225e+00 -1.743222e+00 -1.458285e+00 -1.130415e+00 [176] 2.694157e-01 -9.560647e-01 1.503506e+00 -1.474969e+00 -1.275281e+00 [181] -4.600750e-01 -3.286942e+00 -1.124892e+00 -6.671193e-01 -4.462668e-01 [186] -1.178219e+00 -4.363005e+00 -3.257889e+00 8.731828e-02 -4.963637e-03 [191] -9.473802e-01 -1.586624e+00 -8.021477e-01 -9.151089e-02 -1.311299e-01 [196] 2.595703e+00 2.184080e-02 -7.757857e-01 -8.757495e-01 6.950971e+00 [201] -6.462200e-01 -5.029640e-01 -1.581516e+00 7.302272e-01 3.459665e-01 [206] 6.800451e+00 1.817801e+01 -3.197234e+00 -1.768028e+00 6.396399e-02 [211] 4.372482e+00 2.183005e+01 1.096940e+01 -8.893174e-01 -3.182858e+00 [216] -1.267832e+00 3.591398e+00 1.715395e+00 -3.620995e+00 -3.063816e+00 [221] 1.972963e+00 -3.807979e+00 -1.625366e+00 -4.049633e+00 8.927454e-02 [226] -3.061107e+00 1.688358e-01 -1.378579e+00 -6.222211e+00 2.498761e+00 [231] -5.836467e-01 -1.886805e+00 -4.339206e-01 -1.275677e+00 3.400321e+00 [236] 1.543999e+01 5.883905e-02 1.842686e+00 -1.425442e+00 -4.012406e+00 [241] -1.994485e+00 1.995353e+01 4.141005e+01 -1.573192e+01 2.063023e+01 [246] -4.159131e+00 -2.428588e+01 -2.928112e+00 -1.746214e+00 -2.644735e+00 [251] -1.172365e+01 -5.335066e-01 -2.110993e+00 1.058336e+01 -1.775042e+01 [256] 4.996006e+00 -1.110654e+01 3.830239e+00 -2.808423e+00 -1.071313e+00 [261] -1.152225e+01 -7.708608e-01 5.609804e+00 2.885117e+00 -3.078911e+00 [266] -4.975075e+00 2.584054e+00 4.696882e-01 -1.068807e+00 -1.436575e+00 [271] -5.958875e+00 -1.820098e+00 -4.159082e+00 8.628423e-01 7.934407e+00 [276] 1.082981e+01 -1.175500e+01 -5.101206e+00 2.402634e+00 1.400159e+00 [281] -9.042054e-01 -8.770416e+00 -1.045824e+00 -3.552416e+00 1.445761e-01 [286] -2.933979e-01 1.552803e+00 -2.391803e+00 -3.243297e+00 -5.975207e+00 [291] 1.968125e+00 3.495698e+00 3.343611e+00 -1.312366e+01 -2.428829e-01 [296] 1.330555e+00 4.329878e+00 -8.043605e+00 1.797083e+00 -1.717694e+00 [301] 4.590546e+00 -3.335474e+00 5.419905e+00 2.281741e+00 -4.922755e+00 [306] -3.169887e+00 -5.871467e+00 6.885551e-01 5.053456e+00 -1.543845e+00 [311] 1.275283e+00 -8.675289e+00 6.336958e+00 -7.826922e-01 -1.105512e+00 [316] 3.578322e-01 1.647008e+00 -3.418829e+00 3.916640e+00 -3.777396e+00 [321] 2.038686e+00 -2.043901e+00 1.589087e+00 9.056880e-01 6.596281e+00 [326] -1.183706e+00 2.596616e+00 -2.718478e+00 3.592364e+00 5.631246e+00 [331] -8.268696e+00 6.022579e-01 6.101061e+00 4.852420e-01 7.027165e+00 [336] 7.010666e+00 1.055038e+00 1.403811e+01 1.304866e+01 -6.518574e+00 [341] -2.548688e+00 -6.047451e+00 -4.430939e+00 9.768091e-01 -7.053210e+00 [346] 7.860570e+00 5.877534e-01 -4.371230e-01 1.369535e+01 -8.404153e+00 [351] -3.119528e+00 7.590379e-01 1.538077e-01 -6.841039e+00 -7.505607e-01 [356] 4.192055e+00 -2.936273e+00 -2.549425e+00 1.087317e+01 > postscript(file="/var/www/html/rcomp/tmp/2c0kq1260460010.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/3m4lk1260460010.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/4m4q41260460010.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/5rcct1260460010.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/6xou61260460010.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/7k77u1260460010.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/8556d1260460010.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/9aqje1260460010.tab") > system("convert tmp/1rbwp1260460010.ps tmp/1rbwp1260460010.png") > system("convert tmp/2c0kq1260460010.ps tmp/2c0kq1260460010.png") > system("convert tmp/3m4lk1260460010.ps tmp/3m4lk1260460010.png") > system("convert tmp/4m4q41260460010.ps tmp/4m4q41260460010.png") > system("convert tmp/5rcct1260460010.ps tmp/5rcct1260460010.png") > system("convert tmp/6xou61260460010.ps tmp/6xou61260460010.png") > system("convert tmp/7k77u1260460010.ps tmp/7k77u1260460010.png") > > > proc.time() user system elapsed 4.226 1.114 6.737