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(40.7819 + ,39.5915 + ,38.8859 + ,39.9068 + ,41.47 + ,41.5613 + ,41.6005 + ,41.4113 + ,41.84 + ,42.2892 + ,43.1521 + ,43.5998 + ,43.116 + ,42.4185 + ,42.3687 + ,42.2975 + ,42.8528 + ,43.535 + ,44.7265 + ,45.7293 + ,45.7585 + ,46.1685 + ,46.5075 + ,46.527 + ,46.601 + ,46.4607 + ,46.7135 + ,46.4113 + ,45.55 + ,44.6081 + ,44.4395 + ,44.9847 + ,45.7558 + ,45.3942 + ,45.697 + ,45.5664 + ,46.0205 + ,45.9195 + ,45.8005 + ,45.535 + ,45.4977 + ,45.5782 + ,45.7697 + ,45.2445 + ,45.0615 + ,45.2865 + ,44.791 + ,44.7625 + ,44.7644 + ,44.9973 + ,44.7265 + ,45.1465 + ,44.7465 + ,45.1795 + ,45.6515 + ,45.492 + ,45.2775 + ,45.2115 + ,45.411 + ,45.4005 + ,44.7692 + ,44.8913 + ,45.032 + ,44.879 + ,44.833 + ,44.8257 + ,44.7815 + ,44.479 + ,44.6317 + ,44.5043 + ,44.3217 + ,44.1005 + ,44.047 + ,43.6835 + ,43.7864 + ,44.1807 + ,43.9595 + ,43.937 + ,43.991 + ,43.865 + ,43.671 + ,43.93 + ,43.863 + ,43.7095 + ,43.9435 + ,43.736 + ,43.6295 + ,43.598 + ,43.8726 + ,43.8935 + ,43.5957 + ,43.7155 + ,43.528 + ,43.3415 + ,43.3374 + ,43.332 + ,43.3869 + ,43.5016 + ,43.4875 + ,43.6023 + ,43.3886 + ,43.3105 + ,43.4455 + ,43.5185 + ,43.5755 + ,43.6217 + ,43.644 + ,43.5789 + ,43.5215 + ,43.5033 + ,43.632 + ,43.263 + ,43.3717 + ,43.2745 + ,43.2647 + ,43.324 + ,43.4455 + ,43.4098 + ,43.41 + ,43.93 + ,43.8104 + ,43.54 + ,43.858 + ,43.8375 + ,43.881 + ,43.887 + ,43.8009 + ,43.7877 + ,43.811 + ,44.0625 + ,44.125 + ,44.52 + ,45.4005 + ,45.89 + ,45.189 + ,44.9035 + ,44.9351 + ,44.801 + ,43.98 + ,44.11 + ,44.2661 + ,44.361 + ,44.099 + ,43.8435 + ,43.8914 + ,44.217 + ,44.506 + ,44.54 + ,44.4465 + ,44.842 + ,44.8946 + ,44.951 + ,45.445 + ,45.0035 + ,45.769 + ,46.09 + ,45.412 + ,45.12 + ,45.48 + ,45.105 + ,45.056 + ,45.22 + ,45.39 + ,45.041 + ,44.9399 + ,44.9315 + ,45.1935 + ,45.3466 + ,45.4645 + ,45.5685 + ,45.3921 + ,45.34 + ,45.1308 + ,45.1005 + ,45.37 + ,45.2 + ,44.9614 + ,44.8015 + ,44.9152 + ,45.095 + ,44.9271 + ,44.6026 + ,44.5 + ,44.54 + ,44.5532 + ,44.407 + ,44.259 + ,44.1365 + ,44.112 + ,43.8814 + ,43.98 + ,43.7294 + ,43.9119 + ,43.955 + ,43.9 + ,43.7065 + ,43.6939 + ,43.6587 + ,43.5885 + ,43.8885 + ,43.8216 + ,43.751 + ,43.699 + ,43.7425 + ,43.639 + ,43.589 + ,43.606 + ,43.5325 + ,43.385 + ,43.3745 + ,43.236 + ,43.1957 + ,43.01 + ,43.1401 + ,43.0487 + ,43.1972 + ,43.2461 + ,43.0866 + ,43.0865 + ,43.0194 + ,43.08 + ,43.007 + ,42.9278 + ,42.9545 + ,42.7995 + ,42.9048 + ,42.9468 + ,43.08 + ,43.1274 + ,43.1625 + ,43.45 + ,43.831 + ,43.7769 + ,43.98 + ,43.92 + ,44.11 + ,44.03 + ,44.1582 + ,44.14 + ,45.07 + ,44.8737 + ,44.8505 + ,44.373 + ,44.075 + ,43.9725 + ,44.094 + ,44.191 + ,43.9685 + ,43.79 + ,43.6041 + ,43.1707 + ,42.71 + ,42.755 + ,43.3316 + ,43.5 + ,43.154 + ,43.16 + ,43.1 + ,42.85 + ,42.6175 + ,42.5 + ,42.6285 + ,42.6974 + ,43.04 + ,42.673 + ,42.5015 + ,42.538 + ,42.3735 + ,42.014 + ,41.8618 + ,42.1824 + ,42.605 + ,42.7345 + ,42.615 + ,42.465 + ,42.34 + ,42.251 + ,42.0475 + ,41.86 + ,41.685 + ,41.735 + ,41.706 + ,41.764 + ,41.58 + ,41.373 + ,41.088 + ,41.137 + ,41.1587 + ,41.185 + ,40.819 + ,40.633 + ,40.858 + ,40.794 + ,40.69 + ,40.595 + ,40.7305 + ,40.5471 + ,40.5145 + ,40.7 + ,40.7 + ,40.522 + ,40.6165 + ,40.3985 + ,40.2815 + ,40.245 + ,40.3055 + ,40.2696 + ,40.251 + ,40.127 + ,39.95 + ,39.675 + ,39.954 + ,39.8828 + ,39.62 + ,39.5415 + ,39.525 + ,39.8145 + ,39.6675 + ,39.695 + ,39.5985 + ,39.2735 + ,39.1435 + ,39.1742 + ,39.2025 + ,39.3946 + ,39.5025 + ,39.4845 + ,39.33 + ,39.295 + ,39.2675 + ,39.2535 + ,38.9845 + ,38.9285 + ,38.8592 + ,38.77 + ,38.79 + ,38.8205 + ,38.7577 + ,38.839 + ,38.78 + ,38.54 + ,38.511 + ,38.615 + ,38.898 + ,38.8691 + ,38.384 + ,38.0277 + ,37.72 + ,37.7325 + ,37.626 + ,37.603 + ,37.78 + ,38.559 + ,39.0459 + ,38.45 + ,38.505 + ,38.2885 + ,37.795 + ,37.92 + ,38.034 + ,38.029 + ,38.063 + ,37.9828 + ,37.745 + ,37.969 + ,38.007 + ,38.0615 + ,38.0912 + ,38.091 + ,38.431 + ,38.48 + ,38.35 + ,38.214 + ,38.384 + ,38.1375 + ,38.0075 + ,38.0524 + ,38.235 + ,38.31 + ,38.2615 + ,38.13 + ,38.282 + ,38.581 + ,39.0801 + ,39.0387 + ,39.1015 + ,39.1503 + ,39.14 + ,39.0275 + ,38.7665 + ,38.691 + ,38.849 + ,39.1644 + ,39.4907 + ,39.5095 + ,39.2795 + ,39.0437 + ,39.1355 + ,39.143 + ,39.185 + ,39.355 + ,39.297 + ,39.4514 + ,39.4173 + ,39.4305 + ,39.384 + ,39.3261 + ,39.301 + ,39.35 + ,39.64 + ,39.4723 + ,39.3685 + ,39.1906 + ,39.1183 + ,39.1325 + ,39.1144 + ,39.1614 + ,39.0908 + ,38.9199 + ,38.913 + ,38.9655 + ,39.029 + ,39.089 + ,39.07 + ,39.0046 + ,39.1038 + ,39.3572 + ,39.388 + ,39.382 + ,39.4398 + ,39.2537 + ,39.2301 + ,39.2763 + ,39.282 + ,39.3325 + ,39.557 + ,40.1 + ,40.5875 + ,40.485 + ,40.55 + ,40.7955 + ,41.456 + ,41.3557 + ,41.374 + ,41.2235 + ,41.15 + ,41.3725 + ,41.6923 + ,41.8 + ,41.8045 + ,41.64 + ,41.36 + ,41.5745 + ,41.593 + ,41.575 + ,41.68 + ,42.0055 + ,42.3188 + ,42.565 + ,42.3575 + ,42.29 + ,42.695 + ,43.0028 + ,42.4507 + ,42.4705 + ,42.2875 + ,42.3172 + ,42.55 + ,42.7523 + ,42.8993 + ,43.1555 + ,43.1885 + ,43.43 + ,43.31 + ,42.815 + ,42.7017 + ,42.28 + ,41.922 + ,42.17 + ,42.1962 + ,42.3215 + ,42.3173 + ,42.391 + ,42.463 + ,42.4125 + ,42.304 + ,41.813 + ,41.651 + ,41.539 + ,41.1575 + ,40.9545) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '1' > 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 <- 5 #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.4323307 0.04697029 -0.1802600 0.7200353 0.4434414 0.07569118 [2,] -0.3054273 0.00000000 -0.1657414 0.5894743 0.4460209 0.08320000 [3,] -0.2744827 0.00000000 -0.1553011 0.5603259 0.0000000 0.05342668 [4,] -0.3013804 0.00000000 -0.1664647 0.5812934 0.0000000 0.05033632 [5,] -0.3160739 0.00000000 -0.1650526 0.5915175 0.0000000 0.00000000 [6,] 0.0000000 0.00000000 -0.1034355 0.3052662 0.0000000 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.47608288 [2,] -0.48751495 [3,] -0.04626181 [4,] 0.00000000 [5,] 0.00000000 [6,] 0.00000000 [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.03238 0.52881 0.00045 0.00032 0.38210 0.13298 0.34858 [2,] 0.11514 NA 0.00870 0.00077 0.36657 0.08791 0.32366 [3,] 0.15034 NA 0.01036 0.00117 NA 0.27496 0.34419 [4,] 0.12888 NA 0.00876 0.00111 NA 0.30070 NA [5,] 0.13270 NA 0.01353 0.00171 NA NA NA [6,] NA NA 0.02636 0.00000 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.4323 0.0470 -0.1803 0.7200 0.4434 0.0757 -0.4761 s.e. 0.2015 0.0745 0.0510 0.1984 0.5069 0.0503 0.5074 sigma^2 estimated as 0.06853: log likelihood = -38.69, aic = 93.38 [[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.4323 0.0470 -0.1803 0.7200 0.4434 0.0757 -0.4761 s.e. 0.2015 0.0745 0.0510 0.1984 0.5069 0.0503 0.5074 sigma^2 estimated as 0.06853: log likelihood = -38.69, aic = 93.38 [[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.3054 0 -0.1657 0.5895 0.4460 0.0832 -0.4875 s.e. 0.1935 0 0.0629 0.1742 0.4935 0.0487 0.4934 sigma^2 estimated as 0.06857: log likelihood = -38.82, aic = 91.64 [[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.2745 0 -0.1553 0.5603 0 0.0534 -0.0463 s.e. 0.1905 0 0.0603 0.1716 0 0.0489 0.0489 sigma^2 estimated as 0.06871: log likelihood = -39.3, aic = 90.61 [[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.3014 0 -0.1665 0.5813 0 0.0503 0 s.e. 0.1981 0 0.0632 0.1772 0 0.0486 0 sigma^2 estimated as 0.06884: log likelihood = -39.75, aic = 89.5 [[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.3161 0 -0.1651 0.5915 0 0 0 s.e. 0.2099 0 0.0666 0.1876 0 0 0 sigma^2 estimated as 0.06899: log likelihood = -40.28, aic = 88.57 [[3]][[7]] NULL $aic [1] 93.37637 91.63920 90.60547 89.49627 88.56759 89.44788 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/html/rcomp/tmp/1u3li1293294557.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 = 491 Frequency = 1 [1] 0.0407818775 -1.1334899018 -0.4126793687 1.0004192679 1.0981639258 [6] -0.1800266193 0.3429785889 -0.1216508838 0.4559179768 0.3214895754 [11] 0.7834853500 0.3277535273 -0.4620238013 -0.4346975013 0.0607636603 [16] -0.2027357168 0.5375930443 0.5315005352 1.0809820175 0.8316360326 [21] -0.0331694219 0.6355098744 0.2581898798 -0.0212552335 0.1604078675 [26] -0.1558417470 0.3038564760 -0.3898190408 -0.7493896388 -0.7291320792 [31] -0.0848945559 0.3999667111 0.5513731148 -0.4718501150 0.5576019715 [36] -0.2374520542 0.4935947585 -0.1994628302 -0.0544935844 -0.1959284853 [41] -0.0219928169 0.0620783142 0.1364020659 -0.5515125151 -0.0094859823 [46] 0.2043771737 -0.6319616885 0.1584971386 -0.0637250976 0.1894114689 [51] -0.3139305812 0.5204162150 -0.5366434927 0.5793081956 0.3355111793 [56] -0.2747948956 -0.0309000055 -0.0376151199 0.1745632261 -0.0861042462 [61] -0.5945800805 0.3071950560 -0.0041516819 -0.2102703355 0.0501722015 [66] -0.0282942310 -0.0550238604 -0.2915153123 0.2283191625 -0.2214856203 [71] -0.1417836193 -0.1698440690 -0.0439775202 -0.3845350944 0.1789567230 [76] 0.3121376556 -0.3412035709 0.1263962505 0.0372029958 -0.1674478749 [81] -0.1384906496 0.2885141432 -0.1765946518 -0.1022383360 0.2887070505 [86] -0.3153725027 -0.0108725629 -0.0201082457 0.2422896275 -0.0532027610 [91] -0.2649228475 0.2277031405 -0.2808751384 -0.1287739754 0.0328975785 [96] -0.0571027673 0.0561881705 0.0981394564 -0.0367888108 0.1411659735 [101] -0.2419853200 -0.0048336876 0.1321218790 0.0022458269 0.0658543407 [106] 0.0475443249 0.0208281578 -0.0609637708 -0.0342898432 -0.0123789274 [111] 0.1195248798 -0.4084963655 0.2306975139 -0.1780621088 0.0039000454 [116] 0.0718367522 0.0817073707 -0.0472458730 0.0266505435 0.5243528472 [121] -0.2712978246 -0.1476920167 0.4057233942 -0.1797212778 0.0986985347 [126] 0.0138540437 -0.0957820451 0.0234225811 0.0062632727 0.2409486550 [131] -0.0027114490 0.4202042175 0.7983017900 0.3059094020 -0.6620367826 [136] 0.0298673715 0.0044870832 -0.2424681527 -0.7670838843 0.3294625129 [141] -0.0198267950 0.0204588213 -0.2226494908 -0.1808455813 0.0897799329 [146] 0.2443897469 0.2051819093 0.0118826969 -0.0360411696 0.4349662827 [151] -0.0740711425 0.1014074460 0.5171206087 -0.5825636031 0.9798589007 [156] 0.0648869011 -0.6877927438 0.0268911208 0.3047817371 -0.5534028079 [161] 0.1116243567 0.1419035647 0.0760029419 -0.3483120807 0.0216915250 [166] -0.0251270439 0.2166046940 0.0910990798 0.1110177768 0.1188399497 [171] -0.1885546630 0.0231376493 -0.2221883028 0.0058903191 0.2478394900 [176] -0.2659484851 -0.1400204770 -0.1080089910 0.0989900381 0.1178017055 [181] -0.2071435949 -0.2362732643 -0.0357297545 0.0009932509 -0.0283041494 [186] -0.1422198246 -0.1034823869 -0.1058886039 -0.0247147897 -0.2481523713 [191] 0.1522808755 -0.3135557047 0.2507044237 -0.0312383740 -0.0642613592 [196] -0.1427502402 0.0177927288 -0.0587851377 -0.0784910498 0.3221607771 [201] -0.1684514138 -0.0036900796 -0.0226162815 0.0294000601 -0.1187941505 [206] -0.0210275691 0.0208142682 -0.0975216956 -0.1212982753 0.0174350433 [211] -0.1642632790 -0.0112568982 -0.1935121801 0.1630111229 -0.1533543365 [216] 0.1796723431 0.0110309903 -0.1656548195 0.0719842512 -0.1016404790 [221] 0.0731876663 -0.0971542112 -0.0558800120 0.0447231398 -0.1850641892 [226] 0.1527050799 -0.0106382384 0.1271846508 0.0316491431 0.0382930932 [231] 0.2979281716 0.3034650206 -0.1073873564 0.2969745365 -0.1085859674 [236] 0.2263367177 -0.1203058934 0.1641739698 -0.0434310983 0.9367334985 [241] -0.4352857602 0.1692298802 -0.4314363989 -0.2261229525 -0.0667635683 [246] 0.0497816053 0.0567706055 -0.2423395309 -0.0854244782 -0.1757790172 [251] -0.4249059902 -0.3758090058 0.0909990596 0.4654619751 -0.0007204289 [256] -0.2849196328 0.1603427227 -0.1251542214 -0.2520417356 -0.1614410676 [261] -0.1053951303 0.1124412176 0.0046298126 0.3422451942 -0.4399478312 [266] -0.0158901602 0.0482396615 -0.2420722251 -0.2966107293 -0.0843537182 [271] 0.2952390887 0.2899577884 0.0664367246 -0.0649510344 -0.0795999156 [276] -0.1039520299 -0.0867435865 -0.2050781258 -0.1511453231 -0.1595484427 [281] 0.0554745467 -0.0769578392 0.0654715538 -0.1961426504 -0.1539223180 [286] -0.2498065053 0.0763141648 -0.0421194389 0.0110331881 -0.3561259999 [291] -0.0874466526 0.2222773581 -0.1847735808 -0.0456317132 -0.0637428882 [296] 0.1326146415 -0.2361813392 0.0334574380 0.1777699615 -0.0767929845 [301] -0.1379563203 0.1504596834 -0.2771305511 -0.0513559133 -0.0275052544 [306] 0.0292516653 -0.0533915579 -0.0043894340 -0.1172968635 -0.1527354090 [311] -0.2436693967 0.3157478554 -0.1990000756 -0.2129819097 0.0104679854 [316] -0.0592555493 0.2759596416 -0.2316881885 0.1153613844 -0.1082635072 [321] -0.3157241124 -0.0414287400 -0.0018113669 -0.0145671828 0.1882047932 [326] 0.0623584880 -0.0161107700 -0.1189529160 0.0043384896 -0.0440998281 [331] -0.0221068454 -0.2661252912 0.0118549339 -0.0963232789 -0.0985261775 [336] 0.0408432166 0.0012238527 -0.0686063706 0.1053334794 -0.0905756814 [341] -0.2154365661 0.0359955366 0.0638037593 0.2385180149 -0.0853251853 [346] -0.4265977204 -0.2105775470 -0.3005268589 0.0129439140 -0.1690138834 [351] -0.0074738993 0.1762143997 0.7131330771 0.3074946819 -0.5946777713 [356] 0.3469898646 -0.3240023866 -0.4686317889 0.2552993178 -0.0332386731 [361] -0.0307597911 0.0712461657 -0.0927808401 -0.2090929010 0.2781315203 [366] -0.0689563256 0.0680501666 0.0436449556 -0.0103573594 0.3550587137 [371] -0.0486562456 -0.0857643656 -0.0702405901 0.1766500627 -0.3187158799 [376] -0.0418333593 0.0566145012 0.1226177749 0.0387276967 -0.0402917018 [381] -0.0928577266 0.1777421966 0.2339005630 0.4335454059 -0.1150091969 [386] 0.1670952331 0.0521874586 -0.0325785670 -0.0861194627 -0.2375625788 [391] -0.0191729139 0.1269091097 0.2471919820 0.2673098592 -0.0101052201 [396] -0.1660227923 -0.1564349400 0.1129067616 -0.0682328469 0.0458120663 [401] 0.1713282981 -0.1043732249 0.2047385133 -0.0783456519 0.0391916511 [406] -0.0400262445 -0.0545495085 -0.0089549965 0.0386886336 0.2730460708 [411] -0.2416929123 -0.0057524288 -0.1594405472 -0.0618970053 0.0108285529 [416] -0.0493798935 0.0585548278 -0.0880369837 -0.1441268549 0.0320939970 [421] 0.0196822119 0.0402440126 0.0551267936 -0.0239787640 -0.0467407032 [426] 0.1160798674 0.2129552597 -0.0258680726 0.0354097175 0.0767824271 [431] -0.2081654556 0.0397218374 0.0247845348 -0.0250741668 0.0632381881 [436] 0.2106806699 0.4902780929 0.3774552279 -0.1346310152 0.2018626088 [441] 0.2271026988 0.5868430322 -0.2279326739 0.1619443767 -0.1314915139 [446] -0.0598443741 0.2376880242 0.2246893994 0.0637413617 0.0375612440 [451] -0.1325119667 -0.2358348444 0.2662424750 -0.0983403871 -0.0001973095 [456] 0.1348311724 0.2819862372 0.2464113213 0.2167998800 -0.2041988880 [461] 0.0394128689 0.4009875665 0.1643703533 -0.5631814372 0.2452735823 [466] -0.2710221543 0.0410472582 0.2211752660 0.1148483359 0.1479090193 [471] 0.2535963481 -0.0026383895 0.2777538319 -0.1656779140 -0.4294807473 [476] 0.0241489972 -0.4916020496 -0.2821982137 0.2830702517 -0.1324573738 [481] 0.1528431493 -0.0140722807 0.0850208692 0.0656844118 -0.0672893775 [486] -0.0724945088 -0.4705284607 -0.0472016364 -0.1531915954 -0.4073256155 [491] -0.1093804992 > postscript(file="/var/www/html/rcomp/tmp/2u3li1293294557.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/html/rcomp/tmp/3u3li1293294557.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/html/rcomp/tmp/45u3l1293294557.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/html/rcomp/tmp/55u3l1293294557.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/html/rcomp/tmp/65u3l1293294557.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/html/rcomp/tmp/75u3l1293294557.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/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/8tvzf1293294557.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/94mh01293294557.tab") > > try(system("convert tmp/1u3li1293294557.ps tmp/1u3li1293294557.png",intern=TRUE)) character(0) > try(system("convert tmp/2u3li1293294557.ps tmp/2u3li1293294557.png",intern=TRUE)) character(0) > try(system("convert tmp/3u3li1293294557.ps tmp/3u3li1293294557.png",intern=TRUE)) character(0) > try(system("convert tmp/45u3l1293294557.ps tmp/45u3l1293294557.png",intern=TRUE)) character(0) > try(system("convert tmp/55u3l1293294557.ps tmp/55u3l1293294557.png",intern=TRUE)) character(0) > try(system("convert tmp/65u3l1293294557.ps tmp/65u3l1293294557.png",intern=TRUE)) character(0) > try(system("convert tmp/75u3l1293294557.ps tmp/75u3l1293294557.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.443 1.220 13.643