R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(299.90 + ,339.20 + ,374.20 + ,393.50 + ,389.20 + ,381.70 + ,375.20 + ,369.00 + ,357.40 + ,352.10 + ,346.50 + ,342.90 + ,340.30 + ,328.30 + ,322.90 + ,314.30 + ,308.90 + ,294.00 + ,285.60 + ,281.20 + ,280.30 + ,278.80 + ,274.50 + ,270.40 + ,263.40 + ,259.90 + ,258.00 + ,262.70 + ,284.70 + ,311.30 + ,322.10 + ,327.00 + ,331.30 + ,333.30 + ,321.40 + ,327.00 + ,320.00 + ,314.70 + ,316.70 + ,314.40 + ,321.30 + ,318.20 + ,307.20 + ,301.30 + ,287.50 + ,277.70 + ,274.40 + ,258.80 + ,253.30 + ,251.00 + ,248.40 + ,249.50 + ,246.10 + ,244.50 + ,243.60 + ,244.00 + ,240.80 + ,249.80 + ,248.00 + ,259.40 + ,260.50 + ,260.80 + ,261.30 + ,259.50 + ,256.60 + ,257.90 + ,256.50 + ,254.20 + ,253.30 + ,253.80 + ,255.50 + ,257.10 + ,257.30 + ,253.20 + ,252.80 + ,252.00 + ,250.70 + ,252.20 + ,250.00 + ,251.00 + ,253.40 + ,251.20 + ,255.60 + ,261.10 + ,258.90 + ,259.90 + ,261.20 + ,264.70 + ,267.10 + ,266.40 + ,267.70 + ,268.60 + ,267.50 + ,268.50 + ,268.50 + ,270.50 + ,270.90 + ,270.10 + ,269.30 + ,269.80 + ,270.10 + ,264.90 + ,263.70 + ,264.80 + ,263.70 + ,255.90 + ,276.20 + ,360.10 + ,380.50 + ,373.70 + ,369.80 + ,366.60 + ,359.30 + ,345.80 + ,326.20 + ,324.50 + ,328.10 + ,327.50 + ,324.40 + ,316.50 + ,310.90 + ,301.50 + ,291.70 + ,290.40 + ,287.40 + ,277.70 + ,281.60 + ,288.00 + ,276.00 + ,272.90 + ,283.00 + ,283.30 + ,276.80 + ,284.50 + ,282.70 + ,281.20 + ,287.40 + ,283.10 + ,284.00 + ,285.50 + ,289.20 + ,292.50 + ,296.40 + ,305.20 + ,303.90 + ,311.50 + ,316.30 + ,316.70 + ,322.50 + ,317.10 + ,309.80 + ,303.80 + ,290.30 + ,293.70 + ,291.70 + ,296.50 + ,289.10 + ,288.50 + ,293.80 + ,297.70 + ,305.40 + ,302.70 + ,302.50 + ,303.00 + ,294.50 + ,294.10 + ,294.50 + ,297.10 + ,289.40 + ,292.40 + ,287.90 + ,286.60 + ,280.50 + ,272.40 + ,269.20 + ,270.60 + ,267.30 + ,262.50 + ,266.80 + ,268.80 + ,263.10 + ,261.20 + ,266.00 + ,262.50 + ,265.20 + ,261.30 + ,253.70 + ,249.20 + ,239.10 + ,236.40 + ,235.20 + ,245.20 + ,246.20 + ,247.70 + ,251.40 + ,253.30 + ,254.80 + ,250.00 + ,249.30 + ,241.50 + ,243.30 + ,248.00 + ,253.00 + ,252.90 + ,251.50 + ,251.60 + ,253.50 + ,259.80 + ,334.10 + ,448.00 + ,445.80 + ,445.00 + ,448.20 + ,438.20 + ,439.80 + ,423.40 + ,410.80 + ,408.40 + ,406.70 + ,405.90 + ,402.70 + ,405.10 + ,399.60 + ,386.50 + ,381.40 + ,375.20 + ,357.70 + ,359.00 + ,355.00 + ,352.70 + ,344.40 + ,343.80 + ,338.00 + ,339.00 + ,333.30 + ,334.40 + ,328.30 + ,330.70 + ,330.00 + ,331.60 + ,351.20 + ,389.40 + ,410.90 + ,442.80 + ,462.80 + ,466.90 + ,461.70 + ,439.20 + ,430.30 + ,416.10 + ,402.50 + ,397.30 + ,403.30 + ,395.90 + ,387.80 + ,378.60 + ,377.10 + ,370.40 + ,362.00 + ,350.30 + ,348.20 + ,344.60 + ,343.50 + ,342.80 + ,347.60 + ,346.60 + ,349.50 + ,342.10 + ,342.00 + ,342.80 + ,339.30 + ,348.20 + ,333.70 + ,334.70 + ,354.00 + ,367.70 + ,363.30 + ,358.40 + ,353.10 + ,343.10 + ,344.60 + ,344.40 + ,333.90 + ,331.70 + ,324.30 + ,321.20 + ,322.40 + ,321.70 + ,320.50 + ,312.80 + ,309.70 + ,315.60 + ,309.70 + ,304.60 + ,302.50 + ,301.50 + ,298.80 + ,291.30 + ,293.60 + ,294.60 + ,285.90 + ,297.60 + ,301.10 + ,293.80 + ,297.70 + ,292.90 + ,292.10 + ,287.20 + ,288.20 + ,283.80 + ,299.90 + ,292.40 + ,293.30 + ,300.80 + ,293.70 + ,293.10 + ,294.40 + ,292.10 + ,291.90 + ,282.50 + ,277.90 + ,287.50 + ,289.20 + ,285.60 + ,293.20 + ,290.80 + ,283.10 + ,275.00 + ,287.80 + ,287.80 + ,287.40 + ,284.00 + ,277.80 + ,277.60 + ,304.90 + ,294.00 + ,300.90 + ,324.00 + ,332.90 + ,341.60 + ,333.40 + ,348.20 + ,344.70 + ,344.70 + ,329.30 + ,323.50 + ,323.20 + ,317.40 + ,330.10 + ,329.20 + ,334.90 + ,315.80 + ,315.40 + ,319.60 + ,317.30 + ,313.80 + ,315.80 + ,311.30) > par9 = '0' > par8 = '0' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '0' > par3 = '1' > 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 > par6 <- 3 > par7 <- as.numeric(par7) #degree (q) of the non-seasonal MA(q) polynomial > par7 <- 3 > 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.9761292 0.2761682 -0.30884876 -0.5319620 -0.63892405 0.1796001 [2,] 1.1888696 0.0000000 -0.23595301 -0.7578431 -0.46950070 0.2194032 [3,] -0.5756370 0.0000000 0.16377169 1.0460957 0.37751993 0.0000000 [4,] 0.0000000 0.0000000 0.09969094 0.4720773 0.10490568 0.0000000 [5,] 0.0000000 0.0000000 0.00000000 0.4680040 0.06221682 0.0000000 [6,] 0.0000000 0.0000000 0.00000000 0.4497582 0.00000000 0.0000000 [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 [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.04845 0.65051 0.07147 0.28094 0.08974 0.27599 [2,] 0.00000 NA 0.00176 0.00000 0.00000 0.06892 [3,] 0.37681 NA 0.08459 0.10950 0.23447 NA [4,] NA NA 0.09984 0.00000 0.08523 NA [5,] NA NA NA 0.00000 0.23123 NA [6,] NA NA NA 0.00000 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 [[3]] [[3]][[1]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 ma2 ma3 0.9761 0.2762 -0.3088 -0.5320 -0.6389 0.1796 s.e. 0.4929 0.6090 0.1708 0.4926 0.3755 0.1646 sigma^2 estimated as 107.1: log likelihood = -1341.68, aic = 2697.37 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 ma2 ma3 0.9761 0.2762 -0.3088 -0.5320 -0.6389 0.1796 s.e. 0.4929 0.6090 0.1708 0.4926 0.3755 0.1646 sigma^2 estimated as 107.1: log likelihood = -1341.68, aic = 2697.37 [[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 ma2 ma3 1.1889 0 -0.2360 -0.7578 -0.4695 0.2194 s.e. 0.0786 0 0.0749 0.1050 0.0656 0.1203 sigma^2 estimated as 105.6: log likelihood = -1341.76, aic = 2695.52 [[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 ma2 ma3 -0.5756 0 0.1638 1.0461 0.3775 0 s.e. 0.6505 0 0.0947 0.6520 0.3170 0 sigma^2 estimated as 110.9: log likelihood = -1347.21, aic = 2704.42 [[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 ma2 ma3 0 0 0.0997 0.4721 0.1049 0 s.e. 0 0 0.0604 0.0527 0.0608 0 sigma^2 estimated as 111.0: log likelihood = -1347.38, aic = 2702.76 [[3]][[6]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ar3 ma1 ma2 ma3 0 0 0 0.4680 0.0622 0 s.e. 0 0 0 0.0518 0.0519 0 sigma^2 estimated as 111.9: log likelihood = -1348.75, aic = 2703.5 $aic [1] 2697.367 2695.521 2704.417 2702.759 2703.495 2702.920 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 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/www/html/rcomp/tmp/1el8e1260302627.ps",horizontal=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 = 358 Frequency = 1 [1] 0.29989982 35.53822250 18.82921849 8.50040178 -9.43701476 [6] -3.61184781 -4.22252843 -3.99912242 -9.46568227 -0.62120975 [11] -4.72034668 -1.35220897 -1.67347578 -11.13267643 -0.08574408 [16] -7.86723171 -1.71276903 -13.60894304 -1.92439659 -2.65266947 [21] 0.46118987 -1.55079807 -3.60291400 -2.31733596 -5.69131555 [26] -0.69226404 -1.22192208 5.31493494 19.58861306 17.10177154 [31] 1.57756058 3.09767745 2.75212363 0.51926738 -12.31424761 [36] 11.33081050 -11.53671181 -0.60573921 3.00126591 -3.66691741 [41] 8.42940296 -6.81685073 -8.33413694 -1.57546745 -12.54415137 [46] -3.83126587 -0.72649489 -15.02162828 1.57538297 -2.10268767 [51] -1.71394899 2.03295759 -4.24479592 0.26009750 -0.75762898 [56] 0.73839099 -3.49843270 10.59134031 -6.53912873 13.80137918 [61] -4.95225747 1.75899861 -0.01510475 -1.90237021 -2.00874328 [66] 2.35845940 -2.37879092 -1.33345207 -0.12793823 0.64283876 [71] 1.40710877 0.90147202 -0.30943838 -4.01126831 1.49654206 [76] -1.25081938 -0.80772156 1.95583896 -3.06508667 2.31278688 [81] 1.50830633 -3.04978770 5.73347095 3.00646050 -3.96375400 [86] 2.66800049 0.29797715 3.19455099 0.88639803 -1.31359266 [91] 1.85961781 0.11141890 -1.26784400 1.58642399 -0.66357162 [96] 2.21185195 -0.59387034 -0.65968067 -0.45431805 0.75366592 [101] -0.02445247 -5.23544684 1.25173164 0.83991738 -1.57096349 [106] -7.11703972 23.72854372 73.23774518 -15.35187536 -4.17187980 [111] -0.99239854 -2.47599238 -6.07948167 -10.50072963 -14.30737007 [116] 5.64922903 1.84629703 -1.81555153 -2.36518527 -6.68012589 [121] -2.32651977 -7.89556316 -5.96009586 1.98058578 -3.55610395 [126] -8.15895472 7.93967327 3.19182502 -13.98776823 3.24774689 [131] 9.45031577 -4.32485047 -5.06392108 10.33901398 -6.32363928 [136] 0.81622819 6.21143863 -7.25776151 3.91020578 0.12156272 [141] 3.39982759 1.70130370 2.89225653 7.34056254 -4.91535995 [146] 9.44370188 0.68612740 -0.50866749 5.99536978 -8.17420962 [151] -3.84744968 -3.69080467 -11.53331241 9.02726696 -5.50723143 [156] 6.81575874 -10.24716023 3.77165759 4.17239471 1.71264187 [161] 6.63888355 -5.91357947 2.15452889 -0.14040413 -8.56833824 [166] 3.61875243 -0.76049602 2.73076795 -8.93069480 7.00970158 [171] -7.22492926 1.64517477 -6.42043633 -5.19756738 -0.36805833 [176] 1.89562889 -4.16426257 -2.96904828 5.94861377 -0.59925056 [181] -5.78965214 0.84686407 4.76387793 -5.78220332 5.10970120 [186] -5.93161052 -5.14189165 -1.72452798 -8.97300179 1.60669576 [191] -1.39366848 10.55227899 -3.85179961 2.64612856 2.70124786 [196] 0.47117138 1.11142684 -5.34946704 1.73442276 -8.27889004 [201] 5.56664374 2.60987442 3.43222935 -1.86867530 -0.73899480 [206] 0.56211559 1.68290554 5.47742036 71.63184010 80.03522155 [211] -44.11351251 14.86576531 -1.01263585 -10.45098296 6.55410526 [216] -18.81712085 -4.20128695 0.73696068 -1.78350987 -0.01116152 [221] -3.08381205 3.84393094 -7.10711025 -10.01300083 0.02830666 [226] -5.59027057 -14.88549192 8.61427925 -7.10538956 0.48939799 [231] -8.08696550 3.15428377 -6.77307229 3.97357571 -7.13825049 [236] 4.19350685 -7.61845892 5.70456292 -2.89576223 2.60030867 [241] 18.56321014 29.35055967 6.60887552 26.98092108 6.96163664 [246] -0.83674118 -5.24153263 -19.99488216 0.78379718 -13.32280228 [251] -7.41364003 -0.90148411 6.88315131 -10.56525517 -3.58366564 [256] -6.86549342 1.93604296 -7.17892677 -5.16068768 -8.83812731 [261] 2.35736089 -4.15337426 0.69712845 -0.76784920 5.11598341 [266] -3.34652779 4.14788832 -9.13301819 3.91622102 -0.46457993 [271] -3.52622953 10.57919436 -19.23171495 9.34231653 16.12429422 [276] 5.57251590 -8.01116226 -1.49744788 -4.10075930 -7.98766162 [281] 5.49339413 -2.27396377 -9.77755727 2.51741513 -7.96983195 [286] 0.47328801 1.47435689 -1.41945146 -0.62742077 -7.31805079 [291] 0.36391348 6.18499286 -8.81724320 -1.35830511 -0.91572689 [296] -0.48692669 -2.41514273 -6.33940841 5.41713126 -1.14082151 [301] -8.50312760 15.75047638 -3.34224908 -6.71575846 7.25094622 [306] -7.77563902 2.38789969 -5.53377118 3.44125976 -5.66622984 [311] 18.53771424 -15.82319042 7.15195948 5.13732262 -9.94925993 [316] 3.73666600 0.17023651 -2.61215485 1.01190746 -9.71105682 [321] -0.11814381 10.25948285 -3.09412892 -2.79024754 9.09835399 [326] -6.48446613 -5.23131428 -5.24828091 15.58169242 -6.96576371 [331] 1.89056224 -3.85140311 -4.51515254 2.15273169 26.57343129 [336] -23.47040940 16.23093213 16.96411235 -0.04911014 7.66753063 [341] -11.78537986 19.83855606 -12.05127560 4.40575385 -16.71211858 [346] 1.74722708 -0.07793448 -5.87223326 15.45307774 -7.76675119 [351] 8.37342962 -22.53557636 9.62577270 1.09719134 -3.41237494 [356] -1.97125849 3.13486406 -5.84448362 > postscript(file="/var/www/html/rcomp/tmp/2humc1260302627.ps",horizontal=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/www/html/rcomp/tmp/3byt81260302627.ps",horizontal=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/www/html/rcomp/tmp/40gwp1260302627.ps",horizontal=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/www/html/rcomp/tmp/5o1vi1260302627.ps",horizontal=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/www/html/rcomp/tmp/6ysyq1260302627.ps",horizontal=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/www/html/rcomp/tmp/7t9ss1260302627.ps",horizontal=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/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/8r5ia1260302627.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/www/html/rcomp/tmp/94vra1260302627.tab") > > system("convert tmp/1el8e1260302627.ps tmp/1el8e1260302627.png") > system("convert tmp/2humc1260302627.ps tmp/2humc1260302627.png") > system("convert tmp/3byt81260302627.ps tmp/3byt81260302627.png") > system("convert tmp/40gwp1260302627.ps tmp/40gwp1260302627.png") > system("convert tmp/5o1vi1260302627.ps tmp/5o1vi1260302627.png") > system("convert tmp/6ysyq1260302627.ps tmp/6ysyq1260302627.png") > system("convert tmp/7t9ss1260302627.ps tmp/7t9ss1260302627.png") > > > proc.time() user system elapsed 3.094 1.114 4.077