R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(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) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > 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.5568072 -0.4282038 -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.03626210 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/fisher/rcomp/tmp/1pbi81358280416.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.4566291926 0.0549454908 0.3054519695 -0.0385498947 [6] 0.6194442462 0.3628352139 -0.5972771484 0.5716562673 -0.8834082033 [11] 1.1844636298 -0.7464378905 -0.2908921639 -0.6381477681 -0.5075606185 [16] 0.0014836994 0.6262441825 -0.6275002023 0.6284282512 1.1169567490 [21] -0.5661788370 -0.7457876230 0.3825864173 1.6547530686 -0.0646089932 [26] 0.2053726560 -0.8804121243 -0.4319583323 1.5797813470 0.1469420504 [31] 1.0949798712 0.1113645814 -0.7275610648 1.4947910527 -1.7351069451 [36] -0.3395561740 -0.5714295723 0.1406901038 -0.7817429177 0.4292208755 [41] -0.7448765471 0.1744962248 0.0938023320 1.0442522319 -0.4288483266 [46] -0.2653933265 -0.4306319566 0.0205642815 -0.6051541462 -0.1677902154 [51] -0.1980277880 -0.1283447126 0.2699671876 -0.3527671653 -0.4485020352 [56] -0.1969658062 0.3953606550 -0.0679511039 0.1422718457 0.3970385829 [61] -0.8730829020 0.9829360758 -0.3936748698 0.1454269842 0.3472552078 [66] 0.7673365953 0.0684592330 -0.2755254596 0.2368838494 -0.3569515720 [71] -0.2852925585 -0.0686854601 0.0109961147 0.2025539071 0.0395364905 [76] -0.2663986703 -0.0098625788 0.2176113439 1.1173436143 1.8297067240 [81] -0.6048201191 0.8912665532 1.5626032028 -0.2593908608 0.0782355678 [86] 0.9258885178 -0.3235841767 0.4162280006 -1.1144489298 0.3663088234 [91] -0.0547254915 0.7230946249 0.5683774058 -0.7557678314 -1.6189754538 [96] -0.6741493115 0.0595208889 -0.1826820410 -1.2928933758 -0.3811745374 [101] -0.6182050953 -0.7112678300 0.2869019781 1.4285468215 -0.2559581118 [106] 0.8265192728 -0.4674312192 0.6756127501 1.4084172914 -0.7421589780 [111] -0.9362128727 0.5659622409 0.0100783074 0.2414890128 0.4426256039 [116] 0.3196161216 1.0467429675 0.3653514059 -0.4228056541 -0.2259286899 [121] -0.0186555897 0.8100881115 0.6506188859 -0.4853007645 -0.1016661738 [126] -0.9497540364 0.5855211559 -0.0385804483 -0.0668525059 -0.9398720873 [131] 0.2244692401 -1.2136586645 -0.5413692649 -0.7601356565 0.2801732245 [136] 0.0874376703 -0.0830380264 0.1011844473 0.3491779195 -0.8671304256 [141] -0.2436659958 0.0768044229 -0.1994619784 1.1510659982 -0.7113704320 [146] -0.3995034137 -1.1527175767 -0.1033866447 -0.3641854703 -0.5319495160 [151] 0.5970192065 -0.4083979154 1.3050338336 0.2493378762 -1.3166055615 [156] 0.4230066535 0.5652328819 0.3178106277 0.1296671817 -0.6702319400 [161] -0.4273495338 -0.1266689760 0.0645716417 0.7548611571 -0.0744843320 [166] -0.9701691859 -0.0971486588 -0.7931667559 0.3099032320 0.6207250811 [171] -0.3523889106 0.6218050454 0.3739031269 0.8862275038 -0.4419051681 [176] -0.1825765461 -0.3018400930 -0.0414124288 -0.1090782455 0.1254138819 [181] -0.1760320820 -0.7375562347 0.5260697183 0.3869495273 0.4193056876 [186] 1.1524243826 -0.4168674183 0.0007820715 -0.2480841468 -0.3190445871 [191] 0.0679913607 -0.0363962033 0.0273979654 -0.5361841336 -0.1070925616 [196] -0.8107209469 0.4657359776 0.5314289369 0.6585090646 0.0315873722 [201] -0.4833517066 -0.3972112950 -0.4905101248 0.1262362478 -0.2965607841 [206] -0.5912949416 -0.4042358098 0.2070318850 0.2213023033 -0.4943083516 [211] -0.5138841593 3.0076063064 -0.9090698931 0.1290516358 -0.3988317413 [216] -0.1111353339 -0.4299478424 -0.1670438744 0.1250514355 -0.1492609693 [221] -0.0822274334 0.1397096860 0.4412462835 0.1717849420 -0.8269852535 [226] 0.2587434277 -0.3397087358 -0.1887311155 -0.1882711070 -0.1245570739 [231] -0.4405972541 -0.1664828560 1.0568704537 0.1501825001 0.1809405793 [236] 0.3723501710 -0.5481399444 -0.8564259232 0.4054096835 0.2098146283 [241] -0.4561122609 -0.0452442587 -0.1519532659 0.1782610253 -0.8792742323 [246] -0.2121659931 0.8856271430 -0.1539139830 1.1106069437 0.1833179948 [251] -0.7077592752 -0.0654963227 0.8862330396 1.0611563481 -0.9923142308 [256] 0.2043792362 -0.1063598764 -0.5151893391 -0.9082738693 0.2724426554 [261] -0.2419615220 0.1779484036 -0.3688028682 0.5266581695 0.3626785973 [266] -0.9453604956 0.4796144249 0.4332093562 0.1480679592 -0.2516946686 [271] -0.2986875437 -0.0315514252 0.0983558363 -0.1706867449 1.5332345468 [276] 1.3832214378 1.0592251390 1.1204444871 -0.2058636250 -1.6701930098 [281] -1.2183403046 -0.2765195026 -0.2911237799 -0.5345452817 0.4301721108 [286] -0.2823243609 0.3180377357 1.9914576765 0.9848846351 0.1453656816 [291] -0.3237427075 -1.1139468213 -0.4098057880 -1.4203710984 0.6507874969 [296] 1.1524006489 0.3760359267 -0.1271044887 0.4785617066 -0.0123326584 [301] 0.3910633863 0.3621393768 0.6869850047 -1.3347498107 1.3544600485 [306] -0.8615872052 -0.8897997921 0.2078779896 0.6754085365 0.0960019145 [311] -0.4219529391 -0.1026772708 0.9309533620 0.3426015115 -1.5987860387 [316] 0.8734143297 0.4062300951 0.2500677294 0.8667888295 0.1022025392 [321] 0.1134479481 1.1186166068 -0.0818197007 0.1571946464 -0.3304263754 [326] -1.6353381995 0.0112378194 0.0905814693 -0.4846361010 -0.6431020558 [331] 1.0411885971 0.0749077078 1.1530553144 -0.0946556631 -0.3832869894 [336] 0.5244308361 -0.1617653785 0.0404001676 -1.1088934293 -0.5188787064 [341] -0.3677693051 0.0084580378 -0.8789088566 -1.1262415220 0.0735640796 [346] 0.8071788851 -0.4180299912 0.0773663044 -0.0081535066 1.7269127216 [351] -0.2148982532 -0.2915813892 > postscript(file="/var/fisher/rcomp/tmp/2xlp61358280416.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/fisher/rcomp/tmp/3465y1358280416.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/fisher/rcomp/tmp/4iffm1358280416.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/fisher/rcomp/tmp/5zx7g1358280416.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/fisher/rcomp/tmp/6c6rv1358280416.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/fisher/rcomp/tmp/7r2nu1358280416.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/83miy1358280416.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/fisher/rcomp/tmp/9bw8j1358280416.tab") > > try(system("convert tmp/1pbi81358280416.ps tmp/1pbi81358280416.png",intern=TRUE)) character(0) > try(system("convert tmp/2xlp61358280416.ps tmp/2xlp61358280416.png",intern=TRUE)) character(0) > try(system("convert tmp/3465y1358280416.ps tmp/3465y1358280416.png",intern=TRUE)) character(0) > try(system("convert tmp/4iffm1358280416.ps tmp/4iffm1358280416.png",intern=TRUE)) character(0) > try(system("convert tmp/5zx7g1358280416.ps tmp/5zx7g1358280416.png",intern=TRUE)) character(0) > try(system("convert tmp/6c6rv1358280416.ps tmp/6c6rv1358280416.png",intern=TRUE)) character(0) > try(system("convert tmp/7r2nu1358280416.ps tmp/7r2nu1358280416.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 11.449 2.431 13.890