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(5.2 + ,7.9 + ,8.7 + ,8.9 + ,15.3 + ,15.4 + ,18.1 + ,19.7 + ,13 + ,12.6 + ,6.2 + ,3.5 + ,3.4 + ,0 + ,9.5 + ,8.9 + ,10.4 + ,13.2 + ,18.9 + ,19 + ,16.3 + ,10.6 + ,5.8 + ,3.6 + ,2.6 + ,5 + ,7.3 + ,9.2 + ,15.7 + ,16.8 + ,18.4 + ,18.1 + ,14.6 + ,7.8 + ,7.6 + ,3.8 + ,5.6 + ,2.2 + ,6.8 + ,11.8 + ,14.9 + ,16.7 + ,16.7 + ,15.9 + ,13.6 + ,9.2 + ,2.8 + ,2.5 + ,4.8 + ,2.8 + ,7.8 + ,9 + ,12.9 + ,16.4 + ,21.8 + ,17.8 + ,13.5 + ,10 + ,10.4 + ,5.5 + ,4 + ,6.8 + ,5.7 + ,9.1 + ,13.6 + ,15 + ,20.9 + ,20.4 + ,14 + ,13.7 + ,7.1 + ,0.8 + ,2.1 + ,1.3 + ,3.9 + ,10.7 + ,11.1 + ,16.4 + ,17.1 + ,17.3 + ,12.9 + ,10.9 + ,5.3 + ,0.7 + ,-0.2 + ,6.5 + ,8.6 + ,8.5 + ,13.3 + ,16.2 + ,17.5 + ,21.2 + ,14.8 + ,10.3 + ,7.3 + ,5.1 + ,4.4 + ,6.2 + ,7.7 + ,9.3 + ,15.6 + ,16.3 + ,16.6 + ,17.4 + ,15.3 + ,9.7 + ,3.7 + ,4.6 + ,5.4 + ,3.1 + ,7.9 + ,10.1 + ,15 + ,15.6 + ,19.7 + ,18.1 + ,17.7 + ,10.7 + ,6.2 + ,4.2 + ,4 + ,5.9 + ,7.1 + ,10.5 + ,15.1 + ,16.8 + ,15.3 + ,18.4 + ,16.1 + ,11.3 + ,7.9 + ,5.6 + ,3.4 + ,4.8 + ,6.5 + ,8.5 + ,15.1 + ,15.7 + ,18.7 + ,19.2 + ,12.9 + ,14.4 + ,6.2 + ,3.3 + ,4.6 + ,7.2 + ,7.8 + ,9.9 + ,13.6 + ,17.1 + ,17.8 + ,18.6 + ,14.7 + ,10.5 + ,8.6 + ,4.4 + ,2.3 + ,2.8 + ,8.8 + ,10.7 + ,13.9 + ,19.3 + ,19.5 + ,20.4 + ,15.3 + ,7.9 + ,8.3 + ,4.5 + ,3.2 + ,5 + ,6.6 + ,11.1 + ,12.8 + ,16.3 + ,17.4 + ,18.9 + ,15.8 + ,11.7 + ,6.4 + ,2.9 + ,4.7 + ,2.4 + ,7.2 + ,10.7 + ,13.4 + ,18.5 + ,18.3 + ,16.8 + ,16.6 + ,14.1 + ,6.1 + ,3.5 + ,1.7 + ,2.3 + ,4.5 + ,9.3 + ,14.2 + ,17.3 + ,23 + ,16.3 + ,18.4 + ,14.2 + ,9.1 + ,5.9 + ,7.2 + ,6.8 + ,8 + ,14.3 + ,14.6 + ,17.5 + ,17.2 + ,17.2 + ,14.1 + ,10.5 + ,6.8 + ,4.1 + ,6.5 + ,6.1 + ,6.3 + ,9.3 + ,16.4 + ,16.1 + ,18 + ,17.6 + ,14 + ,10.5 + ,6.9 + ,2.8 + ,0.7 + ,3.6 + ,6.7 + ,12.5 + ,14.4 + ,16.5 + ,18.7 + ,19.4 + ,15.8 + ,11.3 + ,9.7 + ,2.9) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '1' > par3 = '0' > 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.2533580 0.008707 0.1530780 -0.1396922 -0.06822120 -0.10071094 [2,] 0.2817632 0.000000 0.1526233 -0.1674409 -0.06914397 -0.10128788 [3,] 0.1197425 0.000000 0.1625304 0.0000000 -0.07224800 -0.10234756 [4,] 0.1240479 0.000000 0.1607098 0.0000000 0.00000000 -0.08102818 [5,] 0.1301584 0.000000 0.1560084 0.0000000 0.00000000 0.00000000 [6,] 0.1382089 0.000000 0.1517522 0.0000000 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.9114679 [2,] -0.9112274 [3,] -0.9041503 [4,] -1.0625886 [5,] -1.0047077 [6,] 0.0000000 [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.59538 0.92238 0.03896 0.77298 0.39237 0.20174 0.00000 [2,] 0.42801 NA 0.03934 0.64804 0.38311 0.19796 0.00000 [3,] 0.06850 NA 0.01466 NA 0.36012 0.19294 0.00000 [4,] 0.05845 NA 0.01583 NA NA 0.28634 0.00000 [5,] 0.04626 NA 0.01879 NA NA NA 0.24501 [6,] 0.03438 NA 0.02338 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.2534 0.0087 0.1531 -0.1397 -0.0682 -0.1007 -0.9115 s.e. 0.4764 0.0893 0.0737 0.4837 0.0796 0.0787 0.0778 sigma^2 estimated as 2.756: log likelihood = -451.4, aic = 918.8 [[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.2534 0.0087 0.1531 -0.1397 -0.0682 -0.1007 -0.9115 s.e. 0.4764 0.0893 0.0737 0.4837 0.0796 0.0787 0.0778 sigma^2 estimated as 2.756: log likelihood = -451.4, aic = 918.8 [[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.2818 0 0.1526 -0.1674 -0.0691 -0.1013 -0.9112 s.e. 0.3549 0 0.0736 0.3663 0.0791 0.0785 0.0779 sigma^2 estimated as 2.756: log likelihood = -451.4, aic = 916.81 [[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.1197 0 0.1625 0 -0.0722 -0.1023 -0.9042 s.e. 0.0654 0 0.0661 0 0.0788 0.0784 0.0726 sigma^2 estimated as 2.767: log likelihood = -451.5, aic = 915.01 [[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.1240 0 0.1607 0 0 -0.0810 -1.0626 s.e. 0.0652 0 0.0661 0 0 0.0758 0.0979 sigma^2 estimated as 2.429: log likelihood = -451.92, aic = 913.83 [[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.1302 0 0.1560 0 0 0 -1.0047 s.e. 0.0650 0 0.0659 0 0 0 0.8621 sigma^2 estimated as 2.634: log likelihood = -452.48, aic = 912.95 [[3]][[7]] NULL $aic [1] 918.7975 916.8081 915.0068 913.8342 912.9537 1040.8640 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/15vty1293464635.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 = 240 Frequency = 1 [1] 0.005199995 0.007899990 0.008699988 0.008899986 0.015299978 [6] 0.015399975 0.018099971 0.019699967 0.012999973 0.012599975 [11] 0.006199982 0.003499989 -1.242791823 -5.335152323 1.315151092 [16] 0.118275212 -2.598350587 -1.196699113 0.734690220 -0.093816191 [21] 2.619292263 -1.951617615 -0.433428503 -0.239440015 -1.168960903 [26] 1.130989147 -1.572309550 0.646793195 2.149661512 1.956344780 [31] -0.407626335 -1.406895564 -0.249664659 -3.198668990 1.646859113 [36] -0.020626167 2.069115608 -2.179942241 -1.251655227 2.355841673 [41] 0.913359669 1.454937936 -2.094041129 -2.600308827 -0.777399565 [46] -0.691541935 -2.872225673 -0.460770605 0.825135907 -0.422919254 [51] 0.024650170 -0.678442949 -0.835623777 0.952497812 3.353859261 [56] -0.633518244 -0.869265871 -0.515857449 4.197000196 1.457788334 [61] -0.515878765 2.337451866 -2.779908148 -0.100185023 -0.624683916 [66] -0.282210460 2.070698945 1.859643395 -0.365753739 3.018716318 [71] -0.374298365 -2.784860490 -2.151559147 -2.398599675 -2.682114495 [76] 1.883003941 -2.237265954 1.613711560 -2.160234140 -0.476748929 [81] -1.157965428 0.635388004 -1.207039508 -2.089061871 -3.591057228 [86] 3.313170165 1.440408766 -0.658611379 -0.374150602 0.258824365 [91] -1.154210925 2.858688950 0.323661169 -0.308038593 0.334483614 [96] 1.773220880 0.712287725 1.783455502 -0.181059995 -0.393068679 [101] 1.779574046 0.172949116 -1.993531843 -1.279778733 1.206807833 [106] -0.762849769 -2.456458910 1.462143839 1.733156883 -0.936012946 [111] 0.485053959 0.233365575 1.382904377 -0.463245710 1.119477834 [116] -0.775541971 3.368829428 -0.486237806 -0.058886569 0.270552623 [121] 0.137683564 1.618818433 -0.608441076 0.898372219 0.880942863 [126] 0.828793245 -3.380493467 0.114139201 1.309848147 0.982485495 [131] 1.447298821 1.603190426 -0.707849945 0.250009617 -1.197549816 [136] -0.926260059 1.216671037 -0.204774370 0.596507685 0.445650566 [141] -1.796615202 3.748810139 -0.806943654 -0.046651430 0.326163900 [146] 2.634292297 0.188602981 0.148332022 -0.852077804 1.146325144 [151] -0.697727666 0.171833666 -0.061467831 -0.379059395 2.137068277 [156] 0.443325548 -1.461682227 -1.861454994 1.522206548 1.126141756 [161] 0.059345226 2.988526251 0.592845050 1.631538831 -0.035375478 [166] -3.181830758 1.744028173 0.454243690 -0.116511890 0.321142460 [171] -0.993762075 1.574430488 -1.385873221 0.359296227 -1.155934337 [176] 0.501903358 1.088004351 0.953472703 -0.458634477 -0.956753510 [181] 0.968637242 -2.113413849 0.217490155 0.784748049 -0.274608278 [186] 2.295259055 -0.428091602 -1.762744276 1.723010119 2.974383150 [191] -0.705311755 -0.397348006 -2.429672961 -1.658674590 -2.486652062 [196] 0.175155768 0.707726727 1.301176820 4.508949763 -2.852617960 [201] 3.604031521 1.952861005 2.302738580 1.297793110 2.726482608 [206] 1.652508924 0.119209425 3.739078386 -0.256530330 0.840782470 [211] -2.153616592 -1.144973839 -0.914649643 -0.324705071 0.272781857 [216] 0.420128542 2.686336876 1.319936695 -1.176783722 -0.997630531 [221] 2.243112468 -0.534082252 -0.325516982 -1.068142149 -0.800404266 [226] -0.414404480 0.295141599 -0.862047639 -2.927369036 -0.459865260 [231] -0.213929166 2.994279500 0.157280835 0.074680044 -0.164385767 [236] 0.951694382 0.702144154 0.049570418 2.627957350 -1.348935697 > postscript(file="/var/www/html/rcomp/tmp/25vty1293464635.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/35vty1293464635.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/4x4bj1293464635.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/5x4bj1293464635.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/6x4bj1293464635.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/7x4bj1293464635.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/8uwrs1293464635.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/9mnqu1293464635.tab") > > try(system("convert tmp/15vty1293464635.ps tmp/15vty1293464635.png",intern=TRUE)) character(0) > try(system("convert tmp/25vty1293464635.ps tmp/25vty1293464635.png",intern=TRUE)) character(0) > try(system("convert tmp/35vty1293464635.ps tmp/35vty1293464635.png",intern=TRUE)) character(0) > try(system("convert tmp/4x4bj1293464635.ps tmp/4x4bj1293464635.png",intern=TRUE)) character(0) > try(system("convert tmp/5x4bj1293464635.ps tmp/5x4bj1293464635.png",intern=TRUE)) character(0) > try(system("convert tmp/6x4bj1293464635.ps tmp/6x4bj1293464635.png",intern=TRUE)) character(0) > try(system("convert tmp/7x4bj1293464635.ps tmp/7x4bj1293464635.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 12.925 1.656 28.055