R version 2.13.0 (2011-04-13) Copyright (C) 2011 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.2 + ,203.2 + ,208.5 + ,191.8 + ,172.8 + ,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.3 + ,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 + ,465.8 + ,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 = '0.0' > 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.5254650 0.1557178 0.008566525 -0.4715006 0.009437048 0.002905629 [2,] 0.5253111 0.1555595 0.008980390 -0.4717079 0.006893715 0.000000000 [3,] 0.5270888 0.1548235 0.008976935 -0.4733669 0.000000000 0.000000000 [4,] 0.5461275 0.1556747 0.000000000 -0.4917559 0.000000000 0.000000000 [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.7167057 [2,] -0.7140177 [3,] -0.7098010 [4,] -0.7099733 [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.00191 0.17128 0.95197 0.00519 0.92668 0.96736 0 [2,] 0.02227 0.01291 0.90880 0.03492 0.93565 NA 0 [3,] 0.02107 0.01248 0.90871 0.03330 NA NA 0 [4,] 0.00028 0.01140 NA 0.00078 NA NA 0 [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.5255 0.1557 0.0086 -0.4715 0.0094 0.0029 -0.7167 s.e. 0.1680 0.1136 0.1421 0.1677 0.1025 0.0710 0.0957 sigma^2 estimated as 0.003632: log likelihood = 494.74, aic = -973.48 [[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.5255 0.1557 0.0086 -0.4715 0.0094 0.0029 -0.7167 s.e. 0.1680 0.1136 0.1421 0.1677 0.1025 0.0710 0.0957 sigma^2 estimated as 0.003632: log likelihood = 494.74, aic = -973.48 [[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.5253 0.1556 0.0090 -0.4717 0.0069 0 -0.7140 s.e. 0.2288 0.0623 0.0783 0.2228 0.0853 0 0.0683 sigma^2 estimated as 0.003632: log likelihood = 494.74, aic = -975.48 [[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.5271 0.1548 0.0090 -0.4734 0 0 -0.7098 s.e. 0.2275 0.0617 0.0782 0.2216 0 0 0.0443 sigma^2 estimated as 0.003633: log likelihood = 494.74, aic = -977.47 [[3]][[5]] NULL [[3]][[6]] NULL [[3]][[7]] NULL $aic [1] -973.4807 -975.4800 -977.4734 -979.4603 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 > postscript(file="/var/wessaorg/rcomp/tmp/1oqn11324458830.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] 3.152338e-03 1.547084e-03 9.628811e-04 6.341975e-04 3.446714e-04 [6] 4.511373e-04 3.874871e-04 2.689029e-04 1.609900e-04 -1.237585e-05 [11] 1.336220e-04 -2.859004e-03 -1.798936e-02 -2.290214e-02 2.804298e-02 [16] 5.357030e-02 1.971652e-01 -6.890968e-02 4.240980e-02 -4.055181e-02 [21] -1.995020e-02 1.640563e-01 -1.811183e-01 -6.008078e-02 -3.841207e-02 [26] -1.053667e-01 -3.562600e-02 -6.041940e-02 -3.325144e-02 -2.582668e-02 [31] -8.423642e-02 -1.083331e-01 7.113573e-02 -8.782176e-02 1.088795e-01 [36] -9.551003e-03 -1.576075e-01 -1.343252e-01 1.732304e-02 -3.380053e-02 [41] 1.305585e-02 8.726208e-02 -2.128287e-02 7.969672e-03 1.112955e-01 [46] 2.859477e-02 2.296545e-02 -1.627727e-01 1.951080e-02 -6.222639e-03 [51] -7.464096e-02 5.130298e-02 6.418447e-02 -1.421984e-02 2.275824e-02 [56] 5.558294e-02 -8.221538e-02 -6.839646e-02 -1.263082e-02 -1.214859e-02 [61] 1.225413e-01 -1.279572e-01 2.027064e-02 9.326620e-02 -7.440460e-02 [66] -2.903581e-02 -9.506753e-03 1.006268e-02 1.275767e-01 8.052274e-02 [71] 1.336285e-01 1.350251e-01 1.125569e-01 4.027497e-02 4.369201e-02 [76] -8.856785e-03 -7.512256e-03 -1.576916e-01 -1.321124e-02 7.863058e-02 [81] 9.822117e-03 -7.852481e-02 -7.759644e-02 -5.978295e-02 -7.312347e-02 [86] -4.043382e-02 1.346662e-02 6.442580e-02 -7.108953e-02 -1.756407e-02 [91] -6.527993e-02 7.316176e-02 -4.821352e-02 8.993699e-02 -3.360541e-03 [96] -1.014291e-03 -1.052491e-01 -9.840681e-03 8.423661e-02 -5.751411e-02 [101] 1.298662e-01 3.857641e-02 -6.006233e-02 -1.170824e-01 -4.357370e-02 [106] 2.120623e-02 1.232521e-01 6.541527e-03 -6.462843e-02 -6.159933e-02 [111] -3.489773e-02 3.017928e-02 7.845772e-02 7.280578e-02 -7.403122e-02 [116] -1.511124e-02 4.074025e-02 6.787657e-02 8.493781e-02 2.182246e-02 [121] 4.305812e-02 1.109921e-01 3.630243e-02 2.512308e-02 -3.739931e-02 [126] -6.991906e-02 1.933094e-02 1.725415e-02 -9.483963e-02 -1.527650e-02 [131] -1.467023e-01 5.748988e-02 -7.086999e-02 -2.008610e-02 -2.443246e-02 [136] -1.043363e-01 1.739110e-03 5.163221e-02 1.686461e-02 4.542426e-02 [141] 1.771836e-02 7.317678e-02 -1.572589e-02 -9.363054e-02 -5.948537e-02 [146] -7.497679e-02 1.432087e-01 -2.649423e-02 -2.194593e-02 9.896895e-02 [151] -2.706582e-02 4.231830e-02 -6.114673e-02 1.013999e-01 -9.346068e-03 [156] 7.998676e-02 -3.268104e-02 3.361280e-02 -3.382897e-02 -3.183256e-03 [161] 6.889835e-03 -1.641658e-02 -1.758840e-02 -2.367908e-02 -1.713983e-02 [166] -2.257189e-02 -9.116390e-02 -1.103807e-02 -3.272088e-02 -3.148782e-02 [171] 9.903577e-03 1.643157e-02 8.606254e-02 -7.121252e-02 -4.615123e-02 [176] 1.057960e-01 -1.969823e-02 -5.440628e-02 5.132318e-02 -2.937014e-02 [181] 2.974529e-02 4.738273e-02 -7.046437e-02 -2.857354e-03 2.517042e-02 [186] 2.704945e-02 -2.982724e-02 -3.704781e-02 1.245223e-02 1.911838e-02 [191] 2.380310e-02 -5.416416e-02 -9.786256e-03 -2.403793e-02 -9.220359e-04 [196] 2.021311e-02 -5.274238e-02 1.119877e-01 -1.105970e-01 3.229207e-02 [201] 1.142428e-02 1.133389e-02 -7.634059e-02 1.060458e-02 -2.474094e-02 [206] 5.442094e-02 -6.508594e-02 4.842541e-02 -3.352322e-02 7.607060e-02 [211] -5.658655e-02 -2.507546e-02 -1.692412e-02 -1.304849e-02 -1.827051e-02 [216] -4.752046e-02 -8.266670e-03 -5.044689e-02 4.492808e-02 1.661117e-02 [221] 7.947188e-02 7.023015e-02 -5.378699e-02 -2.844918e-02 -3.098036e-02 [226] 2.033070e-02 -3.310143e-02 2.973305e-02 9.492118e-03 1.698959e-03 [231] -1.635123e-02 -1.242386e-02 -4.672031e-02 1.954540e-01 2.748166e-02 [236] -5.877644e-02 6.494295e-02 3.863133e-02 -1.081617e-01 -9.055296e-02 [241] -3.293252e-02 8.240007e-02 -3.640074e-02 -6.666391e-02 -2.147531e-02 [246] 2.135310e-01 1.654187e-02 -9.890381e-02 3.465275e-04 -2.005343e-02 [251] -1.883620e-02 -4.824090e-02 2.792684e-02 4.913044e-03 2.072487e-02 [256] 3.844668e-02 -4.893150e-02 7.114390e-02 6.260047e-02 -1.867273e-02 [261] 8.443556e-02 -3.299033e-02 -1.081748e-01 -8.940158e-03 1.127138e-01 [266] 8.881558e-02 3.916418e-02 2.761608e-02 -5.595438e-03 -3.366142e-02 [271] 5.983640e-02 2.542074e-02 4.174668e-02 2.022471e-03 4.499507e-02 [276] 1.759658e-02 -5.263586e-02 -5.427081e-02 8.165770e-03 -2.728859e-03 [281] -7.109120e-04 -1.045598e-01 6.479725e-02 5.613002e-02 -2.153595e-02 [286] -4.233489e-02 2.048610e-02 -2.326047e-03 -2.981279e-02 -3.797527e-02 [291] 2.669901e-02 -4.219527e-03 -1.189050e-02 -7.254458e-02 3.069486e-02 [296] 3.108531e-02 -7.873393e-03 -9.916056e-03 -8.373878e-02 -9.116973e-03 [301] -2.517846e-02 2.701498e-02 -8.472886e-03 2.242326e-02 -2.161034e-02 [306] -3.190839e-02 6.630213e-03 4.801747e-03 2.797344e-02 -6.561206e-02 [311] 6.156120e-02 3.200354e-02 4.591362e-02 -1.079102e-02 -3.491110e-02 [316] -1.598436e-02 3.947862e-02 -5.772466e-03 3.558074e-02 -2.444132e-03 [321] 8.157438e-02 1.373420e-02 6.828980e-02 7.017488e-02 9.218571e-02 [326] -4.446338e-02 3.377594e-02 6.736716e-03 1.760309e-02 -1.651965e-01 [331] 2.449071e-03 2.983060e-02 -1.342437e-02 1.308697e-02 -5.459316e-02 [336] -9.581194e-03 -6.838122e-02 -2.813792e-02 -2.105175e-03 1.512305e-02 [341] -2.330722e-02 -1.963785e-02 4.994276e-02 4.568190e-02 -3.804592e-02 [346] 1.030783e-02 -1.436996e-03 -1.662122e-02 -7.291815e-02 2.770115e-02 [351] -8.067072e-03 -4.916574e-02 6.159636e-03 -9.547492e-03 -2.539528e-02 [356] 4.323251e-02 -2.356988e-02 5.892408e-03 -1.506100e-02 -7.398633e-02 [361] 4.674200e-03 -2.461812e-02 2.717064e-02 -1.767231e-02 2.708766e-02 [366] -5.479596e-02 6.745326e-02 -2.414088e-02 -1.284928e-03 -2.005015e-02 [371] -1.472770e-03 4.320289e-02 > postscript(file="/var/wessaorg/rcomp/tmp/2cima1324458830.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/wessaorg/rcomp/tmp/30bqy1324458830.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/wessaorg/rcomp/tmp/4rrag1324458830.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/wessaorg/rcomp/tmp/5lvah1324458830.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/wessaorg/rcomp/tmp/6l7qy1324458830.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/wessaorg/rcomp/tmp/7li971324458830.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/8wvqk1324458830.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/wessaorg/rcomp/tmp/9lemx1324458830.tab") > > try(system("convert tmp/1oqn11324458830.ps tmp/1oqn11324458830.png",intern=TRUE)) character(0) > try(system("convert tmp/2cima1324458830.ps tmp/2cima1324458830.png",intern=TRUE)) character(0) > try(system("convert tmp/30bqy1324458830.ps tmp/30bqy1324458830.png",intern=TRUE)) character(0) > try(system("convert tmp/4rrag1324458830.ps tmp/4rrag1324458830.png",intern=TRUE)) character(0) > try(system("convert tmp/5lvah1324458830.ps tmp/5lvah1324458830.png",intern=TRUE)) character(0) > try(system("convert tmp/6l7qy1324458830.ps tmp/6l7qy1324458830.png",intern=TRUE)) character(0) > try(system("convert tmp/7li971324458830.ps tmp/7li971324458830.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 22.259 1.844 24.118