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.10192834 0.2307008 0.06884176 -0.9999618 -0.09801904 -0.05766629 [2,] 0.09898390 0.2358389 0.06861012 -1.0000402 -0.04728508 0.00000000 [3,] 0.09737467 0.2388130 0.06893804 -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.6380377 [2,] -0.6887320 [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.38502 0.52089 0 [2,] 0.06389 1e-05 0.19705 0 0.54494 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 arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 3: In log(s2) : NaNs produced 4: 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/1lo051228578378.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.1982627522 [16] 0.2948394342 1.3120201318 -0.6612339045 0.1976039698 -0.7669174087 [21] -0.4721130816 1.1263442993 -1.5254142377 -0.4673245210 0.1258031761 [26] -0.8290010078 -0.4494531457 -0.5533365466 -0.1976821936 0.1465312208 [31] -0.5807426942 -0.5965633392 0.9667611121 -0.4750645700 1.0823943780 [36] 0.0731823389 -1.3685013331 -0.6536764717 0.8867477723 0.3806344516 [41] 0.4099095970 0.5876507209 -0.0242361190 0.5444019061 1.0615724132 [46] 0.2752045682 0.2210470788 -1.0178103890 0.0629342853 0.2292250096 [51] -0.1086085935 0.7807693748 0.6417554501 -0.1959354488 0.2386664062 [56] 0.7216759050 -0.3727377590 -0.2855807619 0.0498815648 0.0547234699 [61] 0.6499108821 -0.8449983112 0.4972117602 0.9913898875 -0.3648441518 [66] -0.3165753215 0.0773065729 0.4511284750 0.9657597117 0.5196323497 [71] 0.8480194930 0.9337455772 1.1918745574 0.3881011479 0.2440019144 [76] -0.2294275522 -0.2189464122 -1.0632270534 0.0229233479 0.5761797012 [81] 0.0704477209 -0.9291809824 -0.3294446990 -0.3757356700 -0.3126126478 [86] -0.4166972758 0.0153415415 0.5310117671 -0.6958330916 -0.0281655764 [91] -0.4633702189 0.6267705417 -0.3120680168 0.6831119672 0.0667259774 [96] -0.0258234569 -0.8226494933 -0.0312066069 0.8008709890 -0.4831580092 [101] 1.0332611414 0.4271753163 -0.5969949544 -0.9714868393 -0.1551254822 [106] 0.3360337320 1.0281802323 -0.0109125276 -0.5447387741 -0.5113133748 [111] -0.1968479129 0.3700559392 0.6652711835 0.6251672615 -0.7086752936 [116] -0.1310223950 0.4247754879 0.5451317197 0.8190372029 0.1712806509 [121] 0.7152148415 1.1788057913 0.1362997822 -0.0184170735 -0.4914969845 [126] -0.2809535482 0.1740535002 -0.1605977796 -1.0551176477 -0.1705922688 [131] -0.9386702220 0.6977306204 -0.4133019105 -0.3442324950 -0.4266627519 [136] -1.0906139473 0.1065800808 0.6502209965 0.0876309419 0.2879039345 [141] 0.1494606912 0.5960489767 0.0076036367 -0.8802821350 -0.4065005422 [146] -0.6860693063 1.4583077594 -0.3396665445 -0.3024564236 1.0770441483 [151] -0.3203039183 0.2760097101 -0.5476039088 0.9486354584 0.1082151086 [156] 0.8132410036 -0.0728362987 0.3392130803 -0.4925598020 -0.2380398873 [161] 0.0555818047 0.1691086970 -0.2810135789 -0.4240533912 -0.1948019436 [166] -0.1735682813 -0.6911582736 -0.0475062640 -0.2089957008 -0.3916731873 [171] 0.0866016895 0.1627649026 0.8126249658 -0.7281137723 -0.4743512397 [176] 1.1029251969 -0.1766962270 -0.5654573924 0.5746114819 -0.2578722840 [181] 0.3390128859 0.4938957914 -0.8042292322 -0.0393776429 0.3311744898 [186] 0.3532049905 -0.3636855454 -0.3788792936 0.1906715733 0.2126655687 [191] 0.2780373768 -0.5522233761 -0.0567651304 -0.2274456302 0.0237313644 [196] 0.2352586479 -0.5004005097 1.1206927245 -1.1200520222 0.3149052139 [201] 0.2111988578 0.0987151600 -0.7178524830 0.1249126268 -0.2674698829 [206] 0.5512465704 -0.6043434988 0.5318315029 -0.2624307965 0.6389361016 [211] -0.5142370550 -0.1764646185 -0.0168290616 -0.0519508662 -0.2168626527 [216] -0.4028863358 -0.2347860114 -0.4206665567 0.5815282013 0.3170074451 [221] 0.6528726490 0.3900539796 -0.4394556910 -0.1463820960 -0.0885909125 [226] 0.2278371723 -0.3468156828 0.2320807937 -0.0627265895 0.0135694627 [231] -0.0138379556 0.0473544313 -0.3066093549 1.5385908632 0.2468861197 [236] -0.5675774457 0.6030976225 0.3808563570 -0.9667936293 -0.7210342949 [241] -0.2689520865 0.8083103293 -0.2651200994 -0.4907665661 -0.0793954843 [246] 1.7000978157 0.1009999248 -0.9244448611 0.0929332290 -0.0514166538 [251] -0.1719414763 -0.3609894505 0.1214649632 0.0553658967 0.2623327850 [256] 0.3874311079 -0.3849163722 0.4462132975 0.6302600150 -0.1664582713 [261] 0.7079526517 -0.2846490836 -0.9244591478 0.0052187089 1.0479661469 [266] 0.8155950939 0.2408034176 0.1208510126 -0.1197152684 0.1825215528 [271] 0.5597480920 0.0412707104 0.3484589681 0.0003602755 0.5237862871 [276] 0.1333713783 -0.1153975181 -0.4992987206 -0.0619152350 -0.2201427007 [281] -0.1149665987 -0.4156072870 0.6009977638 0.3237318221 -0.3886584265 [286] -0.5022528937 0.3221419953 -0.0426809383 -0.0116807330 -0.3825630002 [291] 0.1632110343 -0.2137011045 -0.2249511253 -0.2901579733 0.2650057207 [296] 0.1529359127 -0.1717329207 -0.1355108417 -0.8376944228 -0.0579456147 [301] -0.0897002317 0.3250927627 -0.1784323960 0.1514743502 -0.2490029884 [306] -0.1785389718 0.0541024547 0.0070874182 0.2722076394 -0.6589086046 [311] 0.6141970310 0.3232866643 0.5448818746 -0.1266401244 -0.4543596991 [316] -0.1760780411 0.4344087181 0.1976912445 0.3152625326 -0.1675646323 [321] 0.8801804197 0.0790227031 0.8173344767 0.8069464758 1.7489726706 [326] -0.5857069080 0.1637653236 -0.2131547088 0.0882165818 -1.1430371240 [331] -0.0459690223 0.1076056439 -0.2255061649 0.0302215381 -0.5634583502 [336] -0.1115258291 -0.4309197340 -0.3568729879 -0.2551305763 -0.0231808240 [341] -0.4210596214 0.2888562054 0.5683849628 0.3155399029 -0.6147731404 [346] 0.0548482149 0.1327256604 -0.2169231766 -0.6839527343 0.4623384653 [351] -0.2626925474 -0.8355471471 0.0522093979 0.2847955739 -0.4250195986 [356] 0.4185683301 -0.3179392551 0.0163653484 -0.1322512171 -0.9096050283 [361] 0.1578953437 -0.2665221668 0.3125564415 -0.2348633414 0.2918201332 [366] -0.6259613449 0.8476641228 -0.3337346585 -0.0433557433 -0.2198654388 [371] 0.0106222660 0.5290963443 > postscript(file="/var/www/html/freestat/rcomp/tmp/25coi1228578378.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/3u7w71228578378.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/4fli91228578378.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/5nowp1228578378.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/6ju2n1228578378.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/7qnes1228578378.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/8d24p1228578378.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/9b0q31228578378.tab") > > system("convert tmp/1lo051228578378.ps tmp/1lo051228578378.png") > system("convert tmp/25coi1228578378.ps tmp/25coi1228578378.png") > system("convert tmp/3u7w71228578378.ps tmp/3u7w71228578378.png") > system("convert tmp/4fli91228578378.ps tmp/4fli91228578378.png") > system("convert tmp/5nowp1228578378.ps tmp/5nowp1228578378.png") > system("convert tmp/6ju2n1228578378.ps tmp/6ju2n1228578378.png") > system("convert tmp/7qnes1228578378.ps tmp/7qnes1228578378.png") > > > proc.time() user system elapsed 31.103 2.143 31.966