R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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 = '0' > par3 = '0' > par2 = '1' > par1 = 'FALSE' > par9 <- '1' > par8 <- '2' > par7 <- '1' > par6 <- '3' > par5 <- '12' > par4 <- '0' > par3 <- '0' > 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] [,7] [1,] 1.568210 -0.4412374 -0.1455925 -0.4771258 0.9180613 0.06996961 -0.6278074 [2,] 1.554866 -0.4216942 -0.1524831 -0.4659932 0.9896599 0.00000000 -0.6672308 [3,] 1.214045 0.0000000 -0.2420712 -0.1105535 0.9898346 0.00000000 -0.6744499 [4,] 1.169845 0.0000000 -0.1996883 0.0000000 0.9895132 0.00000000 -0.6803735 [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 [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0 0.01725 0.02985 0.00033 0 0.3711 0 [2,] 0 0.12654 0.06607 0.02682 0 NA 0 [3,] 0 NA 0.00000 0.14338 0 NA 0 [4,] 0 NA 0.00000 NA 0 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 1.5682 -0.4412 -0.1456 -0.4771 0.9181 0.0700 -0.6278 s.e. 0.1295 0.1844 0.0668 0.1317 0.0803 0.0781 0.0709 sigma^2 estimated as 433.1: log likelihood = -1672.88, aic = 3361.76 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 1.5682 -0.4412 -0.1456 -0.4771 0.9181 0.0700 -0.6278 s.e. 0.1295 0.1844 0.0668 0.1317 0.0803 0.0781 0.0709 sigma^2 estimated as 433.1: log likelihood = -1672.88, aic = 3361.76 [[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 1.5549 -0.4217 -0.1525 -0.4660 0.9897 0 -0.6672 s.e. 0.2066 0.2754 0.0827 0.2096 0.0046 0 0.0426 sigma^2 estimated as 434.1: log likelihood = -1673.27, aic = 3360.53 [[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 1.2140 0 -0.2421 -0.1106 0.9898 0 -0.6744 s.e. 0.0421 0 0.0415 0.0754 0.0045 0 0.0417 sigma^2 estimated as 435.4: log likelihood = -1673.86, aic = 3359.72 [[3]][[5]] NULL [[3]][[6]] NULL [[3]][[7]] NULL $aic [1] 3361.762 3360.531 3359.724 3360.069 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 log(s2) : NaNs produced 4: 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/1cb4h1355302754.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] 10.97143707 19.95688341 -6.38327154 -11.85319983 -13.25492027 [6] 21.18251626 4.29030859 -9.61135896 -7.46579700 -13.98567317 [11] 11.36906211 4.62302299 33.62501726 6.41287779 2.22325359 [16] 10.39545338 52.69323533 7.76384070 30.37293100 -22.22116311 [21] -11.44316912 52.66095675 -29.81842477 1.98967366 41.89903323 [26] -21.29380159 -28.32880629 -28.66960229 -12.37005134 11.65253684 [31] -26.99213426 -27.26781102 28.26641506 -24.46006709 30.52659080 [36] -1.87535027 -59.46090428 -34.13302592 21.09171238 5.64170553 [41] 0.26166936 -0.21095114 -12.10484867 16.13782600 24.36878358 [46] -1.97324316 1.57133547 -34.31486599 -13.14868959 -1.25043425 [51] -6.90141498 20.23917411 10.73085455 -17.44954267 1.00513735 [56] 21.01505902 -14.29723030 -12.59548399 -3.65445700 -4.18093431 [61] 5.02765928 -30.96101790 13.76424751 26.23890194 -16.19175000 [66] -18.15364490 -2.82479041 12.32477049 21.16945433 8.19932008 [71] 20.89187769 27.60649912 52.89614833 23.17498666 9.59784015 [76] -7.60934483 -5.41937623 -20.41410183 7.95207796 17.32136991 [81] 6.34350889 -32.07771014 2.83764535 -7.22109851 -0.89123474 [86] -16.21124322 -5.41131646 17.40037578 -24.96553198 4.91942044 [91] -15.02290179 15.90105797 -10.33212107 20.23391652 4.73022081 [96] -1.50642018 -25.85259768 -2.35791033 24.80315780 -20.34694457 [101] 33.55486203 19.78816404 -21.83724843 -33.96604783 -3.14390165 [106] 10.52611668 31.27314320 -1.14092211 -14.78895018 -17.48464663 [111] -10.08676471 11.23947990 19.14544592 21.99229591 -24.26450679 [116] -5.38981187 14.53831000 15.05520447 31.44916247 9.09784153 [121] 44.87438082 57.24516989 3.54482554 -0.38216670 -14.76888874 [126] 11.34531377 13.44124094 -13.11171183 -37.54239603 -0.66088672 [131] -19.05690403 33.18487076 -2.56361618 -16.41417446 -21.08145228 [136] -44.34306309 7.30298394 27.84085153 0.70954957 8.63888544 [141] 8.07752059 20.03484834 7.37371195 -32.42203752 -9.18527594 [146] -28.90172855 55.32105730 -15.11748805 -13.59733500 47.04395987 [151] -15.02510336 7.69534333 -16.99996645 34.04329911 12.53659509 [156] 36.46752028 14.68605338 19.76249302 -23.81633325 -12.82434347 [161] 6.98011560 22.45161184 -11.30906792 -21.73004191 -3.60825331 [166] -4.32972786 -18.51178233 -0.26086741 -3.49206975 -19.25927846 [171] 1.99194865 6.79565133 30.54665809 -29.76824729 -18.07525734 [176] 43.95431521 -7.80810925 -23.35434194 25.97452003 -11.70119877 [181] 16.51986660 21.88635653 -37.07056461 -1.23649757 13.64528162 [186] 16.37393264 -14.94839139 -17.03679764 9.55340011 7.56024030 [191] 12.50675680 -21.23409464 0.09956824 -10.77396622 0.23755344 [196] 9.17822205 -21.73840721 44.22981571 -45.00186378 10.19047453 [201] 10.37564319 0.11602032 -26.60147729 4.37186152 -13.54550711 [206] 19.21545986 -23.87913517 19.31579045 -10.49396260 17.29187565 [211] -17.28480283 -8.07553678 0.65068249 -4.35902691 -11.10911198 [216] -16.18588697 -16.81025478 -19.78494079 22.84526407 10.29155022 [221] 17.28212108 2.87184234 -13.18415731 -4.41778535 -2.85926628 [226] 4.36726228 -15.91790866 5.12904600 -8.51402511 -2.82482126 [231] 0.77671569 0.91993929 -12.44642879 43.61161595 8.98625352 [236] -21.38107140 21.36556918 11.61468721 -33.29861009 -23.23876342 [241] -11.55333688 25.88754259 -10.34763263 -17.06411298 -2.25882781 [246] 48.26471142 1.81610737 -32.14683637 4.17920604 -3.08013753 [251] -6.78739439 -11.51859556 -0.77378302 -1.65846384 9.17831619 [256] 12.32963102 -14.21430247 6.28116095 22.79291152 -5.93005633 [261] 22.43448172 -10.24323970 -29.56861773 2.51736623 36.88619102 [266] 28.95215528 7.21083850 2.47909660 -3.44601853 26.36456248 [271] 19.46839062 -3.97487388 15.89773279 5.28917535 31.46878362 [276] 10.32344626 17.99897456 -13.97276191 -6.32366629 -11.98017030 [281] -1.59404920 13.73901079 22.35153230 6.89271948 -15.34257740 [286] -14.75169415 23.06579480 1.16284746 15.99395135 -10.98493373 [291] 4.31807333 -11.17118759 -7.49443691 10.62660558 7.16577318 [296] 0.87262271 -5.72291518 -1.15888492 -30.66919871 0.04054474 [301] 2.24480768 15.34544933 -10.27421809 5.04630821 -8.44376404 [306] -0.52175242 -0.96620599 -2.88832569 11.30747252 -24.96512576 [311] 25.77932776 12.99046495 26.94677569 -2.64440339 -21.66418343 [316] -7.14073889 19.26497057 21.05432051 10.75117270 -11.23594615 [321] 41.24450893 6.07426555 44.20353649 44.00542997 122.65232926 [326] -18.95204221 8.22483034 -11.41190141 9.82354613 -0.84911497 [331] -1.72078969 -1.78109230 -3.02995880 10.41683674 -13.17562923 [336] 2.76721705 2.21476353 -11.37978843 -18.08308775 -2.55690899 [341] -18.33843623 46.57114857 28.99624585 9.09929786 -26.96762882 [346] 8.18866054 18.79043801 -7.62859163 -19.88986675 33.70405225 [351] -18.42985192 -46.54013809 8.19096511 34.66152471 -27.00444524 [356] 17.64248811 -12.12301286 1.24444508 -1.49593893 -44.12665578 [361] 11.99808225 -13.83071269 13.90885571 -9.46272826 12.36301411 [366] -28.53836277 40.74202724 -20.10031987 -2.67685868 -9.04218325 [371] -0.97145792 26.02684588 > postscript(file="/var/wessaorg/rcomp/tmp/2wjyd1355302754.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/33fg51355302754.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/4jcb61355302754.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/593gg1355302754.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/668371355302754.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/7e2u91355302754.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/8li471355302754.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/9vuo71355302754.tab") > > try(system("convert tmp/1cb4h1355302754.ps tmp/1cb4h1355302754.png",intern=TRUE)) character(0) > try(system("convert tmp/2wjyd1355302754.ps tmp/2wjyd1355302754.png",intern=TRUE)) character(0) > try(system("convert tmp/33fg51355302754.ps tmp/33fg51355302754.png",intern=TRUE)) character(0) > try(system("convert tmp/4jcb61355302754.ps tmp/4jcb61355302754.png",intern=TRUE)) character(0) > try(system("convert tmp/593gg1355302754.ps tmp/593gg1355302754.png",intern=TRUE)) character(0) > try(system("convert tmp/668371355302754.ps tmp/668371355302754.png",intern=TRUE)) character(0) > try(system("convert tmp/7e2u91355302754.ps tmp/7e2u91355302754.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 22.021 3.525 25.539