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(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.7004133 0.2619668 -0.2887448 -0.4947815 0.02714129 -0.3224244 [2,] 0.6739290 0.2620526 -0.2863944 -0.4684455 0.00000000 -0.3294364 [3,] 0.4894999 0.3602468 -0.1707412 0.0000000 0.00000000 -0.2617398 [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.4947815 [2,] -0.4684455 [3,] -0.7475658 [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.00768 0.01225 0.00174 0.33578 0.85729 0.00098 0.33578 [2,] 0.00319 0.01087 0.00178 0.47768 NA 0.00020 0.47768 [3,] 0.01400 0.00105 0.03294 NA NA 0.00589 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/1fuin1261057213.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.931905548 -0.055775589 1.468985837 1.055123159 [6] 0.944996502 1.068458953 0.316141818 0.760538937 -2.202172580 [11] -0.131541265 -0.532224765 -1.741321669 0.204726282 -0.147865278 [16] 1.396025769 0.162345476 0.015665853 0.217672981 -0.917486426 [21] -0.903483082 0.370579440 -1.528186024 1.425442977 0.823776349 [26] 1.164161480 0.548322968 -0.145197568 0.144016721 -0.008729414 [31] -0.044488825 2.265085141 -2.300246150 -0.802974595 1.905081291 [36] 0.141275448 -0.274557318 -1.089390275 -0.106056668 0.153839662 [41] 1.378581549 0.984071836 -1.093840675 -2.335855288 0.019620673 [46] -0.773231639 0.531269746 -3.130460456 -1.063832741 1.864410977 [51] -1.765416679 -0.680077954 -0.465236897 2.087199736 -3.083702810 [56] -0.865874128 0.852274105 -2.170886194 -0.425425840 -6.885803565 [61] 0.797287754 2.743745431 -1.351253289 2.723775248 -0.265752017 [66] 0.628595851 1.685366026 -3.512413068 0.213871684 3.188286472 [71] 0.271504185 -0.398480607 -0.968286123 -0.812342823 1.714817333 [76] -2.910379004 -0.863810554 -0.211153485 -1.471741777 1.321517564 [81] 0.263207300 -3.586108009 3.524638387 2.073869999 -1.349714486 [86] 0.647566188 1.610373405 -0.205131216 3.117976023 1.983811507 [91] -0.574764692 2.005568836 1.261019639 -0.024939629 -0.237549844 [96] 0.211769735 -0.068297898 0.020923687 -0.049292778 -0.046741439 [101] -0.199106019 -1.867970158 -1.910721422 1.572336912 0.278963542 [106] -3.002324916 -0.429296011 -0.360255949 -1.544442160 2.074267337 [111] 2.268283466 0.470843123 0.612020641 0.088859022 -0.741154231 [116] -1.702438454 -0.701120629 0.848785545 -3.118553809 -0.340791363 [121] -2.084450156 -2.657138582 2.483969208 1.092183998 0.214914883 [126] -2.252556302 0.081923776 -1.090016937 0.091750747 -0.302970612 [131] 3.266721419 0.272181497 -1.509282405 3.118010252 0.709336134 [136] 0.797929557 0.024987012 -0.510022678 1.672039447 1.178117940 [141] -0.195060587 2.003888686 -1.991462706 -3.780993951 -2.943062510 [146] -2.755028972 -1.547870074 -1.464063034 -0.355532874 2.484192802 [151] 0.128414605 -0.645552653 0.493284806 2.155227331 0.842823637 [156] -3.609266334 -3.028956220 0.253120657 0.469936281 -2.414708957 [161] -0.332056481 0.021684517 -0.723477195 -4.492503369 1.736091775 [166] 0.568687819 -2.866460430 -7.457541952 -0.113160554 2.050205993 [171] 5.688886915 -2.789870757 1.853018343 0.587478284 1.425740928 [176] 0.245486658 2.215449812 0.306220770 -4.486786168 -1.245225426 [181] -2.081228135 -0.102782372 -0.231228849 -1.155245505 3.839469939 [186] 0.756141264 -0.334519186 1.501938513 -3.503251683 2.545822843 [191] -0.249882715 1.826897295 1.183288155 2.178453894 0.982882224 [196] 0.192963833 -4.748270493 -1.546278111 -0.957344137 2.771841656 [201] 0.988637626 0.046130644 0.058911763 -1.613053267 -2.827962948 [206] -0.409646709 -3.472100215 -2.673524820 3.739603344 0.940575248 [211] 2.715238152 1.590584938 -1.901196912 2.168241623 -3.291258516 [216] 2.431989331 1.379624088 1.660957909 0.803376279 0.635350876 [221] -1.935088352 -1.364117462 -1.288076636 2.763030557 -1.850948021 [226] -0.426026229 1.416557529 1.054518042 0.100735979 3.018210260 [231] -0.582956862 -0.465121784 -1.278449674 3.852168919 1.516127833 [236] 0.679014194 -1.187703382 1.025403734 0.921134292 0.473279558 [241] 1.218773055 -1.967712268 -0.284285615 -0.739335622 0.177297096 [246] 0.617738343 1.963704879 1.770795897 0.862954668 0.736632082 [251] -1.576708010 -0.757226618 0.459526319 -2.740544672 0.642873603 [256] -1.942390074 0.969546937 2.916260999 2.804886635 -1.177267984 [261] 1.442031421 -1.008279712 1.685048733 -3.575122053 -3.361699910 [266] 0.544584549 -3.812968258 -0.255478375 2.361075150 0.231398527 [271] 0.961587017 -2.766406177 -1.889330686 -1.722863291 -0.492311851 [276] -0.378296018 -0.661148328 -0.391163065 -0.147328808 -0.155178326 [281] -1.410346167 -1.656752775 -0.498316342 0.635940123 -2.533052084 [286] 0.066688919 0.010332456 0.100325395 -0.159212102 -1.118768301 [291] -0.360506506 -0.794671339 -1.826370310 0.020284413 2.059692348 [296] 1.014687650 3.219689867 -2.433588329 -2.372306799 -0.370563410 [301] 1.266050442 0.824592148 -1.852999286 -3.161642025 0.442927211 [306] -0.428942112 -1.310961025 1.014820082 -0.305111502 0.018050147 [311] -2.696506438 -1.107644170 1.141463332 0.159323081 -2.055277082 [316] 0.202725995 -0.367171400 -0.056145558 -0.897022272 -0.261083776 [321] -0.651847454 -0.339317343 3.954885606 -2.972657905 0.291575514 [326] 0.387896939 0.061920658 -4.019270705 2.799936975 -0.961852566 [331] -0.689420887 -0.528085855 0.088821319 -3.596177355 -1.464790191 [336] 0.759085451 -3.392063692 2.383755557 3.773197159 0.172714160 [341] -1.373664483 -0.554515625 -0.616708159 0.338243237 -4.969501265 [346] -1.459226067 -3.458393406 -0.708571911 -0.967100647 -2.764883729 [351] -6.358399349 -1.216802997 -7.378604269 6.326253049 2.244553469 [356] 1.064937768 -5.865037234 -2.548316402 1.936100071 -0.678052689 [361] -0.197814711 -2.763460164 -0.426954939 -6.333456722 2.598460922 [366] 0.687911291 5.047098676 -1.221070779 -1.439614033 8.787590818 [371] -2.386724461 0.539774275 0.369474032 -2.149167875 0.019334090 [376] 1.016870414 -5.485951805 0.506223899 -1.934614759 -0.521110536 [381] 0.055716282 -3.494650335 -0.275822553 2.610696262 -0.486156759 [386] -0.247611741 1.077841547 1.091540085 -3.133113963 -0.451612277 [391] 0.819605096 -0.476518511 -0.344000554 2.175325119 0.390570472 > postscript(file="/var/www/html/rcomp/tmp/2yq021261057213.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/3e5n51261057213.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/49cb01261057213.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/53ndp1261057213.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/6es231261057213.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/7jomw1261057213.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/8tkm81261057213.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/9zina1261057213.tab") > > try(system("convert tmp/1fuin1261057213.ps tmp/1fuin1261057213.png",intern=TRUE)) character(0) > try(system("convert tmp/2yq021261057213.ps tmp/2yq021261057213.png",intern=TRUE)) character(0) > try(system("convert tmp/3e5n51261057213.ps tmp/3e5n51261057213.png",intern=TRUE)) character(0) > try(system("convert tmp/49cb01261057213.ps tmp/49cb01261057213.png",intern=TRUE)) character(0) > try(system("convert tmp/53ndp1261057213.ps tmp/53ndp1261057213.png",intern=TRUE)) character(0) > try(system("convert tmp/6es231261057213.ps tmp/6es231261057213.png",intern=TRUE)) character(0) > try(system("convert tmp/7jomw1261057213.ps tmp/7jomw1261057213.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.011 1.137 4.601