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 = '1' > par3 = '0' > 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,] 1.580350 -0.4597120 -0.1400242 -0.4857251 -0.1898887 -0.1294765 [2,] 1.522745 -0.3746904 -0.1688809 -0.4366103 -0.0675088 0.0000000 [3,] 1.516875 -0.3651262 -0.1731911 -0.4332596 0.0000000 0.0000000 [4,] 1.223393 0.0000000 -0.2521195 -0.1267845 0.0000000 0.0000000 [5,] 1.173650 0.0000000 -0.2043332 0.0000000 0.0000000 0.0000000 [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.5143643 [2,] -0.6340818 [3,] -0.6703938 [4,] -1.4761526 [5,] -0.6847230 [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 0.09962 0.10512 0.01931 0.10494 0.14289 0 [2,] 0 0.21884 0.05520 0.06714 0.39505 NA 0 [3,] 0 0.20470 0.04037 0.05390 NA NA 0 [4,] 0 NA 0.00000 0.09935 NA NA 0 [5,] 0 NA 0.00000 NA NA NA 0 [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.5803 -0.4597 -0.1400 -0.4857 -0.1899 -0.1295 -0.5144 s.e. 0.2057 0.2785 0.0862 0.2067 0.1168 0.0882 0.1100 sigma^2 estimated as 432.5: log likelihood = -1608.55, aic = 3233.1 [[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.5803 -0.4597 -0.1400 -0.4857 -0.1899 -0.1295 -0.5144 s.e. 0.2057 0.2785 0.0862 0.2067 0.1168 0.0882 0.1100 sigma^2 estimated as 432.5: log likelihood = -1608.55, aic = 3233.1 [[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.5227 -0.3747 -0.1689 -0.4366 -0.0675 0 -0.6341 s.e. 0.2308 0.3042 0.0878 0.2378 0.0793 0 0.0622 sigma^2 estimated as 435.1: log likelihood = -1609.52, aic = 3233.04 [[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.5169 -0.3651 -0.1732 -0.4333 0 0 -0.6704 s.e. 0.2177 0.2874 0.0842 0.2240 0 0 0.0413 sigma^2 estimated as 436: log likelihood = -1609.88, aic = 3231.75 [[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 1.2234 0 -0.2521 -0.1268 0 0 -1.4762 s.e. 0.0417 0 0.0412 0.0767 0 0 0.0878 sigma^2 estimated as 200.7: log likelihood = -1610.38, aic = 3230.75 [[3]][[6]] NULL [[3]][[7]] NULL $aic [1] 3233.099 3233.039 3231.751 3230.751 3231.744 Warning messages: 1: In log(s2) : NaNs produced 2: In log(s2) : NaNs produced 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 6: 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/1xwss1356122620.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.23509490 0.28068416 0.26457349 0.24066467 0.20135831 [6] 0.24075302 0.24104802 0.22374451 0.20604285 0.17464325 [11] 0.20324455 0.22044556 9.77276362 2.65881742 5.37702372 [16] 9.35486834 37.18486861 2.05202926 19.54312437 -12.40308023 [21] -6.22214475 37.18975033 -20.98351439 0.27315552 23.47757220 [26] -15.38810261 -17.02395952 -17.77485400 -7.90861111 6.07131617 [31] -18.58361071 -16.38127151 20.40912836 -16.03319739 19.87436362 [36] -1.67307901 -44.05576101 -24.18568172 16.11280576 5.52562834 [41] 0.39249985 -2.06242560 -8.71463483 12.40030998 16.97058870 [46] -1.29409473 -0.10636369 -24.05127346 -11.50488523 -1.30423596 [51] -3.42374909 14.67585901 7.46595130 -13.52871232 0.10858379 [56] 15.42613685 -9.50832227 -8.73450247 -3.36586721 -3.20034207 [61] 1.55275300 -21.38163314 10.13221497 18.68422045 -10.93869487 [66] -13.92867164 -2.33217496 9.30545514 14.55138029 5.64016785 [71] 13.24523282 18.29142402 34.03262730 15.39569279 6.96068382 [76] -4.97241507 -3.86670218 -14.96535585 5.16914559 12.84341526 [81] 4.58063902 -21.54368196 1.09610269 -4.94459271 -2.20811657 [86] -11.02999059 -2.81816344 12.50373481 -16.54401779 2.31653087 [91] -10.19361673 11.40181489 -6.79033987 13.85127516 2.61918354 [96] -1.46174336 -19.28733493 -1.94855543 17.65581268 -13.23020253 [101] 22.73937652 12.75697660 -15.07761562 -22.81027211 -2.26672028 [106] 7.47386374 20.60472309 -0.93490923 -11.73700107 -12.15216197 [111] -6.32486237 8.11658504 13.20758754 14.03412215 -16.51158072 [116] -3.36109152 9.86747832 10.37119978 20.40075312 5.87678975 [121] 28.78904184 38.77176158 2.87819762 -0.36797946 -10.24595170 [126] 6.55752882 9.45012164 -8.04679779 -25.43952180 -0.35611709 [131] -13.49540626 22.40169394 -2.71824563 -11.36815652 -13.66409741 [136] -29.56903085 5.06110763 18.30095462 0.88658612 6.52338491 [141] 5.60265210 13.51753417 4.00243168 -22.60517834 -8.03049419 [146] -19.70943527 38.09649604 -9.14860172 -9.53078965 30.62780533 [151] -9.83808970 5.53658366 -11.40562058 22.77843335 7.71786454 [156] 24.22734327 8.52583838 13.06462712 -15.87221630 -8.34330404 [161] 4.84258538 13.98468916 -7.26287429 -14.14888756 -2.21766619 [166] -2.98044325 -13.43413003 -0.58103415 -3.62573257 -13.07465816 [171] 1.83762206 5.54470026 20.82417232 -21.61239093 -12.36899201 [176] 30.49655431 -4.76862469 -16.39202078 16.42822561 -8.26333456 [181] 9.49794121 14.84129023 -24.72749735 -0.48995139 9.23529602 [186] 9.71659784 -9.76618855 -11.23616655 6.67378939 5.05875308 [191] 7.37417630 -14.86063251 -1.71207068 -7.39786671 0.71069070 [196] 7.03018330 -14.88978033 28.24424071 -29.76663602 6.98074807 [201] 7.46237703 -0.18139775 -19.28383111 2.38088346 -10.60684921 [206] 12.80991777 -15.41387626 13.52059749 -7.08862569 9.72689269 [211] -10.99317556 -5.23239584 0.56707089 -3.21174531 -8.65073530 [216] -11.43267162 -12.94196120 -13.64228659 16.18996448 7.77063826 [221] 11.49860546 -0.06288198 -8.44214868 -2.75462858 -1.91303286 [226] 2.62575323 -11.83769159 2.98385896 -7.13883748 -2.18754927 [231] 1.10670518 1.07463288 -8.68486246 27.45644132 7.13759741 [236] -14.25326185 14.27578867 7.65519440 -23.61983340 -16.38765104 [241] -9.16882355 17.52466419 -6.13109993 -11.24387045 -1.73688561 [246] 30.58113902 2.30914324 -21.47055499 2.52989916 -2.34010070 [251] -5.37913099 -8.03158205 -1.82330787 -1.32296792 6.85358372 [256] 8.91825026 -9.79486285 1.60484018 16.28857877 -3.20687068 [261] 14.96452045 -7.23753074 -20.95864592 1.41168501 23.92043168 [266] 19.57875366 5.41768307 1.91326813 -2.55430607 15.25034448 [271] 14.04420761 -1.88354334 10.50477434 3.39536520 20.81838439 [276] 7.05907645 10.74328478 -9.80491069 -3.83696014 -7.50555800 [281] -0.92383868 6.97370639 16.10087852 5.82261179 -10.53754335 [286] -10.28127825 15.18777038 1.03759527 9.46066996 -7.58018323 [291] 3.48553271 -6.86130893 -4.99930896 4.66119838 5.61895079 [296] 1.61199094 -3.94974235 -0.93284127 -21.33425616 -0.13891728 [301] 0.28206310 10.28193276 -6.20563895 3.91305104 -5.56093955 [306] -3.18043678 -0.14812423 -1.05088696 7.55320095 -17.01196134 [311] 16.75401559 8.91727479 16.62389049 -2.15160991 -14.33746737 [316] -4.48215044 13.21308853 11.66337995 7.74515197 -6.80508378 [321] 27.59004841 4.28724604 29.10614630 29.73577537 81.29520565 [326] -12.96243173 5.31805684 -7.25368182 6.57693395 -3.14020139 [331] -0.56930652 0.09501170 -2.04869657 7.40354113 -9.29946477 [336] 1.73447382 -0.34643780 -7.60254836 -11.27247325 -0.78441765 [341] -12.01311188 28.93765485 20.60463300 7.23995113 -18.69359357 [346] 5.29148978 12.19682442 -5.39971978 -15.83463263 22.71557266 [351] -11.25679621 -30.94097645 5.62610781 20.87396319 -17.72397839 [356] 12.70929422 -8.19972315 0.64354878 -1.77944073 -30.27927782 [361] 5.66665434 -9.31841784 10.31872559 -5.28385046 8.31773331 [366] -22.51289077 27.64349519 -12.48546343 -2.37738603 -6.26375768 [371] -1.66527240 17.42115290 > postscript(file="/var/wessaorg/rcomp/tmp/2xar01356122620.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/3jx281356122620.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/4c0rk1356122620.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/5cq2k1356122620.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/69z711356122620.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/7etws1356122620.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/8avg91356122620.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/9iqk61356122620.tab") > > try(system("convert tmp/1xwss1356122620.ps tmp/1xwss1356122620.png",intern=TRUE)) character(0) > try(system("convert tmp/2xar01356122620.ps tmp/2xar01356122620.png",intern=TRUE)) character(0) > try(system("convert tmp/3jx281356122620.ps tmp/3jx281356122620.png",intern=TRUE)) character(0) > try(system("convert tmp/4c0rk1356122620.ps tmp/4c0rk1356122620.png",intern=TRUE)) character(0) > try(system("convert tmp/5cq2k1356122620.ps tmp/5cq2k1356122620.png",intern=TRUE)) character(0) > try(system("convert tmp/69z711356122620.ps tmp/69z711356122620.png",intern=TRUE)) character(0) > try(system("convert tmp/7etws1356122620.ps tmp/7etws1356122620.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 32.225 2.083 35.351