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 = '1' > par7 = '0' > par6 = '3' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = 'FALSE' > par9 <- '1' > par8 <- '1' > par7 <- '0' > par6 <- '3' > par5 <- '12' > par4 <- '1' > 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] [1,] 0.1360687 0.2429817 0.004230875 -0.07948876 -0.6533336 [2,] 0.1370576 0.2434870 0.000000000 -0.07965773 -0.6535295 [3,] 0.1350044 0.2464124 0.000000000 0.00000000 -0.6953228 [4,] NA NA NA NA NA [5,] NA NA NA NA NA [6,] NA NA NA NA NA [7,] NA NA NA NA NA [8,] NA NA NA NA NA [9,] NA NA NA NA NA [10,] NA NA NA NA NA [[2]] [,1] [,2] [,3] [,4] [,5] [1,] 0.01057 0 0.93654 0.29884 0 [2,] 0.00797 0 NA 0.29730 0 [3,] 0.00887 0 NA NA 0 [4,] NA NA NA NA NA [5,] NA NA NA NA NA [6,] NA NA NA NA NA [7,] NA NA NA NA NA [8,] NA NA NA NA NA [9,] NA NA NA NA NA [10,] 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 sar1 sma1 0.1361 0.2430 0.0042 -0.0795 -0.6533 s.e. 0.0529 0.0521 0.0531 0.0764 0.0586 sigma^2 estimated as 448.2: log likelihood = -1609.37, aic = 3230.73 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 sar1 sma1 0.1361 0.2430 0.0042 -0.0795 -0.6533 s.e. 0.0529 0.0521 0.0531 0.0764 0.0586 sigma^2 estimated as 448.2: log likelihood = -1609.37, aic = 3230.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 sar1 sma1 0.1371 0.2435 0 -0.0797 -0.6535 s.e. 0.0514 0.0517 0 0.0763 0.0585 sigma^2 estimated as 448.2: log likelihood = -1609.37, aic = 3228.74 [[3]][[4]] NULL [[3]][[5]] NULL $aic [1] 3230.732 3228.738 3227.810 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/fisher/rcomp/tmp/1ag131354197761.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] 0.135735010 0.096024054 0.049255366 0.015634835 -0.023075924 [6] 0.017042380 0.014873404 -0.003244157 -0.019624934 -0.047524251 [11] -0.015865825 -0.128515943 -0.535784831 1.769033972 5.146282529 [16] 9.492652003 48.075745993 -5.065284989 20.758438150 -26.556857130 [21] -16.898846295 44.401302596 -42.717861609 -7.604634391 24.714388119 [26] -30.843319042 -31.164318066 -32.442823502 -16.043978339 2.403638751 [31] -32.595112383 -28.793772535 26.816413022 -25.684958917 25.979657094 [36] -5.076050461 -65.152149606 -34.798237186 23.599690713 5.704187881 [41] -0.151767950 -0.290378095 -12.562423491 20.226624968 28.704430477 [46] -3.205662275 4.399375342 -33.874268664 -18.777737953 -1.224020477 [51] -1.723955292 24.539804127 12.225748179 -18.252761656 2.893264388 [56] 26.784875415 -11.924367440 -10.901032369 -2.476635374 -5.024041330 [61] 3.636026277 -29.123451292 17.778833844 30.738219428 -14.838356847 [66] -18.650390960 0.145804338 17.350359533 21.661014885 8.861657612 [71] 21.087197105 28.256776354 50.724760730 19.687038785 9.310265268 [76] -8.581129382 -10.405620202 -27.270422229 3.285957244 14.038927887 [81] 1.899524835 -36.275871834 -0.559609458 -9.794995916 -4.376923067 [86] -17.703083404 -6.608675637 14.805172038 -27.904453413 1.565282344 [91] -16.024976374 16.423931594 -11.587878684 18.045986465 2.697883105 [96] -3.593380822 -29.567532250 -3.144061179 25.204656929 -20.347791344 [101] 32.906592851 18.748848450 -24.410489263 -32.604883254 -3.611787321 [106] 12.043996576 29.355101505 -2.720902614 -19.243809941 -16.879937223 [111] -7.660285285 10.394232521 21.475358678 21.611400883 -25.855479771 [116] -6.346727866 14.650226414 14.786600160 30.606298515 6.940234642 [121] 40.450936234 53.478734461 -1.782056216 -3.679513620 -19.081550923 [126] 5.022291144 5.977395988 -19.753410164 -43.283941158 -5.318797847 [131] -25.452995412 28.202058146 -7.357278385 -17.758203098 -23.266832703 [136] -46.898545087 4.603372825 24.493807398 -0.089416722 8.206482031 [141] 5.122164807 18.570219749 2.305877148 -32.987162707 -12.589251208 [146] -31.665416596 54.559357538 -18.945476400 -14.040056881 47.147333306 [151] -16.569804668 8.947812366 -16.460993715 33.864837709 9.200387268 [156] 31.128962417 9.015293227 14.568789377 -23.610541888 -15.537220629 [161] 2.547219105 17.490717065 -16.718610454 -24.279860297 -7.246931523 [166] -6.974980581 -23.088047790 -1.028248718 -7.110487488 -19.753263153 [171] -0.074888400 7.273890128 30.397447832 -33.347652339 -17.380082150 [176] 44.772676770 -8.805258790 -25.265560503 24.178471281 -13.792383968 [181] 13.729754765 20.500635125 -37.650880687 1.644652814 15.193953347 [186] 10.093834411 -15.637379371 -13.418163607 10.126817303 4.826280477 [191] 11.845960530 -23.441236793 -1.064811248 -9.326724964 -1.083994382 [196] 10.887475714 -21.946846962 43.623510344 -45.001227152 10.728405678 [201] 12.797466620 -0.130451956 -27.304570890 4.123962404 -15.250015002 [206] 19.459864256 -21.411958684 22.861486531 -11.130818228 18.138524048 [211] -16.641019259 -5.192132689 3.619205155 -3.516709009 -12.916347877 [216] -13.898663044 -17.470889464 -15.992124542 26.455179482 14.890189851 [221] 19.387308085 3.027687580 -8.739344238 -1.120493637 -0.117355770 [226] 6.040014122 -15.753744422 6.642515714 -9.095649371 -1.963042696 [231] 6.437943003 4.257932075 -9.028357770 42.876001977 12.125246466 [236] -19.529430733 23.958330133 12.315668060 -35.127270130 -21.269666450 [241] -12.062884267 26.857977660 -8.893067934 -15.268650033 -0.749959797 [246] 48.771101583 5.044184157 -31.254680781 8.139228536 -1.761783298 [251] -8.400631671 -11.375909089 -1.231567832 1.204223638 11.188320091 [256] 13.440748178 -13.053831001 6.243407154 26.322533865 -5.700898422 [261] 23.417661008 -10.787552776 -29.649394790 3.635443922 35.709677309 [266] 27.072293532 7.741794408 3.306555510 -5.305601893 19.829348723 [271] 19.489577736 -5.664628791 13.711136673 0.432176552 25.618762800 [276] 5.807026308 12.926853265 -18.809461252 -10.661762699 -16.843976144 [281] -7.199591286 4.598818987 18.475330691 2.757143576 -20.849350430 [286] -19.261205250 20.570922692 -3.717164445 9.340799329 -17.692048727 [291] 0.282780700 -15.600055065 -11.526841899 2.453222085 4.710935514 [296] -0.747657465 -10.872024091 -5.153633483 -33.109273391 -1.886753744 [301] -1.696435631 12.128935228 -10.848762959 4.428440027 -9.406305032 [306] -5.859879168 -0.942332891 -1.903409728 10.329443991 -25.552750327 [311] 23.487923176 12.457995382 23.172972651 -3.031457018 -22.222330658 [316] -5.883224094 18.400718199 14.211050412 8.928754574 -11.640536752 [321] 40.249553958 1.745394194 41.930368638 40.414233213 115.312864562 [326] -28.912923616 0.519131229 -19.027375438 0.562758769 -15.610241333 [331] -12.434312038 -11.877679592 -12.500243598 0.844933571 -22.589911647 [336] -4.918225242 -4.130953719 -21.824005030 -23.810033157 -8.959178085 [341] -24.699433777 35.865723628 22.477030434 4.036559651 -34.066732680 [346] 4.290153848 10.416100218 -15.446522611 -31.143587855 28.866362615 [351] -23.871227199 -49.958328891 4.780417951 28.655158083 -29.595275167 [356] 17.841165773 -16.869845162 -0.586197664 -3.658756586 -47.716881117 [361] 5.757137005 -12.642698615 14.290964864 -10.305416096 13.708830878 [366] -31.809142068 40.732918570 -17.515245898 -2.618491170 -7.462459136 [371] -1.881216439 24.422384860 > postscript(file="/var/fisher/rcomp/tmp/2otvb1354197761.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/fisher/rcomp/tmp/3kilx1354197761.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/fisher/rcomp/tmp/40b4d1354197761.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/fisher/rcomp/tmp/5qjcb1354197761.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/fisher/rcomp/tmp/6idza1354197761.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/fisher/rcomp/tmp/7qbx01354197761.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/8no9q1354197761.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/fisher/rcomp/tmp/9lzvx1354197761.tab") > > try(system("convert tmp/1ag131354197761.ps tmp/1ag131354197761.png",intern=TRUE)) character(0) > try(system("convert tmp/2otvb1354197761.ps tmp/2otvb1354197761.png",intern=TRUE)) character(0) > try(system("convert tmp/3kilx1354197761.ps tmp/3kilx1354197761.png",intern=TRUE)) character(0) > try(system("convert tmp/40b4d1354197761.ps tmp/40b4d1354197761.png",intern=TRUE)) character(0) > try(system("convert tmp/5qjcb1354197761.ps tmp/5qjcb1354197761.png",intern=TRUE)) character(0) > try(system("convert tmp/6idza1354197761.ps tmp/6idza1354197761.png",intern=TRUE)) character(0) > try(system("convert tmp/7qbx01354197761.ps tmp/7qbx01354197761.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.005 0.984 7.985