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(299.9 + ,339.2 + ,374.2 + ,393.5 + ,389.2 + ,381.7 + ,375.2 + ,369 + ,357.4 + ,352.1 + ,346.5 + ,342.9 + ,340.3 + ,328.3 + ,322.9 + ,314.3 + ,308.9 + ,294 + ,285.6 + ,281.2 + ,280.3 + ,278.8 + ,274.5 + ,270.4 + ,263.4 + ,259.9 + ,258 + ,262.7 + ,284.7 + ,311.3 + ,322.1 + ,327 + ,331.3 + ,333.3 + ,321.4 + ,327 + ,320 + ,314.7 + ,316.7 + ,314.4 + ,321.3 + ,318.2 + ,307.2 + ,301.3 + ,287.5 + ,277.7 + ,274.4 + ,258.8 + ,253.3 + ,251 + ,248.4 + ,249.5 + ,246.1 + ,244.5 + ,243.6 + ,244 + ,240.8 + ,249.8 + ,248 + ,259.4 + ,260.5 + ,260.8 + ,261.3 + ,259.5 + ,256.6 + ,257.9 + ,256.5 + ,254.2 + ,253.3 + ,253.8 + ,255.5 + ,257.1 + ,257.3 + ,253.2 + ,252.8 + ,252 + ,250.7 + ,252.2 + ,250 + ,251 + ,253.4 + ,251.2 + ,255.6 + ,261.1 + ,258.9 + ,259.9 + ,261.2 + ,264.7 + ,267.1 + ,266.4 + ,267.7 + ,268.6 + ,267.5 + ,268.5 + ,268.5 + ,270.5 + ,270.9 + ,270.1 + ,269.3 + ,269.8 + ,270.1 + ,264.9 + ,263.7 + ,264.8 + ,263.7 + ,255.9 + ,276.2 + ,360.1 + ,380.5 + ,373.7 + ,369.8 + ,366.6 + ,359.3 + ,345.8 + ,326.2 + ,324.5 + ,328.1 + ,327.5 + ,324.4 + ,316.5 + ,310.9 + ,301.5 + ,291.7 + ,290.4 + ,287.4 + ,277.7 + ,281.6 + ,288 + ,276 + ,272.9 + ,283 + ,283.3 + ,276.8 + ,284.5 + ,282.7 + ,281.2 + ,287.4 + ,283.1 + ,284 + ,285.5 + ,289.2 + ,292.5 + ,296.4 + ,305.2 + ,303.9 + ,311.5 + ,316.3 + ,316.7 + ,322.5 + ,317.1 + ,309.8 + ,303.8 + ,290.3 + ,293.7 + ,291.7 + ,296.5 + ,289.1 + ,288.5 + ,293.8 + ,297.7 + ,305.4 + ,302.7 + ,302.5 + ,303 + ,294.5 + ,294.1 + ,294.5 + ,297.1 + ,289.4 + ,292.4 + ,287.9 + ,286.6 + ,280.5 + ,272.4 + ,269.2 + ,270.6 + ,267.3 + ,262.5 + ,266.8 + ,268.8 + ,263.1 + ,261.2 + ,266 + ,262.5 + ,265.2 + ,261.3 + ,253.7 + ,249.2 + ,239.1 + ,236.4 + ,235.2 + ,245.2 + ,246.2 + ,247.7 + ,251.4 + ,253.3 + ,254.8 + ,250 + ,249.3 + ,241.5 + ,243.3 + ,248 + ,253 + ,252.9 + ,251.5 + ,251.6 + ,253.5 + ,259.8 + ,334.1 + ,448 + ,445.8 + ,445 + ,448.2 + ,438.2 + ,439.8 + ,423.4 + ,410.8 + ,408.4 + ,406.7 + ,405.9 + ,402.7 + ,405.1 + ,399.6 + ,386.5 + ,381.4 + ,375.2 + ,357.7 + ,359 + ,355 + ,352.7 + ,344.4 + ,343.8 + ,338 + ,339 + ,333.3 + ,334.4 + ,328.3 + ,330.7 + ,330 + ,331.6 + ,351.2 + ,389.4 + ,410.9 + ,442.8 + ,462.8 + ,466.9 + ,461.7 + ,439.2 + ,430.3 + ,416.1 + ,402.5 + ,397.3 + ,403.3 + ,395.9 + ,387.8 + ,378.6 + ,377.1 + ,370.4 + ,362 + ,350.3 + ,348.2 + ,344.6 + ,343.5 + ,342.8 + ,347.6 + ,346.6 + ,349.5 + ,342.1 + ,342 + ,342.8 + ,339.3 + ,348.2 + ,333.7 + ,334.7 + ,354 + ,367.7 + ,363.3 + ,358.4 + ,353.1 + ,343.1 + ,344.6 + ,344.4 + ,333.9 + ,331.7 + ,324.3 + ,321.2 + ,322.4 + ,321.7 + ,320.5 + ,312.8 + ,309.7 + ,315.6 + ,309.7 + ,304.6 + ,302.5 + ,301.5 + ,298.8 + ,291.3 + ,293.6 + ,294.6 + ,285.9 + ,297.6 + ,301.1 + ,293.8 + ,297.7 + ,292.9 + ,292.1 + ,287.2 + ,288.2 + ,283.8 + ,299.9 + ,292.4 + ,293.3 + ,300.8 + ,293.7 + ,293.1 + ,294.4 + ,292.1 + ,291.9 + ,282.5 + ,277.9 + ,287.5 + ,289.2 + ,285.6 + ,293.2 + ,290.8 + ,283.1 + ,275 + ,287.8 + ,287.8 + ,287.4 + ,284 + ,277.8 + ,277.6 + ,304.9 + ,294 + ,300.9 + ,324 + ,332.9 + ,341.6 + ,333.4 + ,348.2 + ,344.7 + ,344.7 + ,329.3 + ,323.5 + ,323.2 + ,317.4 + ,330.1 + ,329.2 + ,334.9 + ,315.8 + ,315.4 + ,319.6 + ,317.3 + ,313.8 + ,315.8 + ,311.3) > par9 = '0' > par8 = '0' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '0' > 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] [1,] -0.3048584 0.2561030 0.009194956 0.7813915 [2,] -0.3166468 0.2605887 0.000000000 0.7946906 [3,] 0.0000000 0.1116624 0.000000000 0.4866992 [4,] 0.0000000 0.0000000 0.000000000 0.4497582 [5,] NA NA NA NA [6,] NA NA NA NA [7,] NA NA NA NA [8,] NA NA NA NA [[2]] [,1] [,2] [,3] [,4] [1,] 0.14995 0.03115 0.89202 0.00016 [2,] 0.05382 0.01023 NA 0.00000 [3,] NA 0.05856 NA 0.00000 [4,] NA NA NA 0.00000 [5,] NA NA NA NA [6,] NA NA NA NA [7,] NA NA NA NA [8,] 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 -0.3049 0.2561 0.0092 0.7814 s.e. 0.2113 0.1184 0.0677 0.2046 sigma^2 estimated as 110.7: log likelihood = -1346.92, aic = 2703.85 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 -0.3049 0.2561 0.0092 0.7814 s.e. 0.2113 0.1184 0.0677 0.2046 sigma^2 estimated as 110.7: log likelihood = -1346.92, aic = 2703.85 [[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 -0.3166 0.2606 0 0.7947 s.e. 0.1637 0.1009 0 0.1481 sigma^2 estimated as 110.7: log likelihood = -1346.93, aic = 2701.87 [[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 0 0.1117 0 0.4867 s.e. 0 0.0588 0 0.0541 sigma^2 estimated as 111.2: log likelihood = -1347.61, aic = 2701.23 $aic [1] 2703.846 2701.866 2701.228 2702.920 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 > postscript(file="/var/www/html/rcomp/tmp/16r011260458796.ps",horizontal=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 = 358 Frequency = 1 [1] 0.29989981 35.11584799 17.69586734 6.34433450 -11.28734283 [6] -4.16314084 -3.99374477 -3.41880184 -9.21026357 -0.12506975 [11] -4.24384425 -0.94271354 -1.51587246 -10.86024130 0.17599336 [16] -7.34570671 -1.22187312 -13.34501843 -1.30201274 -2.10254125 [21] 1.06126959 -1.52520441 -3.45718801 -2.24989563 -5.42482910 [26] -0.40192392 -0.92274695 5.53991872 19.51588445 16.57682071 [31] 0.27550078 1.79569343 2.22008318 0.37234134 -12.56136668 [36] 11.49028260 -11.26352878 -0.44335883 2.99741939 -3.16703084 [41] 8.21806661 -6.84290309 -8.44003510 -1.44608791 -11.86790343 [46] -3.36509225 -0.12127071 -14.44668586 1.89967685 -1.48263740 [51] -1.26425818 1.97213706 -4.06951527 0.25780127 -0.64581943 [56] 0.89297970 -3.53411635 10.67538672 -6.63838270 13.62593389 [61] -5.33073913 1.62151495 -0.41201874 -1.63296952 -2.16106621 [66] 2.55278162 -2.31861580 -1.31669263 -0.10283931 0.80687540 [71] 1.40779055 0.85899821 -0.40789989 -4.08013532 1.56346622 [76] -1.10312185 -0.71844648 1.93899729 -2.99854733 2.29189703 [81] 1.53019283 -3.05640609 5.61956066 3.01062151 -4.15658184 [86] 2.40886182 0.37326615 3.20666923 0.69415541 -1.42866340 [91] 1.72733955 0.13746888 -1.31206715 1.53808588 -0.62575654 [96] 2.19289280 -0.66727923 -0.69856057 -0.50467608 0.83495540 [101] -0.01704221 -5.24753678 1.32047337 1.03797125 -1.47118489 [106] -7.20680412 23.93037467 73.12407207 -17.45617664 -7.67256993 [111] -2.44367965 -1.25135850 -6.25548132 -10.09814231 -13.87010622 [116] 6.55801275 2.59680383 -1.67403629 -2.68723257 -6.52512853 [121] -2.07807146 -7.50647105 -5.52129675 2.43683767 -3.09171523 [126] -8.05010343 8.15296640 3.51508309 -14.14627169 3.07033997 [131] 9.94561703 -4.19437060 -5.58639358 10.38539471 -6.12875781 [136] 0.62306100 6.09774906 -7.10027612 3.66339185 0.19717845 [141] 3.50353722 1.42733750 2.79216496 7.07256946 -5.17769756 [146] 9.13735204 0.49801898 -0.69101989 5.60033920 -8.17034573 [151] -3.97114112 -3.46427158 -10.99880598 9.42308493 -5.07876539 [156] 6.89217894 -10.53109331 3.98949533 4.18461767 1.93034727 [161] 6.16869061 -6.13778042 1.92745230 -0.13660099 -8.41118392 [166] 3.63788550 -0.42142543 2.84977240 -9.13164700 7.15404323 [171] -7.12206662 1.83131704 -6.48881967 -4.79673533 -0.18429182 [176] 2.39416034 -4.10791622 -2.95700775 6.10765939 -0.43661346 [181] -5.96764900 0.78112530 5.05630275 -5.74874003 4.96192768 [186] -5.92414787 -5.01821036 -1.62215743 -8.46186279 1.92086300 [191] -1.00709203 10.79163946 -4.11828768 2.38774316 2.42622482 [196] 0.55166461 0.81835428 -5.41045101 1.76576868 -8.12341861 [201] 5.83182526 2.73262208 3.46904258 -2.31319375 -0.83248253 [206] 0.51633484 1.80502763 5.41032821 71.45463883 78.41960920 [211] -48.66328152 10.16603109 -1.50214214 -9.17957864 5.71037407 [216] -18.06261038 -3.98760137 1.37202631 -0.96081756 -0.06438101 [221] -2.97883969 3.93912892 -7.05985123 -9.93196568 0.34802337 [226] -4.90660491 -14.54248080 9.07012122 -6.46032852 0.69907574 [231] -8.19358992 3.64463746 -6.64704409 4.30210868 -7.14619089 [236] 4.46638316 -7.63730940 5.99424391 -2.93625308 2.76108228 [241] 18.33434709 29.09802756 5.14942890 25.12827222 5.36934715 [246] -2.07528853 -6.42320722 -19.83164596 1.33269139 -12.33621526 [251] -6.60217796 -0.40111862 7.71383313 -10.57367200 -3.62377657 [256] -6.61000879 2.62155183 -6.94861292 -4.85062182 -8.59106785 [261] 3.01923047 -3.76300674 0.96594357 -0.76813925 5.29668145 [266] -3.49972707 4.06733481 -9.26790628 4.08686179 -0.36277052 [271] -3.31227363 10.42275107 -19.18192640 9.34203316 16.37234487 [276] 5.61992998 -9.29030042 -1.90819321 -3.87996916 -7.56447612 [281] 5.77343554 -1.89330235 -9.74602485 2.56571525 -7.47627615 [286] 0.78435516 1.64455691 -1.15425105 -0.77222182 -7.24599654 [291] 0.56061583 6.48694940 -8.71103974 -1.51915201 -0.70182157 [296] -0.08894561 -2.42221915 -6.20944539 5.62362082 -0.89954371 [301] -8.51901635 15.73453625 -3.18652352 -7.05557186 6.94312288 [306] -7.36407682 2.34860704 -5.50708558 3.76962424 -5.68752731 [311] 18.75645272 -16.13743637 6.95631274 4.95183617 -9.61055102 [316] 3.23997955 0.51590769 -2.48409442 0.86384568 -9.56360944 [321] 0.07693381 10.61218319 -2.95129419 -3.23556669 8.98492168 [326] -6.37096970 -5.44788841 -5.18052709 16.18115922 -6.97089203 [331] 1.56344870 -4.16092927 -4.13021397 2.18982420 26.92652130 [336] -23.98278463 15.52401849 16.76159265 -0.02832494 6.13438366 [341] -12.17939539 19.75623921 -12.19971446 4.28498768 -17.09468170 [346] 2.51996837 0.19313471 -5.24635644 15.28689635 -7.69247857 [351] 8.02581055 -22.90565961 10.11169100 1.41140016 -2.94226240 [356] -2.53698536 3.49157240 -5.80852709 > postscript(file="/var/www/html/rcomp/tmp/2vdnk1260458796.ps",horizontal=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/30fza1260458796.ps",horizontal=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/43us91260458796.ps",horizontal=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/5lp4t1260458796.ps",horizontal=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/624fy1260458796.ps",horizontal=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/7qati1260458796.ps",horizontal=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/88v7c1260458796.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/9bxpl1260458796.tab") > > system("convert tmp/16r011260458796.ps tmp/16r011260458796.png") > system("convert tmp/2vdnk1260458796.ps tmp/2vdnk1260458796.png") > system("convert tmp/30fza1260458796.ps tmp/30fza1260458796.png") > system("convert tmp/43us91260458796.ps tmp/43us91260458796.png") > system("convert tmp/5lp4t1260458796.ps tmp/5lp4t1260458796.png") > system("convert tmp/624fy1260458796.ps tmp/624fy1260458796.png") > system("convert tmp/7qati1260458796.ps tmp/7qati1260458796.png") > > > proc.time() user system elapsed 2.091 1.082 4.366