R version 2.7.0 (2008-04-22) Copyright (C) 2008 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(122.36 + ,123.33 + ,123.04 + ,124.53 + ,125.13 + ,125.85 + ,126.50 + ,126.53 + ,127.07 + ,124.55 + ,124.90 + ,124.32 + ,122.84 + ,123.31 + ,123.31 + ,124.87 + ,124.64 + ,124.73 + ,124.90 + ,124.04 + ,123.28 + ,123.86 + ,122.29 + ,124.09 + ,124.54 + ,125.65 + ,125.70 + ,125.53 + ,125.61 + ,125.55 + ,125.41 + ,127.60 + ,124.68 + ,124.41 + ,126.43 + ,126.38 + ,125.78 + ,124.70 + ,125.07 + ,125.25 + ,126.58 + ,127.13 + ,125.82 + ,123.70 + ,124.39 + ,123.70 + ,124.42 + ,121.05 + ,121.02 + ,123.23 + ,121.32 + ,120.91 + ,120.72 + ,123.31 + ,119.58 + ,119.53 + ,120.59 + ,118.63 + ,118.47 + ,111.81 + ,114.71 + ,117.34 + ,115.77 + ,118.38 + ,117.84 + ,118.83 + ,120.02 + ,116.21 + ,117.08 + ,120.20 + ,119.83 + ,118.92 + ,118.03 + ,117.71 + ,119.55 + ,116.13 + ,115.97 + ,115.99 + ,114.96 + ,116.46 + ,116.55 + ,113.05 + ,117.44 + ,118.84 + ,117.06 + ,117.54 + ,119.31 + ,118.72 + ,121.55 + ,122.61 + ,121.53 + ,123.31 + ,124.07 + ,123.59 + ,122.97 + ,123.22 + ,123.04 + ,122.96 + ,122.81 + ,122.81 + ,122.62 + ,120.82 + ,119.41 + ,121.56 + ,121.59 + ,118.50 + ,118.77 + ,118.86 + ,117.60 + ,119.90 + ,121.83 + ,121.84 + ,122.12 + ,122.12 + ,121.36 + ,119.66 + ,119.32 + ,120.36 + ,117.06 + ,117.48 + ,115.60 + ,113.86 + ,116.92 + ,117.75 + ,117.75 + ,115.31 + ,116.28 + ,115.22 + ,115.65 + ,115.11 + ,118.67 + ,118.04 + ,116.50 + ,119.78 + ,119.95 + ,120.37 + ,119.79 + ,119.43 + ,121.06 + ,121.74 + ,121.09 + ,122.97 + ,120.50 + ,117.18 + ,115.03 + ,113.36 + ,112.59 + ,111.65 + ,111.98 + ,114.87 + ,114.67 + ,114.09 + ,114.77 + ,117.05 + ,117.22 + ,113.18 + ,110.95 + ,112.14 + ,112.72 + ,110.01 + ,110.29 + ,110.74 + ,110.32 + ,105.89 + ,108.97 + ,109.34 + ,106.57 + ,99.49 + ,101.81 + ,104.29 + ,109.73 + ,105.06 + ,107.97 + ,108.13 + ,109.86 + ,108.95 + ,111.20 + ,110.69 + ,106.10 + ,105.68 + ,104.12 + ,104.71 + ,104.30 + ,103.52 + ,107.76 + ,107.80 + ,107.30 + ,108.64 + ,105.03 + ,108.30 + ,107.21 + ,109.27 + ,109.50 + ,111.68 + ,111.80 + ,111.75 + ,106.68 + ,106.37 + ,105.76 + ,109.01 + ,109.01 + ,109.01 + ,109.01 + ,107.69 + ,105.19 + ,105.48 + ,102.22 + ,100.54 + ,105.00 + ,105.44 + ,107.89 + ,108.64 + ,106.70 + ,109.10 + ,105.23 + ,108.41 + ,108.80 + ,110.39 + ,110.22 + ,110.86 + ,108.58 + ,107.70 + ,106.62 + ,109.84 + ,107.16 + ,107.26 + ,108.70 + ,109.85 + ,109.41 + ,112.36 + ,111.03 + ,110.67 + ,109.21 + ,113.58 + ,113.88 + ,114.08 + ,112.33 + ,113.92 + ,114.41 + ,114.57 + ,115.35 + ,113.13 + ,113.29 + ,112.56 + ,113.06 + ,113.46 + ,115.39 + ,116.62 + ,117.04 + ,117.42 + ,115.62 + ,115.16 + ,115.69 + ,112.85 + ,114.05 + ,112.00 + ,113.74 + ,116.26 + ,118.63 + ,116.49 + ,118.23 + ,116.83 + ,118.82 + ,114.36 + ,112.02 + ,113.24 + ,109.75 + ,110.33 + ,112.86 + ,113.04 + ,113.80 + ,110.90 + ,109.96 + ,108.69 + ,108.84 + ,108.47 + ,108.07 + ,107.94 + ,108.11 + ,108.11 + ,106.81 + ,105.58 + ,105.61 + ,106.52 + ,103.86 + ,104.60 + ,104.73 + ,105.12 + ,104.76 + ,103.85 + ,103.83 + ,103.22 + ,101.64 + ,102.13 + ,104.33 + ,104.92 + ,107.78 + ,104.49 + ,102.80 + ,102.86 + ,104.51 + ,104.73 + ,102.58 + ,99.93 + ,101.41 + ,101.05 + ,99.86 + ,101.11 + ,100.89 + ,101.09 + ,98.31 + ,98.08 + ,99.55 + ,99.62 + ,97.37 + ,98.16 + ,97.98 + ,98.15 + ,97.10 + ,97.24 + ,96.70 + ,96.64 + ,100.65 + ,96.75 + ,97.74 + ,97.92 + ,98.34 + ,93.84 + ,97.80 + ,96.20 + ,95.99 + ,95.18 + ,95.95 + ,92.23 + ,91.78 + ,92.97 + ,89.76 + ,92.88 + ,96.23 + ,95.79 + ,93.97 + ,93.90 + ,93.60 + ,93.96 + ,88.69 + ,88.57 + ,85.62 + ,86.25 + ,85.33 + ,83.33 + ,77.78 + ,78.70 + ,72.05 + ,80.75 + ,81.41 + ,82.65 + ,75.85 + ,75.70 + ,78.25 + ,77.41 + ,76.84 + ,74.25 + ,74.95 + ,68.78 + ,73.21 + ,73.26 + ,78.67 + ,75.63 + ,74.99 + ,83.87 + ,79.62 + ,80.13 + ,79.76 + ,78.20 + ,78.05 + ,79.05 + ,73.32 + ,75.17 + ,73.26 + ,73.72 + ,73.57 + ,70.60 + ,71.25 + ,74.22 + ,73.32 + ,73.01 + ,74.21 + ,75.32 + ,71.73 + ,71.94 + ,72.94 + ,72.47 + ,71.94 + ,74.30 + ,74.30) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '1' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = 'FALSE' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > if (par1 == 'TRUE') par1 <- TRUE > if (par1 == 'FALSE') par1 <- FALSE > par2 <- as.numeric(par2) #Box-Cox lambda transformation parameter > par3 <- as.numeric(par3) #degree of non-seasonal differencing > par4 <- as.numeric(par4) #degree of seasonal differencing > par5 <- as.numeric(par5) #seasonal period > par6 <- as.numeric(par6) #degree (p) of the non-seasonal AR(p) polynomial > par7 <- as.numeric(par7) #degree (q) of the non-seasonal MA(q) polynomial > par8 <- as.numeric(par8) #degree (P) of the seasonal AR(P) polynomial > par9 <- as.numeric(par9) #degree (Q) of the seasonal MA(Q) polynomial > armaGR <- function(arima.out, names, n){ + try1 <- arima.out$coef + try2 <- sqrt(diag(arima.out$var.coef)) + try.data.frame <- data.frame(matrix(NA,ncol=4,nrow=length(names))) + dimnames(try.data.frame) <- list(names,c('coef','std','tstat','pv')) + try.data.frame[,1] <- try1 + for(i in 1:length(try2)) try.data.frame[which(rownames(try.data.frame)==names(try2)[i]),2] <- try2[i] + try.data.frame[,3] <- try.data.frame[,1] / try.data.frame[,2] + try.data.frame[,4] <- round((1-pt(abs(try.data.frame[,3]),df=n-(length(try2)+1)))*2,5) + vector <- rep(NA,length(names)) + vector[is.na(try.data.frame[,4])] <- 0 + maxi <- which.max(try.data.frame[,4]) + continue <- max(try.data.frame[,4],na.rm=TRUE) > .05 + vector[maxi] <- 0 + list(summary=try.data.frame,next.vector=vector,continue=continue) + } > arimaSelect <- function(series, order=c(13,0,0), seasonal=list(order=c(2,0,0),period=12), include.mean=F){ + nrc <- order[1]+order[3]+seasonal$order[1]+seasonal$order[3] + coeff <- matrix(NA, nrow=nrc*2, ncol=nrc) + pval <- matrix(NA, nrow=nrc*2, ncol=nrc) + mylist <- rep(list(NULL), nrc) + names <- NULL + if(order[1] > 0) names <- paste('ar',1:order[1],sep='') + if(order[3] > 0) names <- c( names , paste('ma',1:order[3],sep='') ) + if(seasonal$order[1] > 0) names <- c(names, paste('sar',1:seasonal$order[1],sep='')) + if(seasonal$order[3] > 0) names <- c(names, paste('sma',1:seasonal$order[3],sep='')) + arima.out <- arima(series, order=order, seasonal=seasonal, include.mean=include.mean, method='ML') + mylist[[1]] <- arima.out + last.arma <- armaGR(arima.out, names, length(series)) + mystop <- FALSE + i <- 1 + coeff[i,] <- last.arma[[1]][,1] + pval [i,] <- last.arma[[1]][,4] + i <- 2 + aic <- arima.out$aic + while(!mystop){ + mylist[[i]] <- arima.out + arima.out <- arima(series, order=order, seasonal=seasonal, include.mean=include.mean, method='ML', fixed=last.arma$next.vector) + aic <- c(aic, arima.out$aic) + last.arma <- armaGR(arima.out, names, length(series)) + mystop <- !last.arma$continue + coeff[i,] <- last.arma[[1]][,1] + pval [i,] <- last.arma[[1]][,4] + i <- i+1 + } + list(coeff, pval, mylist, aic=aic) + } > arimaSelectplot <- function(arimaSelect.out,noms,choix){ + noms <- names(arimaSelect.out[[3]][[1]]$coef) + coeff <- arimaSelect.out[[1]] + k <- min(which(is.na(coeff[,1])))-1 + coeff <- coeff[1:k,] + pval <- arimaSelect.out[[2]][1:k,] + aic <- arimaSelect.out$aic[1:k] + coeff[coeff==0] <- NA + n <- ncol(coeff) + if(missing(choix)) choix <- k + layout(matrix(c(1,1,1,2, + 3,3,3,2, + 3,3,3,4, + 5,6,7,7),nr=4), + widths=c(10,35,45,15), + heights=c(30,30,15,15)) + couleurs <- rainbow(75)[1:50]#(50) + ticks <- pretty(coeff) + par(mar=c(1,1,3,1)) + plot(aic,k:1-.5,type='o',pch=21,bg='blue',cex=2,axes=F,lty=2,xpd=NA) + points(aic[choix],k-choix+.5,pch=21,cex=4,bg=2,xpd=NA) + title('aic',line=2) + par(mar=c(3,0,0,0)) + plot(0,axes=F,xlab='',ylab='',xlim=range(ticks),ylim=c(.1,1)) + rect(xleft = min(ticks) + (0:49)/50*(max(ticks)-min(ticks)), + xright = min(ticks) + (1:50)/50*(max(ticks)-min(ticks)), + ytop = rep(1,50), + ybottom= rep(0,50),col=couleurs,border=NA) + axis(1,ticks) + rect(xleft=min(ticks),xright=max(ticks),ytop=1,ybottom=0) + text(mean(coeff,na.rm=T),.5,'coefficients',cex=2,font=2) + par(mar=c(1,1,3,1)) + image(1:n,1:k,t(coeff[k:1,]),axes=F,col=couleurs,zlim=range(ticks)) + for(i in 1:n) for(j in 1:k) if(!is.na(coeff[j,i])) { + if(pval[j,i]<.01) symb = 'green' + else if( (pval[j,i]<.05) & (pval[j,i]>=.01)) symb = 'orange' + else if( (pval[j,i]<.1) & (pval[j,i]>=.05)) symb = 'red' + else symb = 'black' + polygon(c(i+.5 ,i+.2 ,i+.5 ,i+.5), + c(k-j+0.5,k-j+0.5,k-j+0.8,k-j+0.5), + col=symb) + if(j==choix) { + rect(xleft=i-.5, + xright=i+.5, + ybottom=k-j+1.5, + ytop=k-j+.5, + lwd=4) + text(i, + k-j+1, + round(coeff[j,i],2), + cex=1.2, + font=2) + } + else{ + rect(xleft=i-.5,xright=i+.5,ybottom=k-j+1.5,ytop=k-j+.5) + text(i,k-j+1,round(coeff[j,i],2),cex=1.2,font=1) + } + } + axis(3,1:n,noms) + par(mar=c(0.5,0,0,0.5)) + plot(0,axes=F,xlab='',ylab='',type='n',xlim=c(0,8),ylim=c(-.2,.8)) + cols <- c('green','orange','red','black') + niv <- c('0','0.01','0.05','0.1') + for(i in 0:3){ + polygon(c(1+2*i ,1+2*i ,1+2*i-.5 ,1+2*i), + c(.4 ,.7 , .4 , .4), + col=cols[i+1]) + text(2*i,0.5,niv[i+1],cex=1.5) + } + text(8,.5,1,cex=1.5) + text(4,0,'p-value',cex=2) + box() + residus <- arimaSelect.out[[3]][[choix]]$res + par(mar=c(1,2,4,1)) + acf(residus,main='') + title('acf',line=.5) + par(mar=c(1,2,4,1)) + pacf(residus,main='') + title('pacf',line=.5) + par(mar=c(2,2,4,1)) + qqnorm(residus,main='') + title('qq-norm',line=.5) + qqline(residus) + residus + } > if (par2 == 0) x <- log(x) > if (par2 != 0) x <- x^par2 > (selection <- arimaSelect(x, order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5))) [[1]] [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.7004162 0.2619634 -0.2887440 -0.4947819 0.02713884 -0.3224219 [2,] 0.6739276 0.2620525 -0.2863938 -0.4684447 0.00000000 -0.3294362 [3,] 0.4896255 0.3603398 -0.1708048 0.0000000 0.00000000 -0.2618429 [4,] NA NA NA NA NA NA [5,] NA NA NA NA NA NA [6,] NA NA NA NA NA NA [7,] NA NA NA NA NA NA [8,] NA NA NA NA NA NA [9,] NA NA NA NA NA NA [10,] NA NA NA NA NA NA [11,] NA NA NA NA NA NA [12,] NA NA NA NA NA NA [13,] NA NA NA NA NA NA [14,] NA NA NA NA NA NA [,7] [1,] -0.4947819 [2,] -0.4684447 [3,] -0.7477063 [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA [13,] NA [14,] NA [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.00769 0.01225 0.00174 0.33580 0.8573 0.00098 0.33580 [2,] 0.00319 0.01087 0.00178 0.47767 NA 0.00020 0.47767 [3,] 0.01387 0.00104 0.03282 NA NA 0.00585 0.00014 [4,] NA NA NA NA NA NA NA [5,] NA NA NA NA NA NA NA [6,] NA NA NA NA NA NA NA [7,] NA NA NA NA NA NA NA [8,] NA NA NA NA NA NA NA [9,] NA NA NA NA NA NA NA [10,] NA NA NA NA NA NA NA [11,] NA NA NA NA NA NA NA [12,] NA NA NA NA NA NA NA [13,] NA NA NA NA NA NA NA [14,] NA NA NA NA NA NA NA [[3]] [[3]][[1]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0.7004 0.2620 -0.2887 -0.4948 0.0271 -0.3224 -0.4948 s.e. 0.2614 0.1041 0.0916 0.5134 0.1508 0.0970 0.5134 sigma^2 estimated as 4.069: log likelihood = -835.62, aic = 1687.24 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0.7004 0.2620 -0.2887 -0.4948 0.0271 -0.3224 -0.4948 s.e. 0.2614 0.1041 0.0916 0.5134 0.1508 0.0970 0.5134 sigma^2 estimated as 4.069: log likelihood = -835.62, aic = 1687.24 [[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 ma1 sar1 sar2 sma1 0.6739 0.2621 -0.2864 -0.4684 0 -0.3294 -0.4684 s.e. 0.2271 0.1024 0.0910 0.6591 0 0.0876 0.6591 sigma^2 estimated as 4.07: log likelihood = -835.63, aic = 1685.27 [[3]][[4]] NULL [[3]][[5]] NULL [[3]][[6]] NULL [[3]][[7]] NULL $aic [1] 1687.238 1685.270 1684.118 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 > postscript(file="/var/www/html/rcomp/tmp/17ffm1229896707.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 = 395 Frequency = 1 [1] 0.122359934 0.931905596 -0.055775726 1.468985842 1.055123054 [6] 0.944996527 1.068459063 0.316141992 0.760539013 -2.202172787 [11] -0.131541222 -0.532225208 -1.741322456 0.204725666 -0.147865680 [16] 1.396025514 0.162345262 0.015666288 0.217673744 -0.917485781 [21] -0.903482714 0.370579584 -1.528186349 1.425442787 0.823775929 [26] 1.164161248 0.548322957 -0.145197036 0.144017288 -0.008729191 [31] -0.044489033 2.265084751 -2.300246922 -0.802974525 1.905081539 [36] 0.141274919 -0.274558080 -1.089390206 -0.106056039 0.153839731 [41] 1.378581169 0.984071326 -1.093840755 -2.335854693 0.019621557 [46] -0.773231734 0.531269082 -3.130461108 -1.063832193 1.864411469 [51] -1.765417043 -0.680077917 -0.465236069 2.087200592 -3.083702974 [56] -0.865873388 0.852274976 -2.170886096 -0.425425937 -6.885803333 [61] 0.797289131 2.743745263 -1.351254567 2.723775171 -0.265750755 [66] 0.628597530 1.685367043 -3.512412580 0.213872453 3.188286520 [71] 0.271502856 -0.398481712 -0.968285809 -0.812342066 1.714817302 [76] -2.910379943 -0.863810636 -0.211153272 -1.471741884 1.321517273 [81] 0.263207098 -3.586107810 3.524639579 2.073870189 -1.349714920 [86] 0.647566687 1.610374519 -0.205131167 3.117975634 1.983810868 [91] -0.574765128 2.005568966 1.261019545 -0.024940312 -0.237550537 [96] 0.211769365 -0.068298575 0.020922774 -0.049293556 -0.046741896 [101] -0.199106302 -1.867970285 -1.910721165 1.572337220 0.278962986 [106] -3.002325459 -0.429295243 -0.360255037 -1.544442043 2.074267330 [111] 2.268283376 0.470843049 0.612021235 0.088860143 -0.741153473 [116] -1.702438314 -0.701120741 0.848784970 -3.118554905 -0.340791575 [121] -2.084450086 -2.657138306 2.483969471 1.092183691 0.214914712 [126] -2.252555448 0.081925764 -1.090015923 0.091750871 -0.302970998 [131] 3.266721370 0.272180955 -1.509282258 3.118011256 0.709336378 [136] 0.797929140 0.024986737 -0.510022431 1.672039357 1.178117084 [141] -0.195061581 2.003888355 -1.991462993 -3.780993818 -2.943062048 [146] -2.755028959 -1.547871004 -1.464064146 -0.355533211 2.484193199 [151] 0.128415145 -0.645551321 0.493286866 2.155228978 0.842823904 [156] -3.609266348 -3.028955229 0.253121456 0.469935287 -2.414710740 [161] -0.332056729 0.021685149 -0.723476787 -4.492503053 1.736093193 [166] 0.568688187 -2.866460743 -7.457541373 -0.113158144 2.050206431 [171] 5.688885370 -2.789872356 1.853020511 0.587480939 1.425742419 [176] 0.245486421 2.215449852 0.306220314 -4.486786592 -1.245225093 [181] -2.081228318 -0.102783496 -0.231230469 -1.155246159 3.839470343 [186] 0.756141438 -0.334518553 1.501939916 -3.503250490 2.545823756 [191] -0.249883320 1.826896494 1.183287202 2.178453749 0.982881985 [196] 0.192963947 -4.748270309 -1.546277280 -0.957344448 2.771840184 [201] 0.988635391 0.046129962 0.058912641 -1.613051854 -2.827961953 [206] -0.409646068 -3.472100498 -2.673525090 3.739603237 0.940574309 [211] 2.715237703 1.590585661 -1.901195126 2.168243541 -3.291257961 [216] 2.431989507 1.379622969 1.660956700 0.803375241 0.635350965 [221] -1.935088158 -1.364117077 -1.288076747 2.763029923 -1.850949651 [226] -0.426026674 1.416557927 1.054518309 0.100735725 3.018210605 [231] -0.582956689 -0.465121334 -1.278449270 3.852169169 1.516126435 [236] 0.679012976 -1.187703544 1.025404593 0.921134111 0.473278620 [241] 1.218772205 -1.967712687 -0.284285454 -0.739335743 0.177296649 [246] 0.617737556 1.963704391 1.770795540 0.862954725 0.736632609 [251] -1.576707386 -0.757226076 0.459526189 -2.740545624 0.642872965 [256] -1.942390746 0.969546743 2.916260560 2.804886241 -1.177268053 [261] 1.442032870 -1.008278560 1.685049169 -3.575122896 -3.361699988 [266] 0.544584540 -3.812969288 -0.255479308 2.361074697 0.231398228 [271] 0.961587337 -2.766404865 -1.889328557 -1.722861957 -0.492311616 [276] -0.378296718 -0.661148805 -0.391162940 -0.147328237 -0.155177726 [281] -1.410345582 -1.656751963 -0.498315548 0.635940363 -2.533052392 [286] 0.066689344 0.010332959 0.100325649 -0.159212040 -1.118767758 [291] -0.360505710 -0.794670844 -1.826370124 0.020284677 2.059692363 [296] 1.014687146 3.219689747 -2.433588054 -2.372305349 -0.370562103 [301] 1.266050396 0.824590573 -1.853000435 -3.161641656 0.442928319 [306] -0.428942210 -1.310961721 1.014820062 -0.305111109 0.018050634 [311] -2.696505889 -1.107643021 1.141463952 0.159322694 -2.055277552 [316] 0.202726697 -0.367170684 -0.056145345 -0.897022304 -0.261083326 [321] -0.651847074 -0.339317082 3.954885709 -2.972658465 0.291576179 [326] 0.387897774 0.061920969 -4.019271224 2.799937552 -0.961853011 [331] -0.689421377 -0.528085968 0.088821992 -3.596177221 -1.464789543 [336] 0.759085864 -3.392064053 2.383755653 3.773197179 0.172713955 [341] -1.373663785 -0.554513572 -0.616706791 0.338243087 -4.969502210 [346] -1.459225866 -3.458393446 -0.708572169 -0.967101476 -2.764883774 [351] -6.358398381 -1.216800723 -7.378603167 6.326254252 2.244552581 [356] 1.064937853 -5.865035378 -2.548311712 1.936102797 -0.678053253 [361] -0.197816088 -2.763460078 -0.426953645 -6.333456209 2.598461871 [366] 0.687910739 5.047098077 -1.221071427 -1.439612118 8.787593236 [371] -2.386724706 0.539774154 0.369474608 -2.149167481 0.019333116 [376] 1.016869042 -5.485953366 0.506223805 -1.934615077 -0.521110903 [381] 0.055715779 -3.494649978 -0.275821333 2.610697245 -0.486156828 [386] -0.247611392 1.077842842 1.091541130 -3.133113798 -0.451611547 [391] 0.819605490 -0.476519148 -0.344001389 2.175325103 0.390570383 > postscript(file="/var/www/html/rcomp/tmp/2bbfz1229896707.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/3drkn1229896707.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/4ccok1229896707.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/5jpnm1229896707.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/6d6521229896707.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/79fk61229896707.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/8hnwc1229896707.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/9y2cm1229896707.tab") > > system("convert tmp/17ffm1229896707.ps tmp/17ffm1229896707.png") > system("convert tmp/2bbfz1229896707.ps tmp/2bbfz1229896707.png") > system("convert tmp/3drkn1229896707.ps tmp/3drkn1229896707.png") > system("convert tmp/4ccok1229896707.ps tmp/4ccok1229896707.png") > system("convert tmp/5jpnm1229896707.ps tmp/5jpnm1229896707.png") > system("convert tmp/6d6521229896707.ps tmp/6d6521229896707.png") > system("convert tmp/79fk61229896707.ps tmp/79fk61229896707.png") > > > proc.time() user system elapsed 7.185 2.630 7.568