R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(41130 + ,43144 + ,46195 + ,40033 + ,31710 + ,42297 + ,33889 + ,23495 + ,27060 + ,31160 + ,22214 + ,16905 + ,34388 + ,29982 + ,36374 + ,37630 + ,31023 + ,39875 + ,28866 + ,20205 + ,26082 + ,28209 + ,22813 + ,15296 + ,27796 + ,31813 + ,42513 + ,41222 + ,29094 + ,28948 + ,23230 + ,21308 + ,20649 + ,23666 + ,19206 + ,16361 + ,30472 + ,25051 + ,39393 + ,32091 + ,31007 + ,32998 + ,22809 + ,20439 + ,19900 + ,29161 + ,22149 + ,15485 + ,36181 + ,39545 + ,37955 + ,31854 + ,29788 + ,31435 + ,22504 + ,19540 + ,21893 + ,29556 + ,21811 + ,13729 + ,31332 + ,31434 + ,38812 + ,36154 + ,32820 + ,32301 + ,30358 + ,20724 + ,21056 + ,30077 + ,22411 + ,16758 + ,37243 + ,41795 + ,37755 + ,42557 + ,21507 + ,43211 + ,31476 + ,21440 + ,25307 + ,34050 + ,21970 + ,17327 + ,33607 + ,34259 + ,43309 + ,40189 + ,32663 + ,36262 + ,35718 + ,25002 + ,28764 + ,33085 + ,25403 + ,17468 + ,39457 + ,39408 + ,49419 + ,37128 + ,34698 + ,40939 + ,32695 + ,27523 + ,26875 + ,28460 + ,26511 + ,19576 + ,40659 + ,35685 + ,44559 + ,37584 + ,34670 + ,42953 + ,24058 + ,35359 + ,30919 + ,35346 + ,28309 + ,17417 + ,45465 + ,44651 + ,47947 + ,43458 + ,37744 + ,39730 + ,29903 + ,24284 + ,37981 + ,32001 + ,32273 + ,23314 + ,43522 + ,33000 + ,43685 + ,45838 + ,39741 + ,42522 + ,37318 + ,26920 + ,28651 + ,35646 + ,26312 + ,20442 + ,46402 + ,45329 + ,42185 + ,49341 + ,50472 + ,33020 + ,29567 + ,22870 + ,25730 + ,32609 + ,23536 + ,15135 + ,36776 + ,29982 + ,38062 + ,34226 + ,24906 + ,30233 + ,27405 + ,20784 + ,22886 + ,25425 + ,20838 + ,15655 + ,37158 + ,36364 + ,43213 + ,31635 + ,30113 + ,29985 + ,20919 + ,19429 + ,21427 + ,26064 + ,20109 + ,15369 + ,35466 + ,25954 + ,33504 + ,28115 + ,28501 + ,28618 + ,21434 + ,20177 + ,21484 + ,25642 + ,23515 + ,12941 + ,36190 + ,37785 + ,38407 + ,33326 + ,30304 + ,27576 + ,27048 + ,17291 + ,21018 + ,26792 + ,19426 + ,13927 + ,35647 + ,31746 + ,31277 + ,31583 + ,25607 + ,28151 + ,24947 + ,18077 + ,23429 + ,26313 + ,18862 + ,14753 + ,36409 + ,33163 + ,34122 + ,35225 + ,28249 + ,30374 + ,26311 + ,22069 + ,23651 + ,28628 + ,23187 + ,14727 + ,43080 + ,32519 + ,39657 + ,33614 + ,28671 + ,34243 + ,27336 + ,22916 + ,24537 + ,26128 + ,22602 + ,15744 + ,41086 + ,39690 + ,43129 + ,37863 + ,35953 + ,29133 + ,24693 + ,22205 + ,21725 + ,27192 + ,21790 + ,13253 + ,37702 + ,30364 + ,32609 + ,30212 + ,29965 + ,28352 + ,25814 + ,22414 + ,20506 + ,28806 + ,22228 + ,13971 + ,36845 + ,35338 + ,35022 + ,34777 + ,26887 + ,23970 + ,22780 + ,17351 + ,21382 + ,24561 + ,17409 + ,11514 + ,31514 + ,27071 + ,29462 + ,26105 + ,22397 + ,23843 + ,21705 + ,18089 + ,20764 + ,25316 + ,17704 + ,15548 + ,28029 + ,29383 + ,36438 + ,32034 + ,22679 + ,24319 + ,18004 + ,17537 + ,20366 + ,22782 + ,19169 + ,13807 + ,29743 + ,25591 + ,29096 + ,26482 + ,22405 + ,27044 + ,17970 + ,18730 + ,19684 + ,19785 + ,18479 + ,10698 + ,31956 + ,29506 + ,34506 + ,27165 + ,26736 + ,23691 + ,18157 + ,17328 + ,18205 + ,20995 + ,17382 + ,9367 + ,31124 + ,26551 + ,30651 + ,25859 + ,25100 + ,25778 + ,20418 + ,18688 + ,20424 + ,24776 + ,19814 + ,12738) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '0.0' > 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.8525214 0.07370252 0.05055492 -0.7055664 -0.01619272 0.08926076 [2,] 0.8566190 0.07234867 0.04779336 -0.7082920 0.00000000 0.09326512 [3,] 0.8924060 0.08780521 0.00000000 -0.7402020 0.00000000 0.08766842 [4,] 0.9840734 0.00000000 0.00000000 -0.7761746 0.00000000 0.07023095 [5,] 0.9832039 0.00000000 0.00000000 -0.7677448 0.00000000 0.00000000 [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.8927757 [2,] -0.8974169 [3,] -0.8972392 [4,] -0.8963645 [5,] -0.8835340 [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.32967 0.51431 0 0.80868 0.17879 0 [2,] 0 0.33918 0.53281 0 NA 0.14896 0 [3,] 0 0.21947 NA 0 NA 0.16992 0 [4,] 0 NA NA 0 NA 0.25737 0 [5,] 0 NA NA 0 NA NA 0 [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.8525 0.0737 0.0506 -0.7056 -0.0162 0.0893 -0.8928 s.e. 0.0998 0.0755 0.0774 0.0807 0.0668 0.0662 0.0398 sigma^2 estimated as 0.01173: log likelihood = 251.85, aic = -487.7 [[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.8525 0.0737 0.0506 -0.7056 -0.0162 0.0893 -0.8928 s.e. 0.0998 0.0755 0.0774 0.0807 0.0668 0.0662 0.0398 sigma^2 estimated as 0.01173: log likelihood = 251.85, aic = -487.7 [[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.8566 0.0723 0.0478 -0.7083 0 0.0933 -0.8974 s.e. 0.0989 0.0756 0.0765 0.0801 0 0.0645 0.0350 sigma^2 estimated as 0.01173: log likelihood = 251.82, aic = -489.64 [[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.8924 0.0878 0 -0.7402 0 0.0877 -0.8972 s.e. 0.0762 0.0714 0 0.0528 0 0.0637 0.0351 sigma^2 estimated as 0.01175: log likelihood = 251.63, aic = -491.26 [[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.9841 0 0 -0.7762 0 0.0702 -0.8964 s.e. 0.0124 0 0 0.0374 0 0.0619 0.0352 sigma^2 estimated as 0.0118: log likelihood = 250.89, aic = -491.77 [[3]][[6]] NULL [[3]][[7]] NULL $aic [1] -487.7010 -489.6424 -491.2561 -491.7707 -492.4730 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 arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE > postscript(file="/var/www/html/freestat/rcomp/tmp/1wsz11228822207.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 = 336 Frequency = 1 [1] 0.0106244827 0.0106722833 0.0107406070 0.0105974356 0.0103643604 [6] 0.0106524413 0.0104308132 0.0100645088 0.0102057763 0.0103468539 [11] 0.0100084411 0.0097353282 -0.1285004785 -0.2372993436 -0.1021538345 [16] 0.0415857214 0.0554930554 0.0094005274 -0.0773051269 -0.0654383386 [21] 0.0229257447 -0.0381411670 0.0544490024 -0.0605067930 -0.1941701687 [26] -0.0062807785 0.1310843216 0.1242007910 -0.0244845747 -0.2696238244 [31] -0.1812566833 0.0891109316 -0.1369955446 -0.0978843598 -0.0264019662 [36] 0.1209597984 0.0225085476 -0.1712405486 0.1021031903 -0.0793017022 [41] 0.1313933677 -0.0129657500 -0.1171835950 0.0523943344 -0.1124341590 [46] 0.1493934638 0.0881584135 -0.0005430603 0.1688582563 0.2393355812 [51] -0.0952688371 -0.1652104774 0.0007838330 -0.0802910121 -0.1192967943 [56] -0.0287514213 0.0101389444 0.1129519903 0.0391503569 -0.1384111090 [61] -0.0014709505 0.0236313564 0.0172375739 0.0519980649 0.0980949837 [66] -0.0589728692 0.1802777335 -0.0314237030 -0.0910492226 0.0512124846 [71] 0.0141768600 0.0537312178 0.0914795971 0.1840328894 -0.1226520485 [76] 0.1196211257 -0.4221835408 0.2450308363 0.1343227818 -0.0374834740 [81] 0.0523718268 0.0932370247 -0.0840956719 0.0288610556 -0.0660148705 [86] -0.0450970398 0.0478606507 0.0243674103 0.0479631440 -0.0447746758 [91] 0.1907528305 0.0731142390 0.1102650533 -0.0245938446 0.0171869250 [96] -0.0499802716 0.0368602114 0.0087437212 0.0938430364 -0.1563448331 [101] 0.0796787157 0.0037300508 0.0098494010 0.1230904184 -0.0283266479 [106] -0.1951637974 0.0766656431 0.0723359389 0.0503330034 -0.0983052875 [111] -0.0298136950 -0.0961831523 0.0542017181 0.0804140689 -0.3014181474 [116] 0.4084284516 0.1067449723 0.0214416799 0.0573053284 -0.1139645967 [121] 0.1200212468 0.0875371313 -0.0364230741 -0.0050318618 0.0419901307 [126] -0.0979473902 -0.0882375054 -0.1032912912 0.3162328006 -0.1006909179 [131] 0.1704647003 0.1501354272 -0.0221181128 -0.2703316590 -0.0986481550 [136] 0.0795142998 0.1020695839 -0.0217242615 0.1505827328 -0.0657985054 [141] -0.0755377182 0.0135534147 -0.0685184406 0.0436939331 0.0883295388 [146] 0.0899974539 -0.1665227935 0.1106358351 0.2910563496 -0.3365462829 [151] -0.1183322936 -0.1464501142 -0.1229454131 0.0058610999 -0.1049139593 [156] -0.1970560087 -0.0193765808 -0.1616997013 -0.0469764446 -0.0975611785 [161] -0.2389960685 -0.0814009852 0.0631619786 -0.0121899761 -0.0138995284 [166] -0.0810816490 -0.0158903388 0.0331563109 0.1079167264 0.1178323202 [171] 0.1227940869 -0.1691677266 -0.0216637484 -0.0844212439 -0.2154049356 [176] -0.0287687756 -0.0295365141 0.0027698561 -0.0141985970 0.0592138542 [181] 0.0861962231 -0.1803201000 -0.0563848823 -0.1285329644 0.0827752342 [186] -0.0309111975 -0.0880401139 0.0700233387 0.0151595423 0.0250828017 [191] 0.1682651607 -0.1424844704 0.1156765016 0.2115334241 0.0107553595 [196] -0.0172859154 0.0248070372 -0.1490073587 0.1140729882 -0.1842897188 [201] -0.0484065390 0.0332884886 -0.0709987484 -0.0388414675 0.0862781624 [206] 0.0370280922 -0.1474764061 0.0013787484 -0.0844508904 -0.0302077392 [211] 0.0755468459 -0.0619069172 0.1034896474 0.0202334427 -0.0944396127 [216] 0.0504607762 0.0943445944 0.0443761453 -0.0625121660 0.0758429488 [221] -0.0192105950 0.0029098035 0.0502578504 0.1051829669 0.0212554044 [226] 0.0331817113 0.0671314131 -0.0602485533 0.1783805039 -0.0610399026 [231] 0.0377793732 -0.0644158220 -0.0508431619 0.0685581979 0.0235605464 [236] 0.0687735243 -0.0053935536 -0.1079078279 0.0182973344 -0.0004563866 [241] 0.0904150049 0.1358588501 0.0664692603 0.0025579657 0.1109717776 [246] -0.1997223268 -0.1227520684 0.0079930244 -0.1238368797 -0.0346052086 [251] -0.0200586259 -0.1503869606 0.0359099434 -0.0834903409 -0.1276265719 [256] -0.0799212047 0.0710670014 -0.0559752415 0.0620839872 0.1062675142 [261] -0.1007262943 0.1001706385 0.0425128262 -0.0608968346 0.0223840490 [266] 0.0746632717 -0.0682223386 0.0320424178 -0.1103642859 -0.2193430030 [271] -0.0396976499 -0.1165659598 0.0455020125 -0.0167374673 -0.1266398483 [276] -0.1257637233 -0.0071459707 -0.0540491022 -0.0644688453 -0.0940837892 [281] -0.0974234784 -0.0315798062 0.0442670684 0.0491725955 0.0943075316 [286] 0.0776645932 -0.0518502775 0.2165118989 -0.1582296765 0.0187013328 [291] 0.1316280947 0.0533424154 -0.1519133726 -0.0667289364 -0.1993374238 [296] 0.0207774367 0.0569072320 -0.0241357039 0.0702056764 0.0841850181 [301] -0.0530824331 -0.1030609667 -0.0703959640 -0.0591021823 -0.0509214401 [306] 0.1121890980 -0.1483950217 0.1033775362 0.0229090596 -0.1550371498 [311] 0.0623225383 -0.1639306528 0.1183781819 0.0943302387 0.1029981330 [316] -0.0660442965 0.1091045379 -0.0861301220 -0.1227149722 0.0018177615 [321] -0.0522737782 -0.0531222383 -0.0100636406 -0.2567689115 0.1126732139 [326] 0.0239017735 0.0368604801 -0.0370683918 0.0879406796 0.0534607761 [331] 0.0331946596 0.0680505270 0.0523168598 0.0893159455 0.0580893297 [336] 0.0159296662 > postscript(file="/var/www/html/freestat/rcomp/tmp/26i741228822207.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/freestat/rcomp/tmp/3k6ep1228822207.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/freestat/rcomp/tmp/4rlhk1228822207.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/freestat/rcomp/tmp/5ioa01228822207.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/freestat/rcomp/tmp/64sah1228822207.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/freestat/rcomp/tmp/7dpc21228822208.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/8jom71228822208.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/freestat/rcomp/tmp/950fk1228822208.tab") > > system("convert tmp/1wsz11228822207.ps tmp/1wsz11228822207.png") > system("convert tmp/26i741228822207.ps tmp/26i741228822207.png") > system("convert tmp/3k6ep1228822207.ps tmp/3k6ep1228822207.png") > system("convert tmp/4rlhk1228822207.ps tmp/4rlhk1228822207.png") > system("convert tmp/5ioa01228822207.ps tmp/5ioa01228822207.png") > system("convert tmp/64sah1228822207.ps tmp/64sah1228822207.png") > system("convert tmp/7dpc21228822208.ps tmp/7dpc21228822208.png") > > > proc.time() user system elapsed 30.759 2.035 31.543