R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(411 + ,410 + ,415 + ,414 + ,411 + ,408 + ,410 + ,411 + ,416 + ,479 + ,498 + ,502 + ,498 + ,499 + ,506 + ,510 + ,509 + ,502 + ,495 + ,490 + ,490 + ,553 + ,570 + ,573 + ,572 + ,575 + ,580 + ,580 + ,574 + ,563 + ,556 + ,546 + ,545 + ,605 + ,628 + ,631 + ,626 + ,614 + ,606 + ,602 + ,589 + ,574 + ,558 + ,552 + ,546 + ,607 + ,636 + ,631 + ,623 + ,618 + ,605 + ,619 + ,596 + ,570 + ,546 + ,528 + ,506 + ,555 + ,568 + ,564 + ,553 + ,541 + ,542 + ,540 + ,521 + ,505 + ,491 + ,482 + ,478 + ,523 + ,531 + ,532 + ,540 + ,525 + ,533 + ,531 + ,508 + ,495 + ,482 + ,470 + ,466 + ,515 + ,518 + ,516 + ,511 + ,500 + ,498 + ,494 + ,476 + ,458 + ,443 + ,430 + ,424 + ,476 + ,481 + ,470 + ,460 + ,451 + ,450 + ,444 + ,429 + ,421 + ,400 + ,389 + ,384 + ,432 + ,446 + ,431 + ,423 + ,416 + ,416 + ,413 + ,399 + ,386 + ,374 + ,365 + ,365 + ,418 + ,428 + ,424 + ,421 + ,417 + ,423 + ,423 + ,419 + ,406 + ,398 + ,390 + ,391 + ,444 + ,460 + ,455 + ,456 + ,452 + ,459 + ,461 + ,451 + ,443 + ,439 + ,430 + ,436 + ,488 + ,506 + ,502 + ,501 + ,501 + ,515 + ,521 + ,520 + ,512 + ,509 + ,505 + ,511 + ,570 + ,592 + ,594 + ,586 + ,586 + ,592 + ,594 + ,586 + ,572 + ,563 + ,555 + ,554 + ,601 + ,622 + ,617 + ,606 + ,595 + ,599 + ,600 + ,592 + ,575 + ,567 + ,555 + ,555 + ,608 + ,631 + ,629 + ,624 + ,610 + ,616 + ,621 + ,604 + ,584 + ,574 + ,555 + ,545 + ,599 + ,620 + ,608 + ,590 + ,579 + ,580 + ,579 + ,572 + ,560 + ,551 + ,537 + ,541 + ,588 + ,607 + ,599 + ,578 + ,563 + ,566 + ,561 + ,554 + ,540 + ,526 + ,512 + ,505 + ,554 + ,584 + ,569 + ,540 + ,522 + ,526 + ,527 + ,516 + ,503 + ,489 + ,479 + ,475 + ,524 + ,552 + ,532 + ,511 + ,492 + ,492 + ,493 + ,481 + ,462 + ,457 + ,442 + ,439 + ,488 + ,521 + ,501 + ,485 + ,464 + ,460 + ,467 + ,460 + ,448 + ,443 + ,436 + ,431 + ,484 + ,510 + ,513 + ,503 + ,471 + ,471 + ,476 + ,475 + ,470 + ,461 + ,455 + ,456 + ,517 + ,525 + ,523 + ,519 + ,509 + ,512 + ,519 + ,517 + ,510 + ,509 + ,501 + ,507 + ,569 + ,580 + ,578 + ,565 + ,547 + ,555 + ,562 + ,561 + ,555 + ,544 + ,537 + ,543 + ,594 + ,611 + ,613 + ,611 + ,594 + ,595 + ,591 + ,589 + ,584 + ,573 + ,567 + ,569 + ,621 + ,629 + ,628 + ,612 + ,595 + ,597 + ,593 + ,590 + ,580 + ,574 + ,573 + ,573 + ,620 + ,626 + ,620 + ,588 + ,566 + ,557 + ,561 + ,549 + ,532 + ,526 + ,511 + ,499 + ,555 + ,565 + ,542 + ,527 + ,510 + ,514 + ,517 + ,508 + ,493 + ,490 + ,469 + ,478 + ,528 + ,534 + ,518 + ,506 + ,502 + ,516 + ,528 + ,533 + ,536 + ,537 + ,524 + ,536 + ,587 + ,597 + ,581 + ,564 + ,558 + ,575 + ,580 + ,575 + ,563 + ,552 + ,537 + ,545 + ,601 + ,604 + ,586 + ,564 + ,549 + ,551 + ,556 + ,548 + ,540 + ,531 + ,521 + ,519 + ,572 + ,581 + ,563 + ,548) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > 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.8460983 0.006120235 0.03125658 -0.7036042 0.3805050 0.01602905 [2,] 0.8529914 0.000000000 0.03256294 -0.7077394 0.3795652 0.01564139 [3,] 0.8534713 0.000000000 0.03219023 -0.7078810 0.3765566 0.00000000 [4,] 0.9079255 0.000000000 0.00000000 -0.7568132 0.3762485 0.00000000 [5,] NA NA NA NA NA NA [6,] NA NA NA NA NA NA [7,] NA NA NA NA NA NA [8,] NA NA NA NA NA NA [9,] NA NA NA NA NA NA [10,] NA NA NA NA NA NA [11,] NA NA NA NA NA NA [12,] NA NA NA NA NA NA [13,] NA NA NA NA NA NA [14,] NA NA NA NA NA NA [,7] [1,] -0.8757700 [2,] -0.8755499 [3,] -0.8682285 [4,] -0.8718703 [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA [13,] NA [14,] NA [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0 0.93402 0.67126 1e-05 0 0.80294 0 [2,] 0 NA 0.64930 0e+00 0 0.80707 0 [3,] 0 NA 0.65321 0e+00 0 NA 0 [4,] 0 NA NA 0e+00 0 NA 0 [5,] NA NA NA NA NA NA NA [6,] NA NA NA NA NA NA NA [7,] NA NA NA NA NA NA NA [8,] NA NA NA NA NA NA NA [9,] NA NA NA NA NA NA NA [10,] NA NA NA NA NA NA NA [11,] NA NA NA NA NA NA NA [12,] NA NA NA NA NA NA NA [13,] NA NA NA NA NA NA NA [14,] NA NA NA NA NA NA NA [[3]] [[3]][[1]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0.8461 0.0061 0.0313 -0.7036 0.3805 0.0160 -0.8758 s.e. 0.1620 0.0739 0.0736 0.1518 0.0776 0.0642 0.0570 sigma^2 estimated as 33.16: log likelihood = -1145.65, aic = 2307.3 [[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.8461 0.0061 0.0313 -0.7036 0.3805 0.0160 -0.8758 s.e. 0.1620 0.0739 0.0736 0.1518 0.0776 0.0642 0.0570 sigma^2 estimated as 33.16: log likelihood = -1145.65, aic = 2307.3 [[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.8530 0 0.0326 -0.7077 0.3796 0.0156 -0.8755 s.e. 0.1367 0 0.0715 0.1406 0.0767 0.0640 0.0570 sigma^2 estimated as 33.16: log likelihood = -1145.65, aic = 2305.31 [[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.8535 0 0.0322 -0.7079 0.3766 0 -0.8682 s.e. 0.1369 0 0.0716 0.1411 0.0772 0 0.0504 sigma^2 estimated as 33.17: log likelihood = -1145.68, aic = 2303.37 [[3]][[5]] NULL [[3]][[6]] NULL [[3]][[7]] NULL $aic [1] 2307.302 2305.309 2303.368 2301.574 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 log(s2) : NaNs produced 5: In log(s2) : NaNs produced 6: In log(s2) : NaNs produced 7: In log(s2) : NaNs produced > postscript(file="/var/wessaorg/rcomp/tmp/16pbv1323207814.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 = 373 Frequency = 1 [1] 2.372909e-01 1.053450e-01 7.319013e-02 5.367059e-02 4.010051e-02 [6] 3.060581e-02 2.807091e-02 2.548637e-02 2.737447e-02 8.455414e-02 [11] 9.500481e-02 -1.304788e-01 -1.199134e+00 1.709440e+00 1.405709e+00 [16] 3.861010e+00 6.909824e-01 -4.573779e+00 -8.312417e+00 -4.472918e+00 [21] -2.957399e+00 1.937736e+00 -2.072427e-01 6.215852e-01 3.860343e+00 [26] 2.859269e+00 -1.297210e+00 -2.201378e+00 -3.734292e+00 -3.947626e+00 [31] -1.117514e+00 -4.828500e+00 -2.101034e-01 -8.703035e-01 6.966758e+00 [36] 4.559821e-01 -2.231394e+00 -1.242972e+01 -1.021826e+01 -5.171535e-01 [41] -4.415448e+00 -1.996119e+00 -6.622239e+00 5.240195e+00 -2.963019e+00 [46] 3.357222e+00 9.774698e+00 -7.047681e+00 -1.995646e+00 3.331628e+00 [51] -9.061524e+00 1.790075e+01 -1.412608e+01 -1.220366e+01 -1.003300e+01 [56] -8.218912e+00 -1.336145e+01 -5.312270e+00 -4.915125e+00 4.717994e+00 [61] 9.836900e-01 -2.745733e+00 1.210134e+01 -6.944129e+00 2.574411e-03 [66] 5.032551e+00 4.062743e+00 4.079629e+00 8.469783e+00 -1.050436e+01 [71] -8.232154e+00 3.782992e+00 1.652840e+01 -8.316758e+00 7.652714e+00 [76] -3.641357e+00 -8.933595e+00 1.666451e+00 -6.717238e-01 -3.261432e+00 [81] 1.049481e+00 -1.806245e+00 -9.416497e+00 -6.441165e-01 -4.831590e+00 [86] 1.911078e+00 -3.892202e+00 -1.073699e+00 1.833045e+00 -3.107828e+00 [91] -8.804854e-01 -1.047444e+00 1.931209e-01 1.222527e+00 -3.414833e+00 [96] -8.328154e+00 -3.103694e+00 2.750813e+00 2.046931e+00 -2.384909e+00 [101] 2.656128e+00 8.814707e+00 -7.839915e+00 8.425212e-01 7.383615e-01 [106] -4.951403e+00 5.290254e+00 -8.900874e+00 5.946906e-01 2.317943e+00 [111] 1.306641e+00 7.261561e-01 8.743279e-01 -2.075080e+00 4.998025e+00 [116] 6.978122e-01 4.429881e+00 6.466416e-01 -4.922371e+00 4.251520e+00 [121] 2.310948e+00 2.132876e+00 4.509995e+00 -2.624126e-02 8.204052e+00 [126] -2.977370e+00 2.387859e+00 -1.324848e+00 1.290093e+00 -2.362671e+00 [131] 2.773431e+00 -2.860340e+00 3.908988e+00 3.353369e-02 2.475298e+00 [136] 8.537667e-01 -2.753317e+00 3.816580e+00 4.774780e+00 -2.390789e+00 [141] 5.839480e+00 -3.689391e+00 1.849000e+00 -1.395905e+00 -5.140593e-01 [146] 4.261395e+00 8.286326e+00 2.805398e+00 7.426610e+00 -1.441225e+00 [151] 1.761101e+00 1.702332e+00 1.308378e+00 3.155754e+00 2.869615e+00 [156] 2.605782e+00 -8.994977e+00 1.331506e+00 -4.015599e+00 -1.722365e+00 [161] -2.148906e+00 -4.105020e+00 -1.580099e+00 -8.313223e-01 -2.281858e+00 [166] -8.127967e+00 4.945982e+00 -2.883409e+00 -3.412387e+00 -6.354007e+00 [171] 1.894471e+00 1.963900e+00 3.139653e+00 -3.030056e+00 2.870099e+00 [176] -3.071530e+00 2.139333e+00 3.180483e+00 4.995150e+00 1.499290e+00 [181] 1.853298e+00 -7.109517e+00 2.095954e+00 3.818065e+00 -8.538802e+00 [186] -4.876628e+00 -3.091849e-02 -7.611553e+00 -7.274808e+00 3.955630e+00 [191] 3.675287e+00 -7.597247e+00 -1.040627e+01 2.560587e+00 -9.230894e-01 [196] -7.345266e-01 9.385106e+00 5.545169e+00 1.097510e+00 -9.471285e-02 [201] 9.243048e+00 -8.142724e+00 -2.076096e-01 -7.321578e-01 -9.364671e+00 [206] -4.731177e+00 2.284768e+00 -3.564920e+00 3.948554e+00 -7.935522e-02 [211] -3.549242e+00 -4.429799e-01 -6.737258e+00 1.184325e+00 1.350606e+01 [216] -8.947090e+00 -1.376164e+01 -4.109902e+00 3.770498e+00 5.687777e+00 [221] -7.142348e-01 2.158053e+00 -1.356500e+00 3.354758e+00 4.744268e-01 [226] -1.407223e+00 4.363270e+00 -1.031351e+01 -6.945746e-01 -4.676068e+00 [231] -1.925403e+00 2.376414e+00 -4.315696e-04 -4.354932e+00 8.924488e+00 [236] -4.137701e+00 1.048701e+00 -9.486400e-01 9.937330e+00 -7.612624e+00 [241] 7.218749e-01 -6.623065e+00 -4.655485e+00 8.010688e+00 4.518634e+00 [246] 4.170003e+00 1.888272e+00 4.863941e+00 -4.211678e+00 1.687044e+00 [251] -2.212415e+00 1.637434e+01 1.256403e+00 -1.877260e+01 2.479851e-01 [256] 8.974777e-01 7.716059e+00 6.977719e+00 -3.569357e+00 1.802701e+00 [261] 2.961835e+00 7.006448e+00 -1.883325e+01 1.471048e+00 7.260364e+00 [266] 1.151597e+01 -4.742921e-01 1.648442e+00 8.627193e-01 2.423529e-02 [271] 6.004539e+00 -2.375184e+00 4.699082e+00 2.930849e+00 -7.004508e+00 [276] 1.339158e+00 -6.453839e+00 -6.022739e+00 5.954911e+00 2.244152e+00 [281] 3.867757e+00 2.682506e+00 -7.386831e+00 1.833009e+00 3.400534e+00 [286] -7.285728e+00 1.483696e+00 6.420264e+00 9.460181e+00 -2.989531e+00 [291] -5.681270e+00 -9.614332e+00 3.054242e+00 4.197961e+00 -1.501413e+00 [296] 2.521406e+00 -9.414234e-01 -6.461845e-01 -1.035927e+01 2.559662e+00 [301] -8.381715e+00 1.126874e+00 1.804983e+00 -1.954304e+00 3.029681e+00 [306] -1.049153e+00 4.829043e+00 6.905910e+00 -1.744419e+00 -6.332992e+00 [311] -7.250105e+00 -1.584040e+00 -1.722160e+01 -1.951040e+00 -7.490894e+00 [316] 9.945441e+00 -4.418149e+00 -3.291423e+00 4.733907e+00 -7.618923e+00 [321] -8.678326e+00 9.972103e+00 6.333562e-01 -1.528224e+01 1.077979e+01 [326] 3.599594e+00 8.997896e+00 2.238670e-01 -1.974445e-01 -1.650737e+00 [331] 4.136500e+00 -1.008948e+01 1.599584e+01 -5.950137e+00 -7.260062e+00 [336] -1.516947e+00 3.139794e+00 1.291998e+01 9.930604e+00 6.823448e+00 [341] 9.030912e+00 1.117898e+01 3.682047e-01 -3.645708e+00 3.288405e+00 [346] -5.312948e+00 -4.012982e+00 -6.873014e+00 -5.191942e+00 3.770930e+00 [351] 8.554760e+00 -3.661377e+00 -5.127802e+00 -8.193758e+00 -6.935809e+00 [356] -1.294993e+00 4.028116e+00 5.653893e+00 -8.507095e+00 -4.097964e+00 [361] -4.743548e+00 -2.205718e+00 -5.478388e+00 4.187764e+00 -4.558879e-01 [366] 5.228963e+00 9.148363e-01 3.950840e+00 -6.624453e+00 -9.972186e-02 [371] 1.686652e+00 -3.479453e+00 4.334214e+00 > postscript(file="/var/wessaorg/rcomp/tmp/2k61t1323207814.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(resid,length(resid)/2, main='Residual Autocorrelation Function') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3y1jv1323207814.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(resid,length(resid)/2, main='Residual Partial Autocorrelation Function') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4fies1323207814.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > cpgram(resid, main='Residual Cumulative Periodogram') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5q9bn1323207814.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(resid, main='Residual Histogram', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60twu1323207814.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7sf4f1323207814.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(resid, main='Residual Normal Q-Q Plot') > qqline(resid) > dev.off() null device 1 > ncols <- length(selection[[1]][1,]) > nrows <- length(selection[[2]][,1])-1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'ARIMA Parameter Estimation and Backward Selection', ncols+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Iteration', header=TRUE) > for (i in 1:ncols) { + a<-table.element(a,names(selection[[3]][[1]]$coef)[i],header=TRUE) + } > a<-table.row.end(a) > for (j in 1:nrows) { + a<-table.row.start(a) + mydum <- 'Estimates (' + mydum <- paste(mydum,j) + mydum <- paste(mydum,')') + a<-table.element(a,mydum, header=TRUE) + for (i in 1:ncols) { + a<-table.element(a,round(selection[[1]][j,i],4)) + } + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'(p-val)', header=TRUE) + for (i in 1:ncols) { + mydum <- '(' + mydum <- paste(mydum,round(selection[[2]][j,i],4),sep='') + mydum <- paste(mydum,')') + a<-table.element(a,mydum) + } + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/8sfuz1323207815.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Estimated ARIMA Residuals', 1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Value', 1,TRUE) > a<-table.row.end(a) > for (i in (par4*par5+par3):length(resid)) { + a<-table.row.start(a) + a<-table.element(a,resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/946up1323207815.tab") > > try(system("convert tmp/16pbv1323207814.ps tmp/16pbv1323207814.png",intern=TRUE)) character(0) > try(system("convert tmp/2k61t1323207814.ps tmp/2k61t1323207814.png",intern=TRUE)) character(0) > try(system("convert tmp/3y1jv1323207814.ps tmp/3y1jv1323207814.png",intern=TRUE)) character(0) > try(system("convert tmp/4fies1323207814.ps tmp/4fies1323207814.png",intern=TRUE)) character(0) > try(system("convert tmp/5q9bn1323207814.ps tmp/5q9bn1323207814.png",intern=TRUE)) character(0) > try(system("convert tmp/60twu1323207814.ps tmp/60twu1323207814.png",intern=TRUE)) character(0) > try(system("convert tmp/7sf4f1323207814.ps tmp/7sf4f1323207814.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 26.710 1.561 28.663