R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(235.1 + ,280.7 + ,264.6 + ,240.7 + ,201.4 + ,240.8 + ,241.1 + ,223.8 + ,206.1 + ,174.7 + ,203.3 + ,220.5 + ,299.5 + ,347.4 + ,338.3 + ,327.7 + ,351.6 + ,396.6 + ,438.8 + ,395.6 + ,363.5 + ,378.8 + ,357 + ,369 + ,464.8 + ,479.1 + ,431.3 + ,366.5 + ,326.3 + ,355.1 + ,331.6 + ,261.3 + ,249 + ,205.5 + ,235.6 + ,240.9 + ,264.9 + ,253.8 + ,232.3 + ,193.8 + ,177 + ,213.2 + ,207.2 + ,180.6 + ,188.6 + ,175.4 + ,199 + ,179.6 + ,225.8 + ,234 + ,200.2 + ,183.6 + ,178.20 + ,203.20 + ,208.50 + ,191.80 + ,172.80 + ,148 + ,159.4 + ,154.5 + ,213.2 + ,196.4 + ,182.8 + ,176.4 + ,153.6 + ,173.2 + ,171 + ,151.2 + ,161.9 + ,157.2 + ,201.7 + ,236.4 + ,356.1 + ,398.3 + ,403.7 + ,384.6 + ,365.8 + ,368.1 + ,367.9 + ,347 + ,343.3 + ,292.9 + ,311.5 + ,300.9 + ,366.9 + ,356.9 + ,329.7 + ,316.2 + ,269 + ,289.30 + ,266.2 + ,253.6 + ,233.8 + ,228.4 + ,253.6 + ,260.1 + ,306.6 + ,309.2 + ,309.5 + ,271 + ,279.9 + ,317.9 + ,298.4 + ,246.7 + ,227.3 + ,209.1 + ,259.9 + ,266 + ,320.6 + ,308.5 + ,282.2 + ,262.7 + ,263.5 + ,313.1 + ,284.3 + ,252.6 + ,250.3 + ,246.5 + ,312.7 + ,333.2 + ,446.4 + ,511.6 + ,515.5 + ,506.4 + ,483.2 + ,522.3 + ,509.8 + ,460.7 + ,405.8 + ,375 + ,378.5 + ,406.8 + ,467.8 + ,469.8 + ,429.8 + ,355.8 + ,332.7 + ,378 + ,360.5 + ,334.7 + ,319.5 + ,323.1 + ,363.6 + ,352.1 + ,411.9 + ,388.6 + ,416.4 + ,360.7 + ,338 + ,417.2 + ,388.4 + ,371.1 + ,331.5 + ,353.7 + ,396.7 + ,447 + ,533.5 + ,565.4 + ,542.3 + ,488.7 + ,467.1 + ,531.3 + ,496.1 + ,444 + ,403.4 + ,386.3 + ,394.1 + ,404.1 + ,462.1 + ,448.1 + ,432.3 + ,386.3 + ,395.2 + ,421.9 + ,382.9 + ,384.2 + ,345.5 + ,323.4 + ,372.6 + ,376 + ,462.7 + ,487 + ,444.2 + ,399.3 + ,394.9 + ,455.4 + ,414 + ,375.5 + ,347 + ,339.4 + ,385.8 + ,378.8 + ,451.8 + ,446.1 + ,422.5 + ,383.1 + ,352.8 + ,445.3 + ,367.5 + ,355.1 + ,326.2 + ,319.8 + ,331.8 + ,340.9 + ,394.1 + ,417.2 + ,369.9 + ,349.2 + ,321.4 + ,405.7 + ,342.9 + ,316.5 + ,284.2 + ,270.9 + ,288.8 + ,278.8 + ,324.4 + ,310.9 + ,299 + ,273 + ,279.3 + ,359.2 + ,305 + ,282.1 + ,250.3 + ,246.5 + ,257.9 + ,266.5 + ,315.9 + ,318.4 + ,295.4 + ,266.4 + ,245.8 + ,362.8 + ,324.9 + ,294.2 + ,289.5 + ,295.2 + ,290.3 + ,272 + ,307.4 + ,328.7 + ,292.9 + ,249.1 + ,230.4 + ,361.5 + ,321.7 + ,277.2 + ,260.7 + ,251 + ,257.6 + ,241.8 + ,287.5 + ,292.3 + ,274.7 + ,254.2 + ,230 + ,339 + ,318.2 + ,287 + ,295.8 + ,284 + ,271 + ,262.7 + ,340.6 + ,379.4 + ,373.3 + ,355.2 + ,338.4 + ,466.9 + ,451 + ,422 + ,429.2 + ,425.9 + ,460.7 + ,463.6 + ,541.4 + ,544.2 + ,517.5 + ,469.4 + ,439.4 + ,549 + ,533 + ,506.1 + ,484 + ,457 + ,481.5 + ,469.5 + ,544.7 + ,541.2 + ,521.5 + ,469.7 + ,434.4 + ,542.6 + ,517.3 + ,485.7 + ,4658 + ,447 + ,426.6 + ,411.6 + ,467.5 + ,484.5 + ,451.2 + ,417.4 + ,379.9 + ,484.7 + ,455 + ,420.8 + ,416.5 + ,376.3 + ,405.6 + ,405.8 + ,500.8 + ,514 + ,475.5 + ,430.1 + ,414.4 + ,538 + ,526 + ,488.5 + ,520.2 + ,504.4 + ,568.5 + ,610.6 + ,818 + ,830.9 + ,835.9 + ,782 + ,762.3 + ,856.9 + ,820.9 + ,769.6 + ,752.2 + ,724.4 + ,723.1 + ,719.5 + ,817.4 + ,803.3 + ,752.5 + ,689 + ,630.4 + ,765.5 + ,757.7 + ,732.2 + ,702.6 + ,683.3 + ,709.5 + ,702.2 + ,784.8 + ,810.9 + ,755.6 + ,656.8 + ,615.1 + ,745.3 + ,694.1 + ,675.7 + ,643.7 + ,622.1 + ,634.6 + ,588 + ,689.7 + ,673.9 + ,647.9 + ,568.8 + ,545.7 + ,632.6 + ,643.8 + ,593.1 + ,579.7 + ,546 + ,562.9 + ,572.5) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '1' > 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 > 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.05606000 0.04215090 0.03460094 -0.9261054 -0.003889911 -0.01651383 [2,] 0.05660966 0.04261673 0.03503066 -0.9266039 0.000000000 -0.01556384 [3,] 0.05747498 0.04319877 0.03554935 -0.9270246 0.000000000 0.00000000 [4,] 0.04901761 0.03602464 0.00000000 -0.9169775 0.000000000 0.00000000 [5,] 0.03944204 0.00000000 0.00000000 -0.9059607 0.000000000 0.00000000 [6,] 0.00000000 0.00000000 0.00000000 -1.1185405 0.000000000 0.00000000 [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.9692972 [2,] -0.9714570 [3,] -0.9795662 [4,] -1.0196315 [5,] -1.0183531 [6,] -0.9817092 [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.36992 0.48682 0.56003 0 0.94843 0.77445 0 [2,] 0.36059 0.47867 0.55230 0 NA 0.78066 0 [3,] 0.35356 0.47312 0.54681 0 NA NA 0 [4,] 0.43247 0.55266 NA 0 NA NA 0 [5,] 0.52548 NA NA 0 NA NA 0 [6,] NA NA NA 0 NA NA 0 [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.0561 0.0422 0.0346 -0.9261 -0.0039 -0.0165 -0.9693 s.e. 0.0624 0.0606 0.0593 0.0346 0.0601 0.0576 0.0739 sigma^2 estimated as 55474: log likelihood = -2487.66, aic = 4991.32 [[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.0561 0.0422 0.0346 -0.9261 -0.0039 -0.0165 -0.9693 s.e. 0.0624 0.0606 0.0593 0.0346 0.0601 0.0576 0.0739 sigma^2 estimated as 55474: log likelihood = -2487.66, aic = 4991.32 [[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.0566 0.0426 0.0350 -0.9266 0 -0.0156 -0.9715 s.e. 0.0618 0.0601 0.0589 0.0336 0 0.0559 0.0711 sigma^2 estimated as 55404: log likelihood = -2487.66, aic = 4989.32 [[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 ma1 sar1 sar2 sma1 0.0575 0.0432 0.0355 -0.9270 0 0 -0.9796 s.e. 0.0619 0.0602 0.0589 0.0338 0 0 0.0904 sigma^2 estimated as 55125: log likelihood = -2487.7, aic = 4987.4 [[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 ma1 sar1 sar2 sma1 0.0490 0.0360 0 -0.9170 0 0 -1.0196 s.e. 0.0624 0.0606 0 0.0344 0 0 0.0984 sigma^2 estimated as 53053: log likelihood = -2487.88, aic = 4985.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 ma1 sar1 sar2 sma1 0.0394 0 0 -0.9060 0 0 -1.0184 s.e. 0.0621 0 0 0.0334 0 0 0.1050 sigma^2 estimated as 53210: log likelihood = -2488.05, aic = 4984.11 [[3]][[7]] NULL $aic [1] 4991.315 4989.320 4987.397 4985.759 4984.109 4982.510 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 > postscript(file="/var/www/rcomp/tmp/1vatz1324212003.ps",horizontal=F,onefile=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 = 372 Frequency = 1 [1] 1.357350e-01 9.602412e-02 4.925557e-02 1.563514e-02 -2.307563e-02 [6] 1.704262e-02 1.487371e-02 -3.243827e-03 -1.962472e-02 -4.752439e-02 [11] -1.586637e-02 -1.285177e-01 -5.358405e-01 1.215495e+00 4.878324e+00 [16] 1.173212e+01 5.006372e+01 4.242646e+01 6.339085e+01 3.501728e+01 [21] 2.098527e+01 5.080968e+01 8.474598e+00 4.429905e+00 -5.750796e+00 [26] -2.904316e+01 -5.023060e+01 -7.851221e+01 -9.145102e+01 -8.893805e+01 [31] -1.130910e+02 -1.302902e+02 -1.041219e+02 -1.215398e+02 -8.594606e+01 [36] -8.478253e+01 -1.174333e+02 -1.383913e+02 -1.163016e+02 -1.066029e+02 [41] -9.242324e+01 -8.334845e+01 -8.468823e+01 -6.076170e+01 -3.051127e+01 [46] -2.265983e+01 -1.091618e+01 -3.598934e+01 -3.237898e+01 -4.239553e+01 [51] -4.592826e+01 -2.481612e+01 -1.159581e+01 -2.170782e+01 -1.723355e+01 [56] 4.438363e+00 -1.639844e+00 -7.119712e+00 -9.469919e+00 -1.553433e+01 [61] -2.035826e+00 -3.615040e+01 -2.012057e+01 3.571880e+00 -4.187180e+00 [66] -1.727494e+01 -2.029376e+01 -4.540976e+00 1.821973e+01 2.893728e+01 [71] 5.283972e+01 7.666255e+01 1.340669e+02 1.425867e+02 1.535413e+02 [76] 1.440489e+02 1.275760e+02 8.761027e+01 7.750210e+01 8.052761e+01 [81] 7.846685e+01 4.012998e+01 3.675850e+01 1.699606e+01 1.940339e+01 [86] -9.108440e+00 -1.428648e+01 -1.330706e+00 -2.951810e+01 -3.268302e+01 [91] -5.271203e+01 -2.999361e+01 -3.738548e+01 -1.822318e+01 -1.161307e+01 [96] -8.948290e+00 -2.261017e+01 -3.134156e+01 -8.463529e+00 -2.177478e+01 [101] 8.603963e+00 1.689914e+01 -2.455029e+00 -2.328186e+01 -2.829628e+01 [106] -2.382424e+01 7.100427e+00 6.489050e+00 8.034676e-01 -2.319170e+01 [111] -2.764452e+01 -1.879314e+01 -2.240229e-02 1.932468e+01 -7.530892e+00 [116] -6.511286e+00 2.960505e+00 1.716178e+01 5.508170e+01 6.288245e+01 [121] 1.072824e+02 1.458900e+02 1.513101e+02 1.510106e+02 1.288329e+02 [126] 1.249927e+02 1.062588e+02 7.940327e+01 3.086917e+01 1.750290e+01 [131] -6.605783e+00 1.543818e+01 8.697378e+00 -5.229030e+00 -2.612606e+01 [136] -7.045090e+01 -6.822374e+01 -4.813177e+01 -5.475234e+01 -4.256774e+01 [141] -3.916453e+01 -1.385808e+01 7.670720e-01 -1.886763e+01 -2.110689e+01 [146] -5.511017e+01 -4.093691e+00 -3.187341e+01 -3.327971e+01 1.459398e+01 [151] -9.093971e+00 6.698190e+00 -1.803986e+01 2.211816e+01 3.394312e+01 [156] 7.146406e+01 8.432034e+01 9.450809e+01 7.715242e+01 4.766864e+01 [161] 3.999811e+01 6.319213e+01 3.104401e+01 8.955336e+00 -1.382109e+01 [166] -1.441967e+01 -3.229945e+01 -2.872924e+01 -3.380672e+01 -5.635481e+01 [171] -5.000680e+01 -5.883109e+01 -2.728686e+01 -3.662102e+01 -5.969325e+01 [176] -2.064021e+01 -3.927318e+01 -4.219027e+01 -1.630973e+01 -2.215087e+01 [181] 6.702481e-01 1.212182e+01 -1.543935e+01 -2.458269e+01 -1.079474e+01 [186] 1.199013e+01 -1.750582e+01 -2.270627e+01 -2.850356e+01 -1.848741e+01 [191] 4.771187e-01 -1.631909e+01 -8.097030e+00 -2.480592e+01 -2.764384e+01 [196] -3.041734e+01 -4.186926e+01 1.420711e+01 -4.989718e+01 -2.517067e+01 [201] -3.161462e+01 -2.059501e+01 -3.558803e+01 -3.117172e+01 -4.148783e+01 [206] -2.555110e+01 -5.189966e+01 -3.317563e+01 -4.182954e+01 3.187722e+00 [211] -4.143741e+01 -3.272726e+01 -4.067936e+01 -3.578878e+01 -4.241491e+01 [216] -5.601412e+01 -6.973094e+01 -8.674997e+01 -7.020299e+01 -5.697237e+01 [221] -2.966910e+01 6.366014e+00 -2.762750e+01 -1.744495e+01 -2.587258e+01 [226] -1.330366e+01 -2.811269e+01 -2.390545e+01 -3.654747e+01 -4.018491e+01 [231] -3.981423e+01 -3.228554e+01 -3.431949e+01 3.719499e+01 1.638425e+01 [236] 1.386723e+01 2.946539e+01 4.441434e+01 8.937732e+00 -1.576049e+01 [241] -4.089437e+01 -2.507592e+01 -3.904047e+01 -4.558399e+01 -4.370594e+01 [246] 3.876578e+01 1.631599e+01 5.986276e-01 5.715508e+00 7.574841e+00 [251] -1.114502e+01 -3.076228e+01 -4.328647e+01 -4.417014e+01 -3.731019e+01 [256] -2.168819e+01 -2.815616e+01 2.787278e+01 2.658065e+01 2.272245e+01 [261] 4.945956e+01 4.408684e+01 3.933834e+00 -8.098251e+00 8.830430e+00 [266] 3.491473e+01 4.400094e+01 5.325936e+01 4.718522e+01 1.122028e+02 [271] 1.068973e+02 9.747707e+01 1.141904e+02 1.110447e+02 1.122138e+02 [276] 9.954221e+01 1.048924e+02 8.581811e+01 7.096054e+01 4.879939e+01 [281] 3.155426e+01 7.711937e+01 7.551104e+01 7.105847e+01 6.063164e+01 [286] 4.034730e+01 3.857678e+01 1.888815e+01 2.913067e+01 1.162131e+01 [291] 1.109505e+01 -8.598254e+00 -2.487735e+01 2.275064e+01 1.705846e+01 [296] 1.379642e+01 4.075874e+03 -5.389282e+02 -3.697897e+02 -3.515638e+02 [301] -3.263042e+02 -2.889353e+02 -2.750840e+02 -2.490104e+02 -2.447277e+02 [306] -1.814877e+02 -1.719281e+02 -1.596758e+02 -3.037173e+02 -1.223770e+02 [311] -1.087987e+02 -1.015880e+02 -6.185595e+01 -5.495318e+01 -6.755685e+01 [316] -7.213424e+01 -6.214548e+01 -3.219163e-01 8.940185e+00 4.353514e-01 [321] -1.171642e+02 6.274682e+01 9.167462e+01 1.194947e+02 2.448628e+02 [326] 2.181503e+02 2.227418e+02 1.812902e+02 1.637048e+02 1.740330e+02 [331] 1.443050e+02 1.108664e+02 -5.969816e+01 9.840687e+01 5.953051e+01 [336] 4.704746e+01 6.908567e+01 3.707745e+01 4.593767e+00 -2.270043e+01 [341] -5.848653e+01 1.265930e+01 2.449931e+01 2.709695e+01 -1.423433e+02 [346] 2.647332e+01 2.190162e+01 8.571888e+00 1.853526e+01 3.192544e+01 [351] -4.920010e+00 -6.448650e+01 -7.714306e+01 -1.207901e+01 -4.041690e+01 [356] -2.331767e+01 -1.844556e+02 -1.956202e+01 -3.296277e+01 -7.841319e+01 [361] -4.051819e+01 -6.360399e+01 -6.010524e+01 -9.426826e+01 -8.610260e+01 [366] -6.512359e+01 -2.502028e+01 -4.367727e+01 -1.776902e+02 -3.122414e+01 [371] -3.823341e+01 -2.691528e+01 > postscript(file="/var/www/rcomp/tmp/238hh1324212003.ps",horizontal=F,onefile=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/rcomp/tmp/31qkx1324212003.ps",horizontal=F,onefile=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/rcomp/tmp/469pg1324212003.ps",horizontal=F,onefile=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/rcomp/tmp/5hbds1324212003.ps",horizontal=F,onefile=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/rcomp/tmp/66kax1324212003.ps",horizontal=F,onefile=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/rcomp/tmp/7s1941324212003.ps",horizontal=F,onefile=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/8whos1324212003.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/rcomp/tmp/9shsw1324212003.tab") > > try(system("convert tmp/1vatz1324212003.ps tmp/1vatz1324212003.png",intern=TRUE)) character(0) > try(system("convert tmp/238hh1324212003.ps tmp/238hh1324212003.png",intern=TRUE)) character(0) > try(system("convert tmp/31qkx1324212003.ps tmp/31qkx1324212003.png",intern=TRUE)) character(0) > try(system("convert tmp/469pg1324212003.ps tmp/469pg1324212003.png",intern=TRUE)) character(0) > try(system("convert tmp/5hbds1324212003.ps tmp/5hbds1324212003.png",intern=TRUE)) character(0) > try(system("convert tmp/66kax1324212003.ps tmp/66kax1324212003.png",intern=TRUE)) character(0) > try(system("convert tmp/7s1941324212003.ps tmp/7s1941324212003.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 16.180 0.530 16.729