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(235.1 + ,280.7 + ,264.6 + ,240.7 + ,201.4 + ,240.8 + ,241.1 + ,223.8 + ,206.1 + ,174.7 + ,203.3 + ,220.5 + ,299.5 + ,347.4 + ,338.3 + ,327.7 + ,351.6 + ,396.6 + ,438.8 + ,395.6 + ,363.5 + ,378.8 + ,357 + ,369 + ,464.8 + ,479.1 + ,431.3 + ,366.5 + ,326.3 + ,355.1 + ,331.6 + ,261.3 + ,249 + ,205.5 + ,235.6 + ,240.9 + ,264.9 + ,253.8 + ,232.3 + ,193.8 + ,177 + ,213.2 + ,207.2 + ,180.6 + ,188.6 + ,175.4 + ,199 + ,179.6 + ,225.8 + ,234 + ,200.2 + ,183.6 + ,178.2 + ,203.2 + ,208.5 + ,191.8 + ,172.8 + ,148 + ,159.4 + ,154.5 + ,213.2 + ,196.4 + ,182.8 + ,176.4 + ,153.6 + ,173.2 + ,171 + ,151.2 + ,161.9 + ,157.2 + ,201.7 + ,236.4 + ,356.1 + ,398.3 + ,403.7 + ,384.6 + ,365.8 + ,368.1 + ,367.9 + ,347 + ,343.3 + ,292.9 + ,311.5 + ,300.9 + ,366.9 + ,356.9 + ,329.7 + ,316.2 + ,269 + ,289.3 + ,266.2 + ,253.6 + ,233.8 + ,228.4 + ,253.6 + ,260.1 + ,306.6 + ,309.2 + ,309.5 + ,271 + ,279.9 + ,317.9 + ,298.4 + ,246.7 + ,227.3 + ,209.1 + ,259.9 + ,266 + ,320.6 + ,308.5 + ,282.2 + ,262.7 + ,263.5 + ,313.1 + ,284.3 + ,252.6 + ,250.3 + ,246.5 + ,312.7 + ,333.2 + ,446.4 + ,511.6 + ,515.5 + ,506.4 + ,483.2 + ,522.3 + ,509.8 + ,460.7 + ,405.8 + ,375 + ,378.5 + ,406.8 + ,467.8 + ,469.8 + ,429.8 + ,355.8 + ,332.7 + ,378 + ,360.5 + ,334.7 + ,319.5 + ,323.1 + ,363.6 + ,352.1 + ,411.9 + ,388.6 + ,416.4 + ,360.7 + ,338 + ,417.2 + ,388.4 + ,371.1 + ,331.5 + ,353.7 + ,396.7 + ,447 + ,533.5 + ,565.4 + ,542.3 + ,488.7 + ,467.1 + ,531.3 + ,496.1 + ,444 + ,403.4 + ,386.3 + ,394.1 + ,404.1 + ,462.1 + ,448.1 + ,432.3 + ,386.3 + ,395.2 + ,421.9 + ,382.9 + ,384.2 + ,345.5 + ,323.4 + ,372.6 + ,376 + ,462.7 + ,487 + ,444.2 + ,399.3 + ,394.9 + ,455.4 + ,414 + ,375.5 + ,347 + ,339.4 + ,385.8 + ,378.8 + ,451.8 + ,446.1 + ,422.5 + ,383.1 + ,352.8 + ,445.3 + ,367.5 + ,355.1 + ,326.2 + ,319.8 + ,331.8 + ,340.9 + ,394.1 + ,417.2 + ,369.9 + ,349.2 + ,321.4 + ,405.7 + ,342.9 + ,316.5 + ,284.2 + ,270.9 + ,288.8 + ,278.8 + ,324.4 + ,310.9 + ,299 + ,273 + ,279.3 + ,359.2 + ,305 + ,282.1 + ,250.3 + ,246.5 + ,257.9 + ,266.5 + ,315.9 + ,318.4 + ,295.4 + ,266.4 + ,245.8 + ,362.8 + ,324.9 + ,294.2 + ,289.5 + ,295.2 + ,290.3 + ,272 + ,307.4 + ,328.7 + ,292.9 + ,249.1 + ,230.4 + ,361.5 + ,321.7 + ,277.2 + ,260.7 + ,251 + ,257.6 + ,241.8 + ,287.5 + ,292.3 + ,274.7 + ,254.2 + ,230 + ,339 + ,318.2 + ,287 + ,295.8 + ,284 + ,271 + ,262.7 + ,340.6 + ,379.4 + ,373.3 + ,355.2 + ,338.4 + ,466.9 + ,451 + ,422 + ,429.2 + ,425.9 + ,460.7 + ,463.6 + ,541.4 + ,544.2 + ,517.5 + ,469.4 + ,439.4 + ,549 + ,533 + ,506.1 + ,484 + ,457 + ,481.5 + ,469.5 + ,544.7 + ,541.2 + ,521.5 + ,469.7 + ,434.4 + ,542.6 + ,517.3 + ,485.7 + ,465.8 + ,447 + ,426.6 + ,411.6 + ,467.5 + ,484.5 + ,451.2 + ,417.4 + ,379.9 + ,484.7 + ,455 + ,420.8 + ,416.5 + ,376.3 + ,405.6 + ,405.8 + ,500.8 + ,514 + ,475.5 + ,430.1 + ,414.4 + ,538 + ,526 + ,488.5 + ,520.2 + ,504.4 + ,568.5 + ,610.6 + ,818 + ,830.9 + ,835.9 + ,782 + ,762.3 + ,856.9 + ,820.9 + ,769.6 + ,752.2 + ,724.4 + ,723.1 + ,719.5 + ,817.4 + ,803.3 + ,752.5 + ,689 + ,630.4 + ,765.5 + ,757.7 + ,732.2 + ,702.6 + ,683.3 + ,709.5 + ,702.2 + ,784.8 + ,810.9 + ,755.6 + ,656.8 + ,615.1 + ,745.3 + ,694.1 + ,675.7 + ,643.7 + ,622.1 + ,634.6 + ,588 + ,689.7 + ,673.9 + ,647.9 + ,568.8 + ,545.7 + ,632.6 + ,643.8 + ,593.1 + ,579.7 + ,546 + ,562.9 + ,572.5) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '1' > par3 = '2' > par2 = '0.5' > 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.10192835 0.2307008 0.06884176 -0.9999618 -0.09801906 -0.05766631 [2,] 0.09896065 0.2358374 0.06855848 -1.0000375 -0.04728178 0.00000000 [3,] 0.09737468 0.2388130 0.06893803 -1.0000409 0.00000000 0.00000000 [4,] 0.11360081 0.2457292 0.00000000 -1.0000447 0.00000000 0.00000000 [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 [,7] [1,] -0.6380376 [2,] -0.6887044 [3,] -0.7147999 [4,] -0.7182112 [5,] NA [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.05762 2e-05 0.19553 0 0.38498 0.52086 0 [2,] 0.06395 1e-05 0.19738 0 0.54498 NA 0 [3,] 0.06793 1e-05 0.19484 0 NA NA 0 [4,] 0.02903 0e+00 NA 0 NA NA 0 [5,] NA NA NA NA NA NA NA [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.1019 0.2307 0.0688 -1.0000 -0.0980 -0.0577 -0.638 s.e. 0.0535 0.0529 0.0531 0.0089 0.1127 0.0897 0.104 sigma^2 estimated as 0.2841: log likelihood = -293.4, aic = 602.81 [[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.1019 0.2307 0.0688 -1.0000 -0.0980 -0.0577 -0.638 s.e. 0.0535 0.0529 0.0531 0.0089 0.1127 0.0897 0.104 sigma^2 estimated as 0.2841: log likelihood = -293.4, aic = 602.81 [[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.0990 0.2358 0.0686 -1.000 -0.0473 0 -0.6887 s.e. 0.0533 0.0522 0.0531 0.009 0.0780 0 0.0613 sigma^2 estimated as 0.2843: log likelihood = -293.6, aic = 601.21 [[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.0974 0.2388 0.0689 -1.0000 0 0 -0.7148 s.e. 0.0532 0.0519 0.0531 0.0091 0 0 0.0409 sigma^2 estimated as 0.2845: log likelihood = -293.79, aic = 599.57 [[3]][[5]] NULL [[3]][[6]] NULL [[3]][[7]] NULL $aic [1] 602.8085 601.2093 599.5729 599.2566 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 log(s2) : NaNs produced 3: In log(s2) : NaNs produced 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 6: In log(s2) : NaNs produced 7: 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/1lctw1228568681.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 = 372 Frequency = 1 [1] 0.0046230641 -0.0028739023 -0.0051325309 -0.0055831214 -0.0057902597 [6] -0.0036212978 -0.0033074778 -0.0034836662 -0.0035434123 -0.0039599894 [11] -0.0091050292 -0.0057068379 -0.0173323698 0.0381398135 0.1982627530 [16] 0.2948394319 1.3120201214 -0.6612339193 0.1976039807 -0.7669174015 [21] -0.4721130727 1.1263443037 -1.5254142517 -0.4673244995 0.1258031832 [26] -0.8290010152 -0.4494531334 -0.5533365404 -0.1976821921 0.1465312199 [31] -0.5807426988 -0.5965633307 0.9667611155 -0.4750645875 1.0823943787 [36] 0.0731823284 -1.3685013325 -0.6536764425 0.8867477763 0.3806344317 [41] 0.4099095876 0.5876507176 -0.0242361248 0.5444019090 1.0615724053 [46] 0.2752045542 0.2210470806 -1.0178103800 0.0629343016 0.2292250117 [51] -0.1086086010 0.7807693750 0.6417554367 -0.1959354566 0.2386664144 [56] 0.7216759024 -0.3727377682 -0.2855807521 0.0498815727 0.0547234686 [61] 0.6499108780 -0.8449983146 0.4972117706 0.9913898786 -0.3648441691 [66] -0.3165753095 0.0773065818 0.4511284690 0.9657597010 0.5196323361 [71] 0.8480194864 0.9337455700 1.1918745436 0.3881011413 0.2440019172 [76] -0.2294275460 -0.2189464027 -1.0632270404 0.0229233628 0.5761796961 [81] 0.0704477054 -0.9291809785 -0.3294446841 -0.3757356658 -0.3126126499 [86] -0.4166972711 0.0153415423 0.5310117600 -0.6958330989 -0.0281655648 [91] -0.4633702152 0.6267705383 -0.3120680254 0.6831119666 0.0667259708 [96] -0.0258234594 -0.8226494858 -0.0312065943 0.8008709850 -0.4831580241 [101] 1.0332611459 0.4271753057 -0.5969949583 -0.9714868213 -0.1551254675 [106] 0.3360337288 1.0281802178 -0.0109125418 -0.5447387689 -0.5113133584 [111] -0.1968479078 0.3700559372 0.6652711718 0.6251672492 -0.7086752945 [116] -0.1310223804 0.4247754909 0.5451317072 0.8190371911 0.1712806425 [121] 0.7152148419 1.1788057844 0.1362997683 -0.0184170680 -0.4914969749 [126] -0.2809535383 0.1740535080 -0.1605977826 -1.0551176419 -0.1705922548 [131] -0.9386702212 0.6977306230 -0.4133019209 -0.3442324954 -0.4266627434 [136] -1.0906139424 0.1065800920 0.6502209870 0.0876309268 0.2879039331 [141] 0.1494606901 0.5960489714 0.0076036308 -0.8802821305 -0.4065005237 [146] -0.6860692984 1.4583077573 -0.3396665637 -0.3024564214 1.0770441540 [151] -0.3203039343 0.2760097143 -0.5476039030 0.9486354578 0.1082150978 [156] 0.8132409971 -0.0728363013 0.3392130825 -0.4925598005 -0.2380398770 [161] 0.0555818111 0.1691086898 -0.2810135788 -0.4240533857 -0.1948019350 [166] -0.1735682833 -0.6911582712 -0.0475062574 -0.2089957011 -0.3916731874 [171] 0.0866016922 0.1627648993 0.8126249570 -0.7281137823 -0.4743512251 [176] 1.1029252023 -0.1766962446 -0.5654573895 0.5746114938 -0.2578722938 [181] 0.3390128877 0.4938957889 -0.8042292377 -0.0393776275 0.3311744891 [186] 0.3532049796 -0.3636855452 -0.3788792872 0.1906715805 0.2126655626 [191] 0.2780373709 -0.5522233761 -0.0567651214 -0.2274456276 0.0237313651 [196] 0.2352586472 -0.5004005143 1.1206927254 -1.1200520296 0.3149052251 [201] 0.2111988589 0.0987151489 -0.7178524780 0.1249126371 -0.2674698833 [206] 0.5512465677 -0.6043435021 0.5318315068 -0.2624308002 0.6389360957 [211] -0.5142370539 -0.1764646133 -0.0168290551 -0.0519508700 -0.2168626503 [216] -0.4028863311 -0.2347860052 -0.4206665546 0.5815282029 0.3170074325 [221] 0.6528726395 0.3900539692 -0.4394556887 -0.1463820848 -0.0885909077 [226] 0.2278371705 -0.3468156831 0.2320807982 -0.0627265905 0.0135694617 [231] -0.0138379540 0.0473544292 -0.3066093549 1.5385908572 0.2468861014 [236] -0.5675774461 0.6030976376 0.3808563469 -0.9667936290 -0.7210342728 [241] -0.2689520739 0.8083103234 -0.2651201128 -0.4907665628 -0.0793954742 [246] 1.7000978005 0.1009999011 -0.9244448555 0.0929332499 -0.0514166571 [251] -0.1719414752 -0.3609894433 0.1214649672 0.0553658918 0.2623327814 [256] 0.3874311034 -0.3849163755 0.4462132957 0.6302600093 -0.1664582778 [261] 0.7079526542 -0.2846490891 -0.9244591367 0.0052187284 1.0479661398 [266] 0.8155950706 0.2408034071 0.1208510147 -0.1197152636 0.1825215506 [271] 0.5597480889 0.0412707055 0.3484589667 0.0003602747 0.5237862895 [276] 0.1333713753 -0.1153975197 -0.4992987149 -0.0619152275 -0.2201426999 [281] -0.1149665970 -0.4156072887 0.6009977631 0.3237318124 -0.3886584335 [286] -0.5022528825 0.3221420025 -0.0426809444 -0.0116807355 -0.3825629975 [291] 0.1632110372 -0.2137011063 -0.2249511230 -0.2901579709 0.2650057189 [296] 0.1529359070 -0.1717329246 -0.1355108365 -0.8376944167 -0.0579456039 [301] -0.0897002330 0.3250927571 -0.1784324008 0.1514743507 -0.2490029872 [306] -0.1785389703 0.0541024555 0.0070874153 0.2722076369 -0.6589086043 [311] 0.6141970389 0.3232866558 0.5448818641 -0.1266401269 -0.4543596935 [316] -0.1760780303 0.4344087188 0.1976912353 0.3152625268 -0.1675646332 [321] 0.8801804185 0.0790226952 0.8173344726 0.8069464672 1.7489726521 [326] -0.5857069211 0.1637653396 -0.2131546980 0.0882165827 -1.1430371163 [331] -0.0459690091 0.1076056442 -0.2255061746 0.0302215423 -0.5634583508 [336] -0.1115258250 -0.4309197358 -0.3568729838 -0.2551305717 -0.0231808242 [341] -0.4210596226 0.2888562086 0.5683849533 0.3155398906 -0.6147731410 [346] 0.0548482266 0.1327256601 -0.2169231815 -0.6839527293 0.4623384737 [351] -0.2626925541 -0.8355471428 0.0522094117 0.2847955685 -0.4250196072 [356] 0.4185683335 -0.3179392592 0.0163653504 -0.1322512147 -0.9096050254 [361] 0.1578953552 -0.2665221700 0.3125564392 -0.2348633422 0.2918201327 [366] -0.6259613447 0.8476641250 -0.3337346684 -0.0433557408 -0.2198654317 [371] 0.0106222660 0.5290963438 > postscript(file="/var/www/html/rcomp/tmp/2u95v1228568681.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/33xfs1228568681.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/4s5ll1228568681.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/5ndoa1228568681.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/6lxad1228568681.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/7g0b31228568681.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/88puh1228568682.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/9g3ub1228568682.tab") > > system("convert tmp/1lctw1228568681.ps tmp/1lctw1228568681.png") > system("convert tmp/2u95v1228568681.ps tmp/2u95v1228568681.png") > system("convert tmp/33xfs1228568681.ps tmp/33xfs1228568681.png") > system("convert tmp/4s5ll1228568681.ps tmp/4s5ll1228568681.png") > system("convert tmp/5ndoa1228568681.ps tmp/5ndoa1228568681.png") > system("convert tmp/6lxad1228568681.ps tmp/6lxad1228568681.png") > system("convert tmp/7g0b31228568681.ps tmp/7g0b31228568681.png") > > > proc.time() user system elapsed 22.055 2.204 24.583