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' > #'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] [1,] 0.1173194 -0.03230982 0.08051368 [2,] 0.1135480 0.00000000 0.07678443 [3,] 0.1131589 0.00000000 0.00000000 [4,] NA NA NA [5,] NA NA NA [6,] NA NA NA [[2]] [,1] [,2] [,3] [1,] 0.02746 0.54459 0.12870 [2,] 0.03170 NA 0.14482 [3,] 0.03282 NA NA [4,] NA NA NA [5,] NA NA NA [6,] NA NA NA [[3]] [[3]][[1]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 0.1173 -0.0323 0.0805 s.e. 0.0530 0.0533 0.0529 sigma^2 estimated as 28.78: log likelihood = -1109.37, aic = 2226.73 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 0.1173 -0.0323 0.0805 s.e. 0.0530 0.0533 0.0529 sigma^2 estimated as 28.78: log likelihood = -1109.37, aic = 2226.73 [[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 0.1135 0 0.0768 s.e. 0.0527 0 0.0525 sigma^2 estimated as 28.81: log likelihood = -1109.55, aic = 2225.1 $aic [1] 2226.731 2225.099 2225.227 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/1i5xs1260454948.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.727996e-02 -1.015526e-05 -1.894325e-01 -1.478668e-01 6.893032e-01 [6] 3.068512e+00 -3.723520e-01 -4.380391e-01 -9.460515e-01 -5.225354e-01 [11] -4.307898e-01 -4.722312e-01 -6.361682e-01 -1.241432e-01 -3.463102e-01 [16] -2.747215e-01 -2.976556e-01 -2.668733e-01 -2.522156e-01 -2.660222e-01 [21] -6.664224e-01 -1.002539e+00 -7.286228e-01 -6.040251e-01 -5.384728e-01 [26] -1.471811e+00 -9.147696e+00 4.207329e-01 1.493874e+00 4.464529e+00 [31] 1.462047e+00 1.680884e+00 3.255348e+00 9.287373e-01 9.468770e-01 [36] 3.255489e-01 -5.147314e-02 -1.104548e+00 -5.759436e-01 2.870018e+00 [41] -1.383053e+00 -1.022181e+00 -8.195066e-01 -7.084402e-01 -7.079364e-01 [46] -9.509863e-01 -9.363914e-01 2.987415e+00 -6.715683e-01 -8.532725e-01 [51] -9.218160e-01 -5.931055e-01 -6.222288e-01 -8.084693e-01 -7.857091e-01 [56] -8.422375e-01 -7.916034e-01 3.974222e+00 2.077205e+00 -9.906730e-01 [61] -1.361310e+00 -1.024870e+00 3.530801e+00 -3.524514e-01 -9.687062e-01 [66] -1.258770e+00 -7.682191e-01 -9.271831e-01 -7.179631e-01 6.134706e+00 [71] -2.251516e+00 -1.340101e+00 -1.525958e+00 -9.906028e-01 -1.194074e+00 [76] 1.951761e+00 -4.451478e-01 -1.238153e+00 -1.331934e+00 -1.318700e+00 [81] 2.877052e+00 3.292020e-01 -3.138683e-01 -1.617627e+00 -2.041478e-01 [86] -1.364119e+00 -6.655211e-01 1.020740e-01 -2.267918e-01 -5.392163e-01 [91] -1.513890e+00 1.696648e+00 4.207233e-01 -1.359229e+00 -7.131706e-01 [96] 8.148329e-01 -1.418398e+00 -1.518135e+00 1.568450e+00 -3.241804e+00 [101] -2.294177e+00 1.886997e+00 -1.965818e+00 -1.236404e+00 1.881763e+00 [106] -1.921553e+00 3.621333e+00 -5.321852e-01 5.735858e+00 8.733414e+00 [111] 1.358920e+01 -6.861099e-01 1.012311e-01 -2.280743e+00 -1.590176e+00 [116] -1.445108e+00 -1.544145e+00 -8.527585e-01 1.303003e+00 -1.771013e+00 [121] -1.296143e+00 -1.320082e+00 -1.231318e+00 -1.154184e+00 -1.176321e+00 [126] -1.007875e+00 -1.052186e+00 -8.999147e-01 -8.092324e-01 1.708678e+00 [131] 1.569883e+00 -1.097498e+00 1.180037e-01 1.779680e+00 -1.841996e+00 [136] 1.003818e+00 -9.005355e-01 -1.454525e+00 -1.354474e+00 -1.221271e+00 [141] -1.189029e+00 1.651692e+00 4.285009e+00 -1.808022e+00 1.271790e-01 [146] -3.370425e+00 -4.361478e-01 6.555683e+00 -2.190863e+00 1.080234e+00 [151] -1.119137e+00 -1.310054e+00 -1.442641e+00 -1.533048e-01 6.671894e-01 [156] -1.568894e+00 -1.536506e+00 -1.640451e+00 2.309545e+00 2.109548e+00 [161] -1.801594e+00 -1.570137e+00 -1.476113e+00 -1.201048e+00 6.583945e+00 [166] -1.419808e+00 -1.201714e+00 -1.812871e+00 -1.047850e+00 -8.963925e-01 [171] 1.484989e+00 3.617485e+00 -1.487284e+00 -1.123497e+00 -1.259315e+00 [176] -9.548918e-01 -1.278079e+00 2.025553e+00 -7.211422e-01 -1.085559e+00 [181] 8.297557e-03 -3.713162e+00 -1.335543e+00 -4.488007e-01 -2.863489e-01 [186] -4.433748e-01 -3.674381e+00 -2.868608e+00 -1.289364e-01 -2.046323e-01 [191] -2.191853e-01 -4.556848e-01 -3.934138e-01 -3.817624e-01 -3.724977e-01 [196] 2.701760e+00 7.049618e-02 -7.013822e-01 -6.209237e-01 6.341435e+00 [201] -1.212739e+00 -4.491564e-01 -7.020583e-01 -7.159751e-01 -3.380656e-01 [206] 6.924867e+00 1.893286e+01 -3.365130e+00 -1.233122e+00 -4.534336e-01 [211] -1.299168e+00 1.980984e+01 1.190075e+01 1.095902e+00 -2.071335e+00 [216] -5.139681e+00 -1.707131e+00 -6.555786e-01 -1.664526e+00 -3.925548e-01 [221] 3.187673e+00 -3.564339e+00 -1.516316e+00 -3.670103e+00 -7.948829e-01 [226] -2.932587e+00 7.700621e-01 9.247343e-03 -6.050231e+00 3.307274e+00 [231] -7.383143e-01 -2.404394e+00 8.841917e-01 -1.210608e+00 3.057462e+00 [236] 1.542583e+01 2.261466e-01 2.103534e+00 -1.459703e+00 -7.912736e+00 [241] -4.123132e+00 1.953309e+01 4.232957e+01 -1.456429e+01 2.418167e+01 [246] -6.093131e+00 -3.848281e+01 -4.116362e+00 -4.084971e+00 -2.167407e+00 [251] -3.805682e+00 8.305970e+00 -6.168742e-01 7.426599e+00 -1.642301e+01 [256] 3.406926e+00 -1.221979e+01 8.910403e-01 1.039273e+00 -4.601595e-01 [261] -8.159784e+00 -7.599422e-01 5.710664e+00 1.109959e+00 -1.216705e+00 [266] -3.188411e+00 1.417498e+00 -1.519174e+00 -1.238506e+00 1.552455e-01 [271] -5.863172e+00 -1.746960e+00 -3.915060e+00 9.053047e-01 9.039207e+00 [276] 1.154873e+01 -1.063639e+01 -4.718455e+00 7.288859e-01 -3.583511e+00 [281] -2.856720e-01 -5.343115e+00 6.122149e-01 -3.865363e+00 2.692468e-02 [286] 1.259951e+00 1.486925e+00 -1.604249e+00 -3.164941e+00 -6.071557e+00 [291] 1.046607e+00 3.425704e+00 4.033460e+00 -1.112010e+01 5.747118e-01 [296] 3.640566e-01 1.648122e+00 -5.932247e+00 3.607785e+00 -1.338615e+00 [301] 2.685556e+00 -1.941443e+00 5.408325e+00 2.319406e+00 -6.175719e+00 [306] -2.312500e+00 -6.851639e+00 -5.992837e-01 5.837800e+00 -8.598539e-02 [311] 3.501283e+00 -7.928461e+00 5.029597e+00 -2.117168e+00 -2.515831e+00 [316] 2.641594e+00 1.320738e+00 -3.354212e+00 4.169830e+00 -3.497866e+00 [321] 1.066066e+00 -1.568970e+00 1.192371e+00 1.359666e+00 6.303723e+00 [326] -5.081675e-01 2.253798e+00 -2.792400e+00 1.789003e+00 5.056311e+00 [331] -8.889558e+00 1.815890e+00 6.272551e+00 -1.274834e+00 8.265331e+00 [336] 8.175637e+00 -2.351654e-01 1.296217e+01 1.165723e+01 -9.093119e+00 [341] -3.084478e+00 -7.594124e+00 -8.460152e+00 1.275045e+00 -4.227214e+00 [346] 1.106374e+01 2.655243e+00 8.553296e-03 1.455187e+01 -1.143713e+01 [351] -4.986888e+00 6.813960e-01 -2.880310e+00 -6.131443e+00 1.943863e+00 [356] 6.255642e+00 -3.869326e+00 -1.093950e+00 1.187055e+01 > postscript(file="/var/www/html/rcomp/tmp/29igc1260454948.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/3bic81260454948.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/40qao1260454948.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/5s0ce1260454948.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/634eq1260454948.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/7w80v1260454948.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/8jdmh1260454948.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/99t2e1260454948.tab") > > system("convert tmp/1i5xs1260454948.ps tmp/1i5xs1260454948.png") > system("convert tmp/29igc1260454948.ps tmp/29igc1260454948.png") > system("convert tmp/3bic81260454948.ps tmp/3bic81260454948.png") > system("convert tmp/40qao1260454948.ps tmp/40qao1260454948.png") > system("convert tmp/5s0ce1260454948.ps tmp/5s0ce1260454948.png") > system("convert tmp/634eq1260454948.ps tmp/634eq1260454948.png") > system("convert tmp/7w80v1260454948.ps tmp/7w80v1260454948.png") > > > proc.time() user system elapsed 1.845 1.117 2.481