R version 2.8.0 (2008-10-20) Copyright (C) 2008 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. Natural language support but running in an English locale 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(1.2998 + ,1.3146 + ,1.3225 + ,1.3321 + ,1.3339 + ,1.3496 + ,1.3647 + ,1.3674 + ,1.3647 + ,1.3481 + ,1.3612 + ,1.3626 + ,1.3711 + ,1.37 + ,1.377 + ,1.3945 + ,1.3917 + ,1.4084 + ,1.4244 + ,1.4014 + ,1.4018 + ,1.3926 + ,1.3857 + ,1.3857 + ,1.3803 + ,1.3912 + ,1.4031 + ,1.3934 + ,1.4016 + ,1.3861 + ,1.3859 + ,1.3896 + ,1.4089 + ,1.4101 + ,1.3958 + ,1.3833 + ,1.3936 + ,1.3874 + ,1.397 + ,1.3856 + ,1.378 + ,1.3705 + ,1.3726 + ,1.3648 + ,1.3611 + ,1.346 + ,1.3477 + ,1.3412 + ,1.3323 + ,1.3364 + ,1.312 + ,1.3074 + ,1.306 + ,1.3078 + ,1.2989 + ,1.285 + ,1.2801 + ,1.2725 + ,1.2715 + ,1.2697 + ,1.2744 + ,1.2874 + ,1.2834 + ,1.2818 + ,1.28 + ,1.268 + ,1.27 + ,1.2713 + ,1.2693 + ,1.2613 + ,1.2611 + ,1.2704 + ,1.2711 + ,1.2836 + ,1.288 + ,1.286 + ,1.282 + ,1.2799 + ,1.279 + ,1.3016 + ,1.3133 + ,1.3253 + ,1.3176 + ,1.3184 + ,1.3206 + ,1.3221 + ,1.3073 + ,1.3028 + ,1.3069 + ,1.2992 + ,1.3033 + ,1.2931 + ,1.2897 + ,1.285 + ,1.2817 + ,1.2844 + ,1.2957 + ,1.3 + ,1.2828 + ,1.2703 + ,1.2569 + ,1.2572 + ,1.2637 + ,1.266 + ,1.2567 + ,1.2579 + ,1.2531 + ,1.2548 + ,1.2328 + ,1.2271 + ,1.2198 + ,1.2339 + ,1.2294 + ,1.2262 + ,1.2271 + ,1.2258 + ,1.2391 + ,1.2372 + ,1.2363 + ,1.2277 + ,1.2258 + ,1.2249 + ,1.2127 + ,1.2045 + ,1.201 + ,1.1942 + ,1.1959 + ,1.206 + ,1.2268 + ,1.2218 + ,1.2155 + ,1.2307 + ,1.2384 + ,1.2255 + ,1.2309 + ,1.2223 + ,1.236 + ,1.2497 + ,1.2334 + ,1.227 + ,1.2428 + ,1.2349 + ,1.2492 + ,1.2587 + ,1.2686 + ,1.2698 + ,1.2969 + ,1.2746 + ,1.2727 + ,1.2924 + ,1.3089 + ,1.3238 + ,1.3315 + ,1.3256 + ,1.3245 + ,1.329 + ,1.3321 + ,1.3311 + ,1.3339 + ,1.3373 + ,1.3486 + ,1.3432 + ,1.3535 + ,1.3544 + ,1.3615 + ,1.3583 + ,1.3585 + ,1.3384 + ,1.3296 + ,1.334 + ,1.3396 + ,1.3468 + ,1.3479 + ,1.3482 + ,1.3471 + ,1.3353 + ,1.3356 + ,1.3338 + ,1.3519 + ,1.3471 + ,1.3548 + ,1.366 + ,1.3756 + ,1.3723 + ,1.3705 + ,1.3765 + ,1.3657 + ,1.361 + ,1.3557 + ,1.3662 + ,1.3582 + ,1.3668 + ,1.3641 + ,1.3548 + ,1.3525 + ,1.357 + ,1.3489 + ,1.3547 + ,1.3577 + ,1.3626 + ,1.3519 + ,1.3567 + ,1.3726 + ,1.3649 + ,1.3607 + ,1.3572 + ,1.3718 + ,1.374 + ,1.376 + ,1.3675 + ,1.3691 + ,1.3847 + ,1.3984 + ,1.3937 + ,1.3913 + ,1.3966 + ,1.3999 + ,1.4072 + ,1.4085 + ,1.4151 + ,1.4135 + ,1.4064 + ,1.4132 + ,1.4279 + ,1.4369 + ,1.4374 + ,1.4486 + ,1.4563 + ,1.4481 + ,1.4528 + ,1.4273 + ,1.4304 + ,1.435 + ,1.4442 + ,1.4389 + ,1.4406 + ,1.4338 + ,1.4433 + ,1.4405 + ,1.4398 + ,1.4276 + ,1.4279 + ,1.4368 + ,1.4337 + ,1.4343 + ,1.456 + ,1.4541 + ,1.4647 + ,1.4757 + ,1.473 + ,1.4768 + ,1.4774 + ,1.4787 + ,1.5068 + ,1.512 + ,1.509 + ,1.5074 + ,1.5023 + ,1.4918 + ,1.5071 + ,1.5083 + ,1.4969 + ,1.4968 + ,1.4815 + ,1.4863 + ,1.4957 + ,1.4875 + ,1.4965 + ,1.4868 + ,1.4922 + ,1.5037 + ,1.4966 + ,1.4984 + ,1.4862 + ,1.4867 + ,1.4761 + ,1.4658 + ,1.4772 + ,1.48 + ,1.4788 + ,1.4785 + ,1.4874 + ,1.5019 + ,1.502 + ,1.5 + ,1.4921 + ,1.4971 + ,1.4918 + ,1.4869 + ,1.4864 + ,1.4881 + ,1.4864 + ,1.4765 + ,1.475 + ,1.4763 + ,1.4694 + ,1.4722 + ,1.4616 + ,1.4537 + ,1.4539 + ,1.4643 + ,1.4549 + ,1.465 + ,1.467 + ,1.4768 + ,1.4783 + ,1.478 + ,1.4658 + ,1.4705 + ,1.4712 + ,1.4671 + ,1.4611 + ,1.4561 + ,1.4594 + ,1.4545 + ,1.4522 + ,1.4473 + ,1.433 + ,1.4262 + ,1.4335 + ,1.422 + ,1.4314 + ,1.4272 + ,1.4364 + ,1.4268 + ,1.427 + ,1.4324 + ,1.4323 + ,1.433 + ,1.4243 + ,1.4112 + ,1.4101 + ,1.4072 + ,1.4294 + ,1.4293 + ,1.417 + ,1.4166 + ,1.4202 + ,1.4357 + ,1.437 + ,1.441 + ,1.4384 + ,1.4303 + ,1.4138 + ,1.4053 + ,1.4104 + ,1.4229 + ,1.4269 + ,1.4227 + ,1.4229 + ,1.4191 + ,1.4223 + ,1.4217 + ,1.409 + ,1.413 + ,1.4089 + ,1.3991 + ,1.3975 + ,1.3901 + ,1.399 + ,1.3901 + ,1.4019 + ,1.3897 + ,1.4009 + ,1.4049 + ,1.4096 + ,1.4134 + ,1.4058 + ,1.4096 + ,1.394 + ,1.4029 + ,1.3978 + ,1.3858 + ,1.3932 + ,1.392 + ,1.384 + ,1.389 + ,1.385 + ,1.4004 + ,1.3969 + ,1.4102 + ,1.3959 + ,1.3866 + ,1.4177 + ,1.4095 + ,1.4207 + ,1.4238 + ,1.422 + ,1.4098 + ,1.3856 + ,1.3901 + ,1.3908 + ,1.401 + ,1.3972 + ,1.3771 + ,1.369 + ,1.3612 + ,1.3494 + ,1.3518 + ,1.3563 + ,1.3623 + ,1.3683 + ,1.3574 + ,1.3425 + ,1.3363 + ,1.3322 + ,1.3403 + ,1.3223 + ,1.3275 + ,1.3266 + ,1.2992 + ,1.3125 + ,1.3232 + ,1.305 + ,1.2947 + ,1.2932 + ,1.2966 + ,1.3058 + ,1.3196 + ,1.3173 + ,1.3276 + ,1.3273 + ,1.3231 + ,1.3255 + ,1.3496 + ,1.3425 + ,1.3392 + ,1.3246 + ,1.3308 + ,1.3193 + ,1.3295 + ,1.3607 + ,1.3494 + ,1.3507 + ,1.3558 + ,1.3549 + ,1.3671 + ,1.313 + ,1.2942 + ,1.3042 + ,1.2905 + ,1.2782 + ,1.2786 + ,1.2783 + ,1.2565 + ,1.2658 + ,1.2555 + ,1.2555 + ,1.2615 + ,1.2596 + ,1.2644 + ,1.2782 + ,1.2795 + ,1.2763 + ,1.2798 + ,1.2591 + ,1.2705 + ,1.2596 + ,1.2634 + ,1.2765 + ,1.2823 + ,1.2833 + ,1.2938 + ,1.2967 + ,1.3008 + ,1.2796 + ,1.2829 + ,1.2818 + ,1.2849 + ,1.276 + ,1.2816 + ,1.3111 + ,1.326 + ,1.3174 + ,1.299 + ,1.2795 + ,1.2984 + ,1.291 + ,1.293 + ,1.3182 + ,1.327 + ,1.3085 + ,1.3173 + ,1.3262 + ,1.3394 + ,1.3684 + ,1.3617 + ,1.3595 + ,1.3332 + ,1.3582 + ,1.3866) > par9 = '1' > par8 = '2' > par7 = '0' > par6 = '3' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1.9' > 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 <- 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.009650010 -0.03934618 -0.03554736 0.04551335 0.05516735 0.04408059 [2,] -0.009531101 -0.03935737 -0.03576160 0.08960039 0.05132291 0.00000000 [3,] 0.000000000 -0.03917990 -0.03549894 0.08956789 0.05148923 0.00000000 [4,] 0.000000000 -0.03865755 0.00000000 0.08872489 0.05025815 0.00000000 [5,] 0.000000000 0.00000000 0.00000000 0.08914713 0.04420294 0.00000000 [6,] 0.000000000 0.00000000 0.00000000 0.09203729 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 [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.83371 0.39473 0.46116 0.98700 0.82222 0.98743 [2,] 0.83407 0.39455 0.43760 0.05200 0.27907 NA [3,] NA 0.39662 0.44078 0.05208 0.27742 NA [4,] NA 0.35131 NA 0.03524 0.25760 NA [5,] NA NA NA 0.05337 0.34581 NA [6,] NA NA NA 0.04595 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 sar1 sar2 sma1 -0.0097 -0.0393 -0.0355 0.0455 0.0552 0.0441 s.e. 0.0459 0.0462 0.0482 2.7926 0.2454 2.7973 sigma^2 estimated as 0.0006499: log likelihood = 1102.65, aic = -2191.31 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 sar1 sar2 sma1 -0.0097 -0.0393 -0.0355 0.0455 0.0552 0.0441 s.e. 0.0459 0.0462 0.0482 2.7926 0.2454 2.7973 sigma^2 estimated as 0.0006499: log likelihood = 1102.65, aic = -2191.31 [[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 sar1 sar2 sma1 -0.0095 -0.0394 -0.0358 0.0896 0.0513 0 s.e. 0.0455 0.0462 0.0460 0.0460 0.0474 0 sigma^2 estimated as 0.0006499: log likelihood = 1102.66, aic = -2193.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 sar1 sar2 sma1 0 -0.0392 -0.0355 0.0896 0.0515 0 s.e. 0 0.0462 0.0460 0.0460 0.0474 0 sigma^2 estimated as 0.00065: log likelihood = 1102.64, aic = -2195.27 [[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 sar1 sar2 sma1 0 -0.0387 0 0.0887 0.0503 0 s.e. 0 0.0414 0 0.0420 0.0443 0 sigma^2 estimated as 0.0006508: log likelihood = 1102.34, aic = -2196.68 [[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 sar1 sar2 sma1 0 0 0 0.0891 0.0442 0 s.e. 0 0 0 0.0460 0.0468 0 sigma^2 estimated as 0.0006517: log likelihood = 1101.99, aic = -2197.98 $aic [1] -2191.307 -2193.316 -2195.272 -2196.677 -2197.977 -2199.088 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 > postscript(file="/var/www/html/freestat/rcomp/tmp/19h241292882578.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] 1.645755e-03 3.559598e-02 1.914898e-02 2.340857e-02 4.406069e-03 [6] 3.865750e-02 3.439403e-02 4.992137e-03 -8.978856e-03 -4.186860e-02 [11] 2.905571e-02 -1.436102e-03 1.993892e-02 -3.210299e-03 2.120039e-02 [16] 3.996335e-02 -9.152086e-03 4.074595e-02 4.213307e-02 -5.938936e-02 [21] -4.391701e-03 -2.313579e-02 -2.239781e-02 -3.584529e-03 -9.201840e-03 [26] 2.571457e-02 3.297311e-02 -2.524785e-02 1.921820e-02 -3.584701e-02 [31] -3.031591e-03 7.761943e-03 5.261593e-02 1.228110e-03 -3.270207e-02 [36] -3.311619e-02 2.410259e-02 -1.917042e-02 2.335966e-02 -2.411640e-02 [41] -1.644891e-02 -2.173172e-02 4.522027e-03 -2.198474e-02 -5.061322e-03 [46] -3.454161e-02 4.751541e-03 -1.589182e-02 -2.129134e-02 1.221597e-02 [51] -5.547736e-02 -1.067997e-02 -2.181426e-03 7.177941e-03 -2.195308e-02 [56] -2.627093e-02 -1.084044e-02 -1.697137e-02 -1.776677e-03 -2.775626e-03 [61] 1.669261e-02 3.239540e-02 -7.773872e-03 -3.785279e-03 -2.946597e-03 [66] -2.787073e-02 2.472024e-03 4.708527e-03 -4.269680e-03 -1.821677e-02 [71] 1.569077e-03 2.006081e-02 1.798030e-03 3.019172e-02 1.234600e-02 [76] -3.473751e-03 -1.167303e-02 -5.268543e-03 -4.565337e-03 5.390700e-02 [81] 2.874161e-02 2.914080e-02 -1.842984e-02 8.305349e-04 8.640035e-05 [86] 1.350663e-03 -3.815911e-02 -8.968534e-03 9.818501e-03 -2.143131e-02 [91] 8.296049e-03 -2.259753e-02 -6.332148e-03 -1.217781e-02 -6.430410e-03 [96] 5.377960e-03 3.077601e-02 1.153576e-02 -4.057560e-02 -2.806645e-02 [101] -3.243604e-02 -6.232790e-04 1.464889e-02 9.561802e-03 -1.879203e-02 [106] 5.319622e-03 -1.244852e-02 2.147028e-03 -4.953169e-02 -9.798358e-03 [111] -1.549104e-02 3.316898e-02 -1.133880e-02 -3.017233e-03 4.180889e-03 [116] -1.609411e-03 2.812385e-02 -3.630864e-03 8.301377e-04 -1.932169e-02 [121] -3.339266e-03 -6.195597e-03 -2.685233e-02 -1.796874e-02 -6.185274e-03 [126] -1.467847e-02 2.626694e-03 2.529068e-02 4.887818e-02 -9.826390e-03 [131] -1.275510e-02 3.437158e-02 1.689200e-02 -3.295738e-02 1.370812e-02 [136] -1.769075e-02 2.808762e-02 2.907884e-02 -3.707526e-02 -1.524920e-02 [141] 3.868049e-02 -2.252534e-02 2.941912e-02 2.678891e-02 2.398004e-02 [146] 4.578047e-04 6.468865e-02 -5.746815e-02 -4.797325e-03 4.540365e-02 [151] 3.786112e-02 3.131438e-02 2.215699e-02 -1.505391e-02 -7.893264e-03 [156] 7.361880e-03 1.535270e-03 -1.793497e-03 8.377169e-03 6.552062e-03 [161] 2.525665e-02 -1.568632e-02 2.499480e-02 2.271954e-03 1.713852e-02 [166] -1.100104e-02 1.358953e-03 -5.215491e-02 -2.217560e-02 8.864999e-03 [171] 1.329390e-02 1.838863e-02 6.056818e-03 2.578389e-03 -4.483649e-03 [176] -3.007708e-02 -8.730763e-04 -2.469149e-03 4.573051e-02 -1.217855e-02 [181] 2.117106e-02 2.721734e-02 2.450163e-02 -1.237553e-02 -3.358755e-03 [186] 1.474977e-02 -2.979607e-02 -1.376690e-02 -1.450406e-02 2.726004e-02 [191] -2.227523e-02 2.277451e-02 -6.808626e-03 -2.174352e-02 -7.885111e-03 [196] 1.235586e-02 -2.092114e-02 1.558153e-02 1.016144e-02 1.162731e-02 [201] -2.687711e-02 1.282906e-02 3.897562e-02 -1.904475e-02 -1.138466e-02 [206] -6.874919e-03 3.651774e-02 1.358086e-03 6.459769e-03 -2.106731e-02 [211] 5.995506e-03 3.572594e-02 3.278259e-02 -1.165103e-02 -3.763444e-03 [216] 1.360653e-02 3.332385e-03 1.544846e-02 4.211635e-03 1.860025e-02 [221] -5.541667e-03 -2.088086e-02 1.437298e-02 3.854072e-02 2.237625e-02 [226] 1.086683e-03 3.086491e-02 1.807004e-02 -2.536025e-02 9.617155e-03 [231] -6.720561e-02 6.294365e-03 9.476689e-03 2.451363e-02 -1.615213e-02 [236] 1.042284e-02 -1.993963e-02 2.305685e-02 -8.594827e-03 -1.150810e-03 [241] -2.948333e-02 2.022757e-03 2.060011e-02 -8.566879e-03 2.360143e-03 [246] 6.008905e-02 -4.337840e-03 2.511214e-02 3.061925e-02 -7.334358e-03 [251] 6.540266e-03 2.035788e-03 -4.500170e-05 7.429281e-02 1.489024e-02 [256] -1.171364e-02 -4.321076e-03 -1.556207e-02 -3.681775e-02 4.090428e-02 [261] 3.583037e-03 -3.092696e-02 8.195366e-04 -4.242697e-02 8.645282e-03 [266] 2.565761e-02 -1.934810e-02 2.515563e-02 -2.143702e-02 1.167531e-02 [271] 2.900715e-02 -1.606096e-02 2.745620e-03 -2.904058e-02 -5.269643e-04 [276] -3.261888e-02 -2.497741e-02 2.914295e-02 1.169473e-02 -4.013615e-03 [281] 3.572681e-04 2.743586e-02 3.660439e-02 1.068691e-03 -5.247639e-03 [286] -2.022886e-02 1.271456e-02 -1.933823e-02 -1.368317e-02 -7.257995e-04 [291] 6.575525e-03 -6.898426e-03 -2.725183e-02 -2.869634e-03 3.868858e-03 [296] -1.803387e-02 7.337203e-03 -2.540535e-02 -2.012059e-02 2.796278e-04 [301] 2.921470e-02 -2.556812e-02 3.069509e-02 7.418884e-03 2.616516e-02 [306] 2.395919e-03 1.094649e-03 -3.397296e-02 1.307006e-02 -4.919271e-04 [311] -1.260101e-02 -1.488462e-02 -1.160956e-02 7.440275e-03 -1.439652e-02 [316] -5.315328e-03 -1.153700e-02 -3.508688e-02 -1.916433e-02 2.021676e-02 [321] -2.907277e-02 2.646081e-02 -7.052502e-03 2.534516e-02 -2.632053e-02 [326] 3.477493e-03 1.253625e-02 2.386237e-03 4.734211e-04 -2.138803e-02 [331] -3.279316e-02 -5.197310e-03 -6.990342e-03 5.653818e-02 2.883002e-03 [336] -2.909109e-02 -1.411591e-03 1.004883e-02 3.535016e-02 4.452272e-03 [341] 1.491399e-02 -6.638975e-03 -2.179623e-02 -4.921014e-02 -2.228950e-02 [346] 1.366238e-02 3.315105e-02 1.193654e-02 -8.931441e-03 2.331571e-03 [351] -1.154679e-02 5.746203e-03 -1.555615e-03 -3.010560e-02 1.128643e-02 [356] -1.031905e-02 -2.745007e-02 -4.433197e-03 -1.553109e-02 2.186377e-02 [361] -2.142594e-02 3.215552e-02 -3.085787e-02 3.186724e-02 7.815667e-03 [366] 1.464756e-02 8.264189e-03 -1.669626e-02 8.099631e-03 -4.209655e-02 [371] 2.279350e-02 -1.533589e-02 -2.756451e-02 1.675912e-02 5.368379e-05 [376] -2.299254e-02 1.348268e-02 -6.595647e-03 3.730325e-02 -6.944704e-03 [381] 3.509478e-02 -3.740804e-02 -2.151834e-02 7.574917e-02 -2.033701e-02 [386] 2.693177e-02 1.080881e-02 -2.126366e-03 -4.058200e-02 -5.985585e-02 [391] 7.375075e-03 2.697336e-03 2.763526e-02 -1.048266e-02 -4.478876e-02 [396] -2.278121e-02 -2.012783e-02 -3.160081e-02 8.248349e-03 1.854924e-02 [401] 1.634496e-02 1.675641e-02 -2.589311e-02 -3.718834e-02 -1.405872e-02 [406] -1.053311e-02 1.949920e-02 -4.050365e-02 1.576893e-02 -1.336343e-03 [411] -6.627785e-02 2.968205e-02 3.121652e-02 -4.371229e-02 -2.390561e-02 [416] 2.781956e-03 4.404299e-03 2.178634e-02 3.687438e-02 -3.297983e-03 [421] 2.842753e-02 -2.882445e-03 -1.340849e-02 4.840080e-03 6.108567e-02 [426] -1.971124e-02 -8.458884e-03 -3.596570e-02 1.319919e-02 -3.320452e-02 [431] 2.541467e-02 7.816843e-02 -2.456713e-02 1.621163e-03 1.260198e-02 [436] -3.693829e-03 2.405060e-02 -1.296666e-01 -4.630672e-02 2.415716e-02 [441] -3.380493e-02 -3.542215e-02 1.412069e-02 3.188409e-03 -5.397238e-02 [446] 2.480593e-02 -2.284858e-02 5.828493e-03 1.608862e-02 -9.391352e-04 [451] 1.075805e-02 3.598582e-02 3.040109e-03 -8.799908e-03 1.095557e-02 [456] -5.071521e-02 2.492395e-02 -2.586514e-02 8.954989e-03 3.031986e-02 [461] 1.760475e-02 -1.446653e-03 2.720813e-02 6.496374e-03 6.738330e-03 [466] -4.973316e-02 6.442002e-03 -3.717409e-03 6.359352e-03 -2.336657e-02 [471] 1.718420e-02 6.999491e-02 3.543522e-02 -2.196719e-02 -4.307488e-02 [476] -4.551250e-02 3.846817e-02 -2.086072e-02 6.331838e-03 6.576987e-02 [481] 2.506873e-02 -5.221066e-02 2.133854e-02 2.223768e-02 2.902188e-02 [486] 7.251480e-02 -1.482254e-02 -6.635092e-03 -6.745490e-02 5.646467e-02 [491] 6.434460e-02 > postscript(file="/var/www/html/freestat/rcomp/tmp/29h241292882578.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/freestat/rcomp/tmp/32rkp1292882578.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/freestat/rcomp/tmp/42rkp1292882578.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/freestat/rcomp/tmp/52rkp1292882578.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/freestat/rcomp/tmp/62rkp1292882578.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/freestat/rcomp/tmp/7di1s1292882578.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/8j21w1292882579.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/freestat/rcomp/tmp/9utjh1292882579.tab") > > try(system("convert tmp/19h241292882578.ps tmp/19h241292882578.png",intern=TRUE)) character(0) > try(system("convert tmp/29h241292882578.ps tmp/29h241292882578.png",intern=TRUE)) character(0) > try(system("convert tmp/32rkp1292882578.ps tmp/32rkp1292882578.png",intern=TRUE)) character(0) > try(system("convert tmp/42rkp1292882578.ps tmp/42rkp1292882578.png",intern=TRUE)) character(0) > try(system("convert tmp/52rkp1292882578.ps tmp/52rkp1292882578.png",intern=TRUE)) character(0) > try(system("convert tmp/62rkp1292882578.ps tmp/62rkp1292882578.png",intern=TRUE)) character(0) > try(system("convert tmp/7di1s1292882578.ps tmp/7di1s1292882578.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.421 1.718 11.967