R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64-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(315.42 + ,316.32 + ,316.49 + ,317.56 + ,318.13 + ,318.00 + ,316.39 + ,314.66 + ,313.68 + ,313.18 + ,314.66 + ,315.43 + ,316.27 + ,316.81 + ,317.42 + ,318.87 + ,319.87 + ,319.43 + ,318.01 + ,315.75 + ,314.00 + ,313.68 + ,314.84 + ,316.03 + ,316.73 + ,317.54 + ,318.38 + ,319.31 + ,320.42 + ,319.61 + ,318.42 + ,316.64 + ,314.83 + ,315.15 + ,315.95 + ,316.85 + ,317.78 + ,318.40 + ,319.53 + ,320.41 + ,320.85 + ,320.45 + ,319.44 + ,317.25 + ,316.12 + ,315.27 + ,316.53 + ,317.53 + ,318.58 + ,318.92 + ,319.70 + ,321.22 + ,322.08 + ,321.31 + ,319.58 + ,317.61 + ,316.05 + ,315.83 + ,316.91 + ,318.20 + ,319.41 + ,320.07 + ,320.74 + ,321.40 + ,322.06 + ,321.73 + ,320.27 + ,318.54 + ,316.54 + ,316.71 + ,317.53 + ,318.55 + ,319.27 + ,320.28 + ,320.73 + ,321.97 + ,322.00 + ,321.71 + ,321.05 + ,318.71 + ,317.65 + ,317.14 + ,318.71 + ,319.25 + ,320.46 + ,321.43 + ,322.22 + ,323.54 + ,323.91 + ,323.59 + ,322.26 + ,320.21 + ,318.48 + ,317.94 + ,319.63 + ,320.87 + ,322.17 + ,322.34 + ,322.88 + ,324.25 + ,324.83 + ,323.93 + ,322.39 + ,320.76 + ,319.10 + ,319.23 + ,320.56 + ,321.80 + ,322.40 + ,322.99 + ,323.73 + ,324.86 + ,325.41 + ,325.19 + ,323.97 + ,321.92 + ,320.10 + ,319.96 + ,320.97 + ,322.48 + ,323.52 + ,323.89 + ,325.04 + ,326.01 + ,326.67 + ,325.96 + ,325.13 + ,322.90 + ,321.61 + ,321.01 + ,322.08 + ,323.37 + ,324.34 + ,325.30 + ,326.29 + ,327.54 + ,327.54 + ,327.21 + ,325.98 + ,324.42 + ,322.91 + ,322.90 + ,323.85 + ,324.96 + ,326.01 + ,326.51 + ,327.01 + ,327.62 + ,328.76 + ,328.40 + ,327.20 + ,325.28 + ,323.20 + ,323.40 + ,324.64 + ,325.85 + ,326.60 + ,327.47 + ,327.58 + ,329.56 + ,329.90 + ,328.92 + ,327.89 + ,326.17 + ,324.68 + ,325.04 + ,326.34 + ,327.39 + ,328.37 + ,329.40 + ,330.14 + ,331.33 + ,332.31 + ,331.90 + ,330.70 + ,329.15 + ,327.34 + ,327.02 + ,327.99 + ,328.48 + ,329.18 + ,330.55 + ,331.32 + ,332.48 + ,332.92 + ,332.08 + ,331.02 + ,329.24 + ,327.28 + ,327.21 + ,328.29 + ,329.41 + ,330.23 + ,331.24 + ,331.87 + ,333.14 + ,333.80 + ,333.42 + ,331.73 + ,329.90 + ,328.40 + ,328.17 + ,329.32 + ,330.59 + ,331.58 + ,332.39 + ,333.33 + ,334.41 + ,334.71 + ,334.17 + ,332.88 + ,330.77 + ,329.14 + ,328.77 + ,330.14 + ,331.52 + ,332.75 + ,333.25 + ,334.53 + ,335.90 + ,336.57 + ,336.10 + ,334.76 + ,332.59 + ,331.41 + ,330.98 + ,332.24 + ,333.68 + ,334.80 + ,335.22 + ,336.47 + ,337.59 + ,337.84 + ,337.72 + ,336.37 + ,334.51 + ,332.60 + ,332.37 + ,333.75 + ,334.79 + ,336.05 + ,336.59 + ,337.79 + ,338.71 + ,339.30 + ,339.12 + ,337.56 + ,335.92 + ,333.74 + ,333.70 + ,335.13 + ,336.56 + ,337.84 + ,338.19 + ,339.90 + ,340.60 + ,341.29 + ,341.00 + ,339.39 + ,337.43 + ,335.72 + ,335.84 + ,336.93 + ,338.04 + ,339.06 + ,340.30 + ,341.21 + ,342.33 + ,342.74 + ,342.07 + ,340.32 + ,338.27 + ,336.52 + ,336.68 + ,338.19 + ,339.44 + ,340.57 + ,341.44 + ,342.53 + ,343.39 + ,343.96 + ,343.18 + ,341.88 + ,339.65 + ,337.80 + ,337.69 + ,339.09 + ,340.32 + ,341.20 + ,342.35 + ,342.93 + ,344.77 + ,345.58 + ,345.14 + ,343.81 + ,342.22 + ,339.69 + ,339.82 + ,340.98 + ,342.82 + ,343.52 + ,344.33 + ,345.11 + ,346.88 + ,347.25 + ,346.61 + ,345.22 + ,343.11 + ,340.90 + ,341.17 + ,342.80 + ,344.04 + ,344.79 + ,345.82 + ,347.25 + ,348.17 + ,348.75 + ,348.07 + ,346.38 + ,344.52 + ,342.92 + ,342.63 + ,344.06 + ,345.38 + ,346.12 + ,346.79 + ,347.69 + ,349.38 + ,350.04 + ,349.38 + ,347.78 + ,345.75 + ,344.70 + ,344.01 + ,345.50 + ,346.75 + ,347.86 + ,348.32 + ,349.26 + ,350.84 + ,351.70 + ,351.11 + ,349.37 + ,347.97 + ,346.31 + ,346.22 + ,347.68 + ,348.82 + ,350.29 + ,351.58 + ,352.08 + ,353.45 + ,354.08 + ,353.66 + ,352.25 + ,350.30 + ,348.58 + ,348.74 + ,349.93 + ,351.21 + ,352.62 + ,352.93 + ,353.54 + ,355.27 + ,355.52 + ,354.97 + ,353.74 + ,351.51 + ,349.63 + ,349.82 + ,351.12 + ,352.35 + ,353.47 + ,354.51 + ,355.18 + ,355.98 + ,356.94 + ,355.99 + ,354.58 + ,352.68 + ,350.72 + ,350.92 + ,352.55 + ,353.91) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '0.2' > 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] [1,] 0.27710988 0.08330933 -0.05713575 -0.6356158 0.01670652 -0.03981598 [2,] 0.27972254 0.08358290 -0.05472046 -0.6396839 0.00000000 -0.04373075 [3,] 0.26788229 0.08070102 -0.06008708 -0.6262254 0.00000000 0.00000000 [4,] 0.09959194 0.00000000 -0.08411657 -0.4527147 0.00000000 0.00000000 [5,] 0.00000000 0.00000000 -0.09479390 -0.3630506 0.00000000 0.00000000 [6,] 0.00000000 0.00000000 0.00000000 -0.3690768 0.00000000 0.00000000 [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.9021345 [2,] -0.8967327 [3,] -0.9068050 [4,] -0.9073831 [5,] -1.0999811 [6,] -1.0962109 [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.15183 0.34256 0.38149 0.00085 0.78705 0.51023 0 [2,] 0.14298 0.33863 0.39784 0.00065 NA 0.45659 0 [3,] 0.16704 0.35865 0.34855 0.00101 NA NA 0 [4,] 0.53555 NA 0.14121 0.00254 NA NA 0 [5,] NA NA 0.07038 0.00000 NA NA 0 [6,] NA NA NA 0.00000 NA NA 0 [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.2771 0.0833 -0.0571 -0.6356 0.0167 -0.0398 -0.9021 s.e. 0.1930 0.0877 0.0652 0.1890 0.0618 0.0604 0.0410 sigma^2 estimated as 2.833e-07: log likelihood = 2259.9, aic = -4503.79 [[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.2771 0.0833 -0.0571 -0.6356 0.0167 -0.0398 -0.9021 s.e. 0.1930 0.0877 0.0652 0.1890 0.0618 0.0604 0.0410 sigma^2 estimated as 2.833e-07: log likelihood = 2259.9, aic = -4503.79 [[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.2797 0.0836 -0.0547 -0.6397 0 -0.0437 -0.8967 s.e. 0.1906 0.0872 0.0646 0.1860 0 0.0587 0.0362 sigma^2 estimated as 2.835e-07: log likelihood = 2259.86, aic = -4505.72 [[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.2679 0.0807 -0.0601 -0.6262 0 0 -0.9068 s.e. 0.1935 0.0878 0.0640 0.1890 0 0 0.0334 sigma^2 estimated as 2.837e-07: log likelihood = 2259.58, aic = -4507.17 [[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.0996 0 -0.0841 -0.4527 0 0 -0.9074 s.e. 0.1606 0 0.0571 0.1490 0 0 0.0334 sigma^2 estimated as 2.842e-07: log likelihood = 2259.24, aic = -4508.48 [[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 sar1 sar2 sma1 0 0 -0.0948 -0.3631 0 0 -1.1000 s.e. 0 0 0.0522 0.0512 0 0 0.0407 sigma^2 estimated as 2.35e-07: log likelihood = 2259.05, aic = -4510.1 [[3]][[7]] NULL $aic [1] -4503.793 -4505.720 -4507.169 -4508.481 -4510.096 -4508.820 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 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/www/wessaorg/rcomp/tmp/1rsf11293672298.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 = 384 Frequency = 1 [1] 1.824807e-03 8.174740e-04 5.354491e-04 4.009835e-04 3.209008e-04 [6] 2.667672e-04 2.254551e-04 1.938985e-04 1.704193e-04 1.523739e-04 [11] 1.413362e-04 -1.649094e-03 -1.105756e-02 -4.805014e-04 4.160987e-04 [16] 6.523699e-04 7.549478e-04 -8.828540e-05 2.721695e-04 -5.597312e-04 [21] -1.284408e-03 -2.049656e-04 -5.633457e-04 2.251078e-04 -1.072092e-04 [26] 6.662035e-05 7.556391e-04 -2.627491e-04 4.103539e-04 -5.933081e-04 [31] 2.386381e-04 4.726134e-04 -5.889612e-04 9.685907e-04 -4.258288e-04 [36] -3.815464e-04 1.883205e-04 -2.238618e-04 8.571224e-04 -1.175276e-04 [41] -8.099457e-04 -1.015062e-04 5.706972e-04 -2.900048e-04 5.487534e-04 [46] -8.700835e-04 -1.663414e-04 4.143274e-05 2.617850e-04 -5.279602e-04 [51] -4.750276e-05 7.439215e-04 3.378139e-04 -4.025279e-04 -7.844031e-04 [56] -2.263963e-04 -3.666952e-04 2.758808e-06 -1.538799e-04 4.400875e-04 [61] 7.221620e-04 2.740411e-04 6.832755e-05 -8.098912e-04 -5.284037e-04 [66] 1.172011e-04 -1.455557e-04 3.797652e-04 -7.723378e-04 5.459623e-04 [71] -3.383515e-04 -2.618156e-04 -4.185660e-04 4.273126e-04 -2.962260e-04 [76] 1.198326e-04 -1.180252e-03 -1.390873e-04 1.271455e-03 -3.354498e-04 [81] 7.701979e-04 -8.899480e-05 7.242037e-04 -5.338159e-04 2.697346e-04 [86] 6.353981e-04 3.579197e-04 5.332039e-04 -2.632951e-04 1.561729e-04 [91] 3.255249e-05 -8.947236e-05 -4.478180e-04 -6.355957e-04 6.640194e-04 [96] 6.738433e-04 7.782505e-04 -6.407917e-04 -4.463925e-04 2.825266e-04 [101] -6.025650e-05 -8.549918e-04 -6.884419e-04 4.361530e-04 -1.674995e-04 [106] 6.799872e-04 4.471367e-04 5.425188e-04 -4.565480e-04 -2.926839e-04 [111] 5.532002e-05 -1.328355e-04 -1.740800e-04 4.337284e-04 3.565458e-04 [116] -5.027236e-06 -4.472111e-04 5.936461e-05 -4.411122e-04 6.173754e-04 [121] 3.797224e-04 -4.178435e-04 7.505527e-04 -7.476801e-05 1.460364e-05 [126] -3.449981e-04 7.102769e-04 -1.491024e-04 4.184536e-04 -4.008175e-04 [131] -4.797288e-04 2.040466e-04 7.579468e-06 5.564783e-04 6.753650e-04 [136] 4.097182e-04 -8.723474e-04 1.330101e-05 9.354723e-05 7.527266e-04 [141] 3.747672e-04 6.275894e-04 -1.758986e-04 -9.169254e-05 1.393987e-04 [146] -2.912360e-04 -5.791270e-04 -1.174330e-03 5.808437e-04 3.718824e-04 [151] 1.663060e-04 2.633879e-04 -8.211590e-04 5.161265e-04 2.785136e-04 [156] 1.535460e-04 -2.847020e-04 2.878430e-04 -9.877706e-04 1.123539e-03 [161] -3.416033e-05 -1.014793e-03 1.870602e-04 4.740051e-04 3.015604e-04 [166] 1.146473e-03 6.281348e-04 8.527529e-05 1.507747e-04 6.874090e-04 [171] 3.427411e-04 9.531133e-05 7.738760e-04 4.881557e-04 2.595336e-04 [176] 8.814773e-04 -1.204040e-05 -3.008887e-04 -4.791885e-04 -1.341560e-03 [181] -9.885608e-04 7.443481e-04 3.091096e-04 -1.888356e-05 -2.280504e-04 [186] -6.384579e-04 8.173048e-05 2.472615e-04 -5.425675e-04 -6.309508e-08 [191] -1.783208e-04 -3.578418e-05 -2.156689e-04 2.993814e-04 2.316982e-06 [196] 9.080523e-05 1.540194e-04 3.340183e-04 -6.694965e-04 -9.322617e-05 [201] 2.867453e-04 -1.027809e-04 -8.746457e-05 3.287194e-04 2.023078e-04 [206] 7.140879e-05 4.899760e-04 -5.010678e-05 -5.690305e-04 -1.808379e-04 [211] -1.096654e-04 -4.444007e-04 -1.208320e-04 -4.091269e-04 1.429602e-04 [216] 5.434314e-04 6.626814e-04 -2.677928e-04 9.258195e-04 6.651448e-04 [221] 3.290605e-04 3.233079e-04 4.833418e-05 -3.754401e-04 7.109099e-04 [226] -1.803791e-04 -1.495129e-05 6.062034e-04 4.292584e-04 -4.659834e-04 [231] 7.024430e-04 9.227164e-05 -6.276909e-04 5.555805e-04 8.910360e-05 [236] 1.603277e-04 -3.794217e-04 -1.842282e-04 2.323793e-04 -1.840615e-04 [241] 3.925260e-04 -1.962801e-04 5.580544e-04 -2.717641e-04 -9.543961e-05 [246] 5.634554e-04 -2.843774e-04 4.573913e-04 -6.976994e-04 2.511065e-06 [251] 3.877269e-04 5.220104e-04 6.620849e-04 -3.898194e-04 1.358372e-03 [256] -3.182687e-04 2.232853e-05 4.455290e-04 -3.914759e-04 -1.575491e-04 [261] -2.996042e-05 4.910155e-04 -1.214600e-04 -1.814511e-04 -6.542295e-05 [266] 8.720644e-04 2.427878e-04 2.200403e-05 -2.039099e-04 -4.543755e-04 [271] -8.316449e-04 -5.089679e-04 -2.845485e-04 3.982675e-04 5.782468e-04 [276] 3.139909e-04 3.032705e-04 3.514333e-04 3.854717e-04 -3.505867e-04 [281] -1.100288e-04 -5.400623e-04 -6.711478e-05 -4.823330e-04 -4.454425e-04 [286] -9.924898e-05 1.340770e-04 8.883490e-05 -2.714395e-04 5.772407e-04 [291] -4.318472e-04 1.019142e-03 8.338110e-04 3.474235e-04 3.597851e-04 [296] 8.627546e-04 -1.023382e-03 9.382514e-05 -1.288695e-04 9.111876e-04 [301] -2.204878e-04 -9.416111e-05 -1.843289e-04 8.366658e-04 -7.902458e-05 [306] -2.911280e-04 -2.612161e-07 -2.821794e-04 -7.905853e-04 3.652208e-04 [311] 6.964110e-04 1.434486e-04 -3.442686e-04 3.057210e-04 9.690532e-04 [316] -2.635459e-04 -5.720685e-05 -2.190869e-04 -6.193884e-04 -1.375319e-05 [321] 4.162238e-04 -2.599097e-04 1.095481e-04 1.694754e-04 -4.098103e-04 [326] -4.035342e-04 -2.526834e-04 6.391116e-04 3.402255e-04 -1.047247e-04 [331] -2.456507e-04 -1.624406e-04 1.268283e-03 -5.748084e-04 4.398294e-05 [336] 9.736262e-05 1.624766e-04 -5.212290e-04 -2.357618e-04 4.427678e-04 [341] 5.553551e-04 1.213760e-04 -3.871945e-04 8.981296e-04 5.219711e-04 [346] 2.472385e-04 3.576352e-04 -8.842078e-05 7.742543e-04 1.130958e-03 [351] -3.954393e-04 2.668561e-05 1.089740e-04 1.839212e-04 2.075928e-04 [356] 7.685666e-05 1.472282e-04 5.807685e-04 -9.825948e-05 -1.792380e-05 [361] 6.525258e-04 -6.763033e-04 -7.762363e-04 4.510089e-04 -5.345897e-04 [366] -2.589706e-04 3.958714e-04 -3.714204e-04 -3.070004e-04 4.462986e-04 [371] 1.691374e-05 -9.155551e-05 8.211968e-05 4.280760e-04 -2.394760e-04 [376] -1.014077e-03 2.838406e-04 -6.050129e-04 -2.149590e-04 1.219611e-04 [381] -3.000152e-04 3.859543e-04 6.057129e-04 3.285802e-04 > postscript(file="/var/www/wessaorg/rcomp/tmp/2rsf11293672298.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/www/wessaorg/rcomp/tmp/3rsf11293672298.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/www/wessaorg/rcomp/tmp/422e41293672298.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/www/wessaorg/rcomp/tmp/522e41293672298.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/www/wessaorg/rcomp/tmp/622e41293672298.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/www/wessaorg/rcomp/tmp/722e41293672298.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/www/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/wessaorg/rcomp/tmp/8gbcd1293672298.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/wessaorg/rcomp/tmp/9r3bg1293672298.tab") > > try(system("convert tmp/1rsf11293672298.ps tmp/1rsf11293672298.png",intern=TRUE)) character(0) > try(system("convert tmp/2rsf11293672298.ps tmp/2rsf11293672298.png",intern=TRUE)) character(0) > try(system("convert tmp/3rsf11293672298.ps tmp/3rsf11293672298.png",intern=TRUE)) character(0) > try(system("convert tmp/422e41293672298.ps tmp/422e41293672298.png",intern=TRUE)) character(0) > try(system("convert tmp/522e41293672298.ps tmp/522e41293672298.png",intern=TRUE)) character(0) > try(system("convert tmp/622e41293672298.ps tmp/622e41293672298.png",intern=TRUE)) character(0) > try(system("convert tmp/722e41293672298.ps tmp/722e41293672298.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 24.65 1.24 26.21