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(1483509 + ,8036554 + ,4623093 + ,5528662 + ,4221032 + ,8061847 + ,7640066 + ,2935533 + ,8161548 + ,2543967 + ,13163450 + ,3348436 + ,3997440 + ,2322911 + ,2019457 + ,3047748 + ,5728767 + ,2605173 + ,5646743 + ,13121544 + ,3453409 + ,1878333 + ,4247362 + ,23022552 + ,7646203 + ,9016602 + ,3606568 + ,3173510 + ,17568772 + ,10805045 + ,31056269 + ,15623385 + ,6663443 + ,35435745 + ,2823250 + ,5197089 + ,4120632 + ,8832767 + ,3695374 + ,8385805 + ,3777904 + ,5199532 + ,5297275 + ,14847382 + ,5900158 + ,4416718 + ,3926429 + ,4876884 + ,2795297 + ,3385527 + ,3877941 + ,3556729 + ,4982836 + ,2976325 + ,2295026 + ,2218752 + ,4146062 + ,3302091 + ,3864505 + ,5454794 + ,1749836 + ,6684048 + ,2809918 + ,4092664 + ,5070470 + ,9814477 + ,6665318 + ,3912554 + ,6188129 + ,3627991 + ,3308767 + ,3820332 + ,4932979 + ,5567917 + ,5020814 + ,3803273 + ,3999984 + ,4883104 + ,13731747 + ,47531824 + ,8415570 + ,22178158 + ,61211654 + ,18223748 + ,17678085 + ,49299580 + ,25899948 + ,34121754 + ,9859231 + ,29740892 + ,21085212 + ,43003866 + ,59549247 + ,18026465 + ,4680597 + ,5564728 + ,11792347 + ,10371624 + ,3728446 + ,5732978 + ,4067638 + ,2395508 + ,5018801 + ,22068888 + ,7678580 + ,15510095 + ,6471239 + ,14349204 + ,35151574 + ,8210488 + ,5022664 + ,13996871 + ,12822431 + ,14011552 + ,20260980 + ,23718976 + ,45833049 + ,30688420 + ,16576062 + ,14844405 + ,16728286 + ,43477680 + ,57497427 + ,24233726 + ,24921208 + ,9516725 + ,27977239 + ,21632046 + ,22956809 + ,9704324 + ,19871149 + ,5553842 + ,5667858 + ,4348188 + ,10025042 + ,10639796 + ,8639184 + ,10764378 + ,12097733 + ,3988414 + ,4607102 + ,7126895 + ,6009625 + ,21533237 + ,5986771 + ,5455310 + ,1822874 + ,3374062 + ,2920748 + ,2295942 + ,6809829 + ,3318281 + ,13784645 + ,7366577 + ,1628637 + ,4258976 + ,7159779 + ,8098401 + ,6894240 + ,3771246 + ,3249726 + ,3147380 + ,4063037 + ,9621916 + ,5890158 + ,2142901 + ,3145007 + ,1562168 + ,3303103 + ,5886910 + ,3454270 + ,6995348 + ,6487869 + ,12091976 + ,3934625 + ,3999749 + ,3613526 + ,4271706 + ,4253390 + ,5551591 + ,4663041 + ,2104104 + ,5385399 + ,6205877 + ,7529500 + ,17222705 + ,6230913 + ,6508275 + ,4518884 + ,4234991 + ,5625388 + ,5810139 + ,6942187 + ,3711188 + ,4261281 + ,1989945 + ,5033342 + ,7239565 + ,11058795 + ,7384772 + ,3884771 + ,3239201 + ,2316403 + ,4034947 + ,3245271 + ,2387251 + ,2174886 + ,3436080 + ,3738956 + ,1884730 + ,1509144 + ,42728366 + ,3446317 + ,4600683 + ,2953615 + ,3570060 + ,2130208 + ,2442943 + ,4892020 + ,3222192 + ,3121617 + ,3665542 + ,5519432 + ,4113468 + ,1714614 + ,3651985 + ,2419548 + ,2378854 + ,2303949 + ,2555534 + ,1713005 + ,1705960 + ,6115046 + ,3951044 + ,3785568 + ,4670530 + ,2265100 + ,1105643 + ,2814152 + ,3728673 + ,2038949 + ,2402919 + ,2348814 + ,2797822 + ,902505 + ,1331319 + ,4204238 + ,2212485 + ,6797382 + ,4532324 + ,1778808 + ,1890720 + ,5463736 + ,11368931 + ,2040164 + ,4276399 + ,3714445 + ,2068168 + ,1003842 + ,2858535 + ,2355484 + ,2719262 + ,1897741 + ,3945185 + ,3799916 + ,1017654 + ,3052241 + ,3932970 + ,3598151 + ,2296005 + ,2202018 + ,2461777 + ,2452042 + ,2185142 + ,11968502 + ,20395972 + ,21756900 + ,30024300 + ,10811344 + ,1819202 + ,1276885 + ,2946701 + ,3587459 + ,2832691 + ,6674805 + ,3868362 + ,4302909 + ,23265229 + ,22348002 + ,11883953 + ,6634979 + ,2935493 + ,3425669 + ,1171611 + ,6875879 + ,19451908 + ,13885933 + ,7643317 + ,10797966 + ,7297445 + ,8739736 + ,12455537 + ,24291181 + ,4215150 + ,28652176 + ,6851172 + ,3746871 + ,7327861 + ,16829710 + ,13778594 + ,6463717 + ,8956867 + ,21204915 + ,16115855 + ,2536113 + ,16645717 + ,17003730 + ,15969006 + ,31020427 + ,23798897 + ,20770321 + ,44410402 + ,27037491 + ,29627771 + ,18189792 + ,4654610 + ,12307201 + ,15300578 + ,10623864 + ,6880178 + ,29947357 + ,18611399 + ,42432604 + ,20208278 + ,14004392 + ,25737765 + ,16735738 + ,22450825 + ,6880840 + ,8510379 + ,8182481 + ,10948683 + ,4805277 + ,2589229 + ,5658407 + ,12862611 + ,5666188 + ,6875556 + ,7098766 + ,36083309 + ,10200330 + ,7784976) > par9 = '0' > par8 = '2' > par7 = '0' > par6 = '3' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '0.0' > 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 <- as.numeric(par5) #seasonal period > par6 <- 6 #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.5519475 -0.4179518 -0.3442125 -0.2545114 -0.2267975 -0.1716481 [2,] -0.5519480 -0.4181093 -0.3450268 -0.2558233 -0.2274447 -0.1717161 [3,] -0.5568071 -0.4282039 -0.3486808 -0.2547973 -0.2293076 -0.1722417 [4,] NA NA NA NA NA NA [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 [15,] NA NA NA NA NA NA [16,] NA NA NA NA NA NA [,7] [,8] [1,] -0.03630213 -0.006545238 [2,] -0.03626211 0.000000000 [3,] 0.00000000 0.000000000 [4,] NA NA [5,] NA NA [6,] NA NA [7,] NA NA [8,] NA NA [9,] NA NA [10,] NA NA [11,] NA NA [12,] NA NA [13,] NA NA [14,] NA NA [15,] NA NA [16,] NA NA [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0 0 0 7e-05 0.00017 0.00135 0.52638 0.90861 [2,] 0 0 0 5e-05 0.00016 0.00134 0.52650 NA [3,] 0 0 0 5e-05 0.00014 0.00129 NA NA [4,] NA NA NA NA NA NA NA NA [5,] NA NA NA NA NA NA NA NA [6,] NA NA NA NA NA NA NA NA [7,] NA NA NA NA NA NA NA NA [8,] NA NA NA NA NA NA NA NA [9,] NA NA NA NA NA NA NA NA [10,] NA NA NA NA NA NA NA NA [11,] NA NA NA NA NA NA NA NA [12,] NA NA NA NA NA NA NA NA [13,] NA NA NA NA NA NA NA NA [14,] NA NA NA NA NA NA NA NA [15,] NA NA NA NA NA NA NA NA [16,] NA 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 ar4 ar5 ar6 sar1 sar2 -0.5519 -0.4180 -0.3442 -0.2545 -0.2268 -0.1716 -0.0363 -0.0065 s.e. 0.0535 0.0615 0.0627 0.0631 0.0598 0.0531 0.0572 0.0570 sigma^2 estimated as 0.4535: log likelihood = -359.64, aic = 737.28 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ar4 ar5 ar6 sar1 sar2 -0.5519 -0.4180 -0.3442 -0.2545 -0.2268 -0.1716 -0.0363 -0.0065 s.e. 0.0535 0.0615 0.0627 0.0631 0.0598 0.0531 0.0572 0.0570 sigma^2 estimated as 0.4535: log likelihood = -359.64, aic = 737.28 [[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 ar4 ar5 ar6 sar1 sar2 -0.5519 -0.4181 -0.3450 -0.2558 -0.2274 -0.1717 -0.0363 0 s.e. 0.0535 0.0615 0.0623 0.0620 0.0595 0.0531 0.0572 0 sigma^2 estimated as 0.4536: log likelihood = -359.65, aic = 735.29 [[3]][[4]] NULL [[3]][[5]] NULL [[3]][[6]] NULL [[3]][[7]] NULL [[3]][[8]] NULL $aic [1] 737.2816 735.2948 733.6966 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 > postscript(file="/var/www/html/rcomp/tmp/1qfcf1291061128.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 = 352 Frequency = 1 [1] 0.0142099112 1.4566291934 0.0549454709 0.3054519921 -0.0385498884 [6] 0.6194442414 0.3628351713 -0.5972770985 0.5716562685 -0.8834082195 [11] 1.1844636310 -0.7464378945 -0.2908921400 -0.6381477924 -0.5075605887 [16] 0.0014836563 0.6262442316 -0.6275002316 0.6284282841 1.1169567199 [21] -0.5661788535 -0.7457875991 0.3825864499 1.6547530020 -0.0646089971 [26] 0.2053727272 -0.8804121560 -0.4319583676 1.5797813473 0.1469420722 [31] 1.0949798770 0.1113646041 -0.7275610870 1.4947910298 -1.7351069329 [36] -0.3395561448 -0.5714295518 0.1406900884 -0.7817429631 0.4292209615 [41] -0.7448766123 0.1744962515 0.0938023240 1.0442522570 -0.4288483713 [46] -0.2653932633 -0.4306319948 0.0205642714 -0.6051541660 -0.1677901665 [51] -0.1980278178 -0.1283447146 0.2699671785 -0.3527671540 -0.4485020436 [56] -0.1969657928 0.3953606470 -0.0679511181 0.1422718677 0.3970385755 [61] -0.8730829216 0.9829360839 -0.3936748792 0.1454269879 0.3472552122 [66] 0.7673366052 0.0684591832 -0.2755254076 0.2368838322 -0.3569515851 [71] -0.2852925521 -0.0686854327 0.0109960974 0.2025538982 0.0395365083 [76] -0.2663986766 -0.0098625789 0.2176113460 1.1173436145 1.8297067201 [81] -0.6048201197 0.8912665788 1.5626031712 -0.2593908951 0.0782356125 [86] 0.9258885640 -0.3235842575 0.4162280286 -1.1144488898 0.3663088037 [91] -0.0547255169 0.7230946803 0.5683773847 -0.7557678024 -1.6189754634 [96] -0.6741492825 0.0595208478 -0.1826820269 -1.2928933359 -0.3811745236 [101] -0.6182051582 -0.7112678331 0.2869020080 1.4285468241 -0.2559581486 [106] 0.8265193158 -0.4674312487 0.6756127210 1.4084172773 -0.7421589419 [111] -0.9362128824 0.5659622601 0.0100782357 0.2414890272 0.4426256597 [116] 0.3196160979 1.0467429381 0.3653514358 -0.4228056527 -0.2259286821 [121] -0.0186555828 0.8100880957 0.6506188930 -0.4853007504 -0.1016661706 [126] -0.9497540509 0.5855211532 -0.0385804451 -0.0668524697 -0.9398720936 [131] 0.2244692545 -1.2136587205 -0.5413692210 -0.7601356578 0.2801732374 [136] 0.0874376314 -0.0830379846 0.1011844182 0.3491779193 -0.8671304467 [141] -0.2436659608 0.0768044059 -0.1994619951 1.1510660030 -0.7113704293 [146] -0.3995034264 -1.1527175798 -0.1033866370 -0.3641855031 -0.5319494639 [151] 0.5970191943 -0.4083979283 1.3050338154 0.2493378784 -1.3166055550 [156] 0.4230066671 0.5652328736 0.3178105825 0.1296672334 -0.6702319309 [161] -0.4273495860 -0.1266689712 0.0645716529 0.7548611590 -0.0744843213 [166] -0.9701691796 -0.0971486627 -0.7931667800 0.3099032380 0.6207251046 [171] -0.3523889082 0.6218050312 0.3739031268 0.8862274749 -0.4419051598 [176] -0.1825765035 -0.3018401241 -0.0414124300 -0.1090782526 0.1254139070 [181] -0.1760321067 -0.7375562230 0.5260697192 0.3869495156 0.4193056903 [186] 1.1524244089 -0.4168674266 0.0007820569 -0.2480841376 -0.3190445940 [191] 0.0679913551 -0.0363961715 0.0273979432 -0.5361841330 -0.1070925566 [196] -0.8107209569 0.4657359924 0.5314289330 0.6585090739 0.0315873645 [201] -0.4833516884 -0.3972113270 -0.4905101182 0.1262362511 -0.2965607744 [206] -0.5912949378 -0.4042358155 0.2070318715 0.2213022845 -0.4943083266 [211] -0.5138841405 3.0076062945 -0.9090699520 0.1290517038 -0.3988317373 [216] -0.1111353754 -0.4299478916 -0.1670437586 0.1250513672 -0.1492609647 [221] -0.0822274299 0.1397096946 0.4412462555 0.1717849603 -0.8269852326 [226] 0.2587434314 -0.3397087638 -0.1887311126 -0.1882710913 -0.1245570708 [231] -0.4405972863 -0.1664828278 1.0568704411 0.1501824841 0.1809405998 [236] 0.3723501843 -0.5481399740 -0.8564259287 0.4054097192 0.2098145942 [241] -0.4561122601 -0.0452442229 -0.1519532883 0.1782609894 -0.8792742033 [246] -0.2121659627 0.8856271149 -0.1539139928 1.1106069630 0.1833179943 [251] -0.7077592990 -0.0654963134 0.8862330527 1.0611563014 -0.9923141922 [256] 0.2043792753 -0.1063599338 -0.5151893630 -0.9082738281 0.2724426952 [261] -0.2419615836 0.1779484367 -0.3688028616 0.5266581646 0.3626785629 [266] -0.9453604565 0.4796144324 0.4332093383 0.1480679360 -0.2516946375 [271] -0.2986875321 -0.0315514752 0.0983558483 -0.1706867311 1.5332345518 [276] 1.3832214113 1.0592251465 1.1204444971 -0.2058636298 -1.6701930257 [281] -1.2183402609 -0.2765195130 -0.2911238021 -0.5345452442 0.4301721302 [286] -0.2823244139 0.3180377397 1.9914577043 0.9848846253 0.1453656938 [291] -0.3237426650 -1.1139468626 -0.4098058222 -1.4203710704 0.6507875160 [296] 1.1524006167 0.3760359279 -0.1271044826 0.4785617275 -0.0123327124 [301] 0.3910634242 0.3621394077 0.6869849983 -1.3347498413 1.3544600860 [306] -0.8615872657 -0.8897997678 0.2078780141 0.6754085483 0.0960018452 [311] -0.4219528486 -0.1026772897 0.9309533237 0.3426015074 -1.5987859918 [316] 0.8734143468 0.4062300399 0.2500677214 0.8667888712 0.1022025439 [321] 0.1134478901 1.1186166515 -0.0818197164 0.1571946465 -0.3304263491 [326] -1.6353382024 0.0112378059 0.0905814768 -0.4846361115 -0.6431020215 [331] 1.0411886145 0.0749076369 1.1530553506 -0.0946556423 -0.3832869886 [336] 0.5244308093 -0.1617653603 0.0404001415 -1.1088933988 -0.5188787073 [341] -0.3677693370 0.0084580472 -0.8789088560 -1.1262414874 0.0735640626 [346] 0.8071788680 -0.4180300006 0.0773663544 -0.0081535263 1.7269126859 [351] -0.2148982695 -0.2915813333 > postscript(file="/var/www/html/rcomp/tmp/2joui1291061128.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/3joui1291061128.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/4joui1291061128.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/5joui1291061128.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/6tytl1291061128.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/7tytl1291061128.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/8qp9t1291061128.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/90zqw1291061128.tab") > > try(system("convert tmp/1qfcf1291061128.ps tmp/1qfcf1291061128.png",intern=TRUE)) character(0) > try(system("convert tmp/2joui1291061128.ps tmp/2joui1291061128.png",intern=TRUE)) character(0) > try(system("convert tmp/3joui1291061128.ps tmp/3joui1291061128.png",intern=TRUE)) character(0) > try(system("convert tmp/4joui1291061128.ps tmp/4joui1291061128.png",intern=TRUE)) character(0) > try(system("convert tmp/5joui1291061128.ps tmp/5joui1291061128.png",intern=TRUE)) character(0) > try(system("convert tmp/6tytl1291061128.ps tmp/6tytl1291061128.png",intern=TRUE)) character(0) > try(system("convert tmp/7tytl1291061128.ps tmp/7tytl1291061128.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.873 1.653 16.676