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 = '2.0' > 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.1560076 0.2176646 -0.0396144 0.3321877 -0.1832741 -0.15513503 [2,] -0.2708521 0.2396037 0.0000000 0.4427694 -0.1805498 -0.15283976 [3,] 0.0000000 0.1954926 0.0000000 0.1739924 -0.1790112 -0.15548633 [4,] 0.0000000 0.2028141 0.0000000 0.1665984 0.0000000 -0.06271083 [5,] 0.0000000 0.2074546 0.0000000 0.1609171 0.0000000 0.00000000 [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.4287383 [2,] -0.4262656 [3,] -0.4225952 [4,] -0.5671602 [5,] -0.5896550 [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.59641 0.00212 0.60453 0.25363 0.12542 0.06874 0.00012 [2,] 0.14635 0.00002 NA 0.01896 0.13426 0.07303 0.00015 [3,] NA 0.00041 NA 0.00123 0.13926 0.06830 0.00018 [4,] NA 0.00022 NA 0.00191 NA 0.35266 0.00000 [5,] NA 0.00015 NA 0.00252 NA NA 0.00000 [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.1560 0.2177 -0.0396 0.3322 -0.1833 -0.1551 -0.4287 s.e. 0.2943 0.0703 0.0764 0.2905 0.1193 0.0850 0.1103 sigma^2 estimated as 533948074: log likelihood = -4119.53, aic = 8255.07 [[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.1560 0.2177 -0.0396 0.3322 -0.1833 -0.1551 -0.4287 s.e. 0.2943 0.0703 0.0764 0.2905 0.1193 0.0850 0.1103 sigma^2 estimated as 533948074: log likelihood = -4119.53, aic = 8255.07 [[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.2709 0.2396 0 0.4428 -0.1805 -0.1528 -0.4263 s.e. 0.1861 0.0551 0 0.1879 0.1203 0.0850 0.1113 sigma^2 estimated as 534483147: log likelihood = -4119.66, aic = 8253.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 0.1955 0 0.1740 -0.1790 -0.1555 -0.4226 s.e. 0 0.0548 0 0.0534 0.1208 0.0850 0.1116 sigma^2 estimated as 536770669: log likelihood = -4120.39, aic = 8252.78 [[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 0.2028 0 0.1666 0 -0.0627 -0.5672 s.e. 0 0.0544 0 0.0533 0 0.0674 0.0478 sigma^2 estimated as 540368549: log likelihood = -4121.41, aic = 8252.82 [[3]][[6]] NULL [[3]][[7]] NULL $aic [1] 8255.070 8253.316 8252.784 8252.816 8251.664 Warning messages: 1: In log(s2) : NaNs produced 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/wessaorg/rcomp/tmp/1usfc1323987664.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.191130e+01 3.249003e+01 1.384979e+01 -3.276172e-01 -1.597718e+01 [6] 2.732740e+00 2.474757e+00 -5.390745e+00 -1.198735e+01 -2.215880e+01 [11] -9.809760e+00 -3.289513e+01 -4.452222e+01 6.260742e+03 9.267189e+02 [16] 2.888451e+03 2.824999e+04 8.518361e+03 2.314732e+04 -3.100640e+04 [21] -1.554097e+04 2.786369e+04 -2.488710e+04 1.789352e+03 3.883625e+04 [26] -1.994724e+04 -3.729076e+04 -3.142706e+04 -1.677728e+04 3.870218e+03 [31] -3.010931e+04 -9.561671e+03 1.950589e+04 -2.062098e+04 1.872884e+04 [36] -4.248729e+03 -5.279905e+04 -1.616493e+04 2.699527e+04 1.438523e+04 [41] 2.673914e+03 -1.139461e+04 -2.866988e+03 2.278842e+04 1.057366e+04 [46] -7.371086e+02 5.406090e+02 -1.378983e+04 -1.595963e+04 -7.452549e+02 [51] 5.183236e+03 1.511783e+04 3.125123e+03 -1.350504e+04 7.725432e+02 [56] 1.662620e+04 -3.791276e+03 -4.541176e+03 -7.246136e+02 -1.078035e+03 [61] -1.064668e+04 -1.307050e+04 1.687035e+04 1.487026e+04 -5.852616e+03 [66] -1.108228e+04 -2.148189e+02 1.244747e+04 8.611948e+03 2.571162e+03 [71] 8.706930e+03 1.246157e+04 3.903009e+04 2.113740e+04 3.942700e+03 [76] -1.074193e+04 -8.302362e+03 -7.984742e+03 2.348606e+03 -6.817755e+02 [81] -5.424145e+02 -2.669802e+04 5.881435e+03 -8.181996e+03 -9.936281e+02 [86] -1.958420e+04 -9.504625e+03 1.051744e+04 -1.678880e+04 5.598397e+03 [91] -1.041137e+04 8.063364e+03 -5.556451e+03 1.400530e+04 1.473189e+03 [96] 4.714576e+02 -1.638530e+04 5.908312e+02 1.508339e+04 -1.416082e+04 [101] 2.199699e+04 1.193671e+04 -1.302332e+04 -1.865808e+04 6.312071e+02 [106] 4.444460e+03 1.278246e+04 -1.721173e+03 -7.274836e+03 -1.136174e+04 [111] -7.470650e+03 9.125172e+03 7.768331e+03 1.158310e+04 -1.308948e+04 [116] 7.410485e+02 7.278809e+03 6.905806e+03 1.822880e+04 6.239853e+03 [121] 4.709463e+04 5.349086e+04 -4.675203e+03 -8.604419e+03 -1.884153e+04 [126] 2.177612e+04 -1.274146e+03 -3.491048e+04 -3.725442e+04 -5.203660e+03 [131] -1.238373e+04 2.086309e+04 -3.895836e+03 -2.754775e+04 -2.697742e+04 [136] -3.652229e+04 9.669152e+03 1.196323e+04 -2.379643e+03 1.226095e+04 [141] 1.173128e+04 1.214721e+04 8.729026e+03 -2.604063e+04 -5.311063e+03 [146] -2.519071e+04 4.672090e+04 -1.284162e+04 -9.335240e+03 3.451437e+04 [151] -1.568846e+04 6.481164e+03 -1.202783e+04 2.092677e+04 9.128343e+03 [156] 3.343274e+04 2.542842e+04 2.049124e+04 -3.726189e+04 -2.182241e+04 [161] 3.022196e+03 2.507876e+04 -2.189866e+04 -2.891320e+04 -2.984870e+03 [166] -8.941621e+03 -1.510092e+04 -8.537334e+03 -1.106144e+04 -2.584213e+04 [171] 7.555011e+03 1.133612e+04 2.225624e+04 -3.350705e+04 -5.933773e+03 [176] 4.102211e+04 -7.053415e+03 -1.484519e+04 2.047622e+04 -1.184417e+04 [181] 1.405513e+04 2.160335e+04 -3.576505e+04 4.185030e+03 8.118969e+03 [186] 1.183825e+04 -1.174231e+04 -1.504203e+04 1.071610e+04 3.716717e+03 [191] 5.888266e+03 -1.739688e+04 -4.045531e+03 -1.489865e+04 7.217569e+03 [196] 1.135479e+04 -1.803820e+04 2.874842e+04 -3.381120e+04 1.656027e+04 [201] 8.650274e+03 -2.301618e+03 -2.025145e+04 4.993009e+03 -2.001182e+04 [206] 1.834926e+04 -1.464799e+04 2.110938e+04 -5.951434e+03 1.504536e+03 [211] -1.384122e+03 -1.824042e+03 4.309475e+03 -1.741892e+03 -9.406386e+03 [216] -9.270259e+03 -2.212596e+04 -1.439035e+04 2.951482e+04 1.196817e+04 [221] 1.124335e+04 -1.053770e+04 6.169198e+03 4.914667e+03 2.094884e+03 [226] 3.556617e+03 -1.249322e+04 5.711982e+03 -1.326791e+04 1.404896e+03 [231] 7.254435e+03 5.640381e+03 -5.629629e+03 1.550164e+04 1.367306e+04 [236] -8.934614e+03 1.512446e+04 5.947774e+03 -1.910263e+04 -1.131565e+04 [241] -1.236704e+04 1.500523e+04 -2.686294e+03 -5.193432e+03 2.446102e+03 [246] 1.511006e+04 5.662537e+03 -1.328055e+04 4.057993e+03 -2.325281e+03 [251] -2.714637e+03 -3.119455e+03 -5.014408e+03 -2.567596e+03 1.140384e+04 [256] 9.763121e+03 -6.762892e+03 -6.980977e+03 2.068338e+04 -1.204846e+02 [261] 1.309168e+04 -6.172074e+03 -1.486401e+04 3.297798e+03 2.085568e+04 [266] 1.998495e+04 3.252513e+03 -1.991048e+03 -3.406135e+03 3.840000e+04 [271] 3.644865e+03 -1.412538e+04 1.058433e+04 8.749522e+02 2.917505e+04 [276] 2.156295e+03 3.540342e+04 -1.963689e+04 -2.235464e+04 -2.538667e+04 [281] -9.012686e+03 3.361860e+04 1.426542e+03 -1.083726e+04 -2.027870e+04 [286] -1.739266e+04 1.650648e+04 -8.041256e+03 2.286064e+04 -1.404944e+04 [291] -4.343879e+03 -1.874069e+04 -1.060667e+04 2.078092e+04 -8.095498e+03 [296] -8.806015e+03 -6.109921e+03 -1.423192e+03 -3.108213e+04 -2.615029e+02 [301] -5.127056e+03 1.361435e+04 -1.266783e+04 7.169998e+03 -5.568356e+03 [306] -7.108658e+03 -2.917948e+03 -6.949066e+02 9.652706e+03 -1.943875e+04 [311] 2.295982e+04 8.211890e+03 2.440330e+04 -2.449742e+03 -1.943900e+04 [316] -5.237857e+03 1.605303e+04 2.214360e+04 5.213707e+03 -1.532885e+04 [321] 4.077373e+04 9.820097e+02 4.707244e+04 4.510432e+04 2.067831e+05 [326] -3.442465e+04 -2.012143e+03 -5.103551e+04 -9.212054e+03 5.919136e+04 [331] -4.905778e+04 -5.046762e+04 -1.773429e+04 -9.609011e+03 -2.804862e+04 [336] -1.410360e+04 -5.807408e+03 -3.235680e+04 -5.770119e+04 -1.560598e+04 [341] -3.548981e+04 7.675054e+04 2.375124e+04 -1.649096e+03 -3.834486e+04 [346] 5.807875e+03 2.625632e+04 -2.013280e+04 -2.409490e+04 5.051497e+04 [351] -4.594800e+04 -7.073015e+04 1.433219e+04 3.887376e+04 -5.526270e+04 [356] 2.244638e+04 -1.591647e+04 -1.869656e+03 -8.768711e+03 -5.714662e+04 [361] -2.962978e+03 -2.893030e+04 3.072616e+04 6.834337e+03 1.517143e+04 [366] -6.036252e+04 6.848324e+04 -2.396657e+04 4.125678e+03 -5.897271e+03 [371] -3.901644e+03 3.692948e+04 > postscript(file="/var/wessaorg/rcomp/tmp/2ehcx1323987664.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/3f4az1323987664.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/46j711323987664.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/5xc8m1323987664.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/6gded1323987664.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/70n4l1323987664.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/80pzv1323987664.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/9he8w1323987664.tab") > > try(system("convert tmp/1usfc1323987664.ps tmp/1usfc1323987664.png",intern=TRUE)) character(0) > try(system("convert tmp/2ehcx1323987664.ps tmp/2ehcx1323987664.png",intern=TRUE)) character(0) > try(system("convert tmp/3f4az1323987664.ps tmp/3f4az1323987664.png",intern=TRUE)) character(0) > try(system("convert tmp/46j711323987664.ps tmp/46j711323987664.png",intern=TRUE)) character(0) > try(system("convert tmp/5xc8m1323987664.ps tmp/5xc8m1323987664.png",intern=TRUE)) character(0) > try(system("convert tmp/6gded1323987664.ps tmp/6gded1323987664.png",intern=TRUE)) character(0) > try(system("convert tmp/70n4l1323987664.ps tmp/70n4l1323987664.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 19.493 1.581 21.164