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(8.55,8.56,8.57,8.59,8.61,8.62,8.62,8.63,8.71,8.72,8.74,8.75,8.79,8.82,8.82,8.84,8.86,8.86,8.85,8.86,8.86,8.87,8.88,8.9,8.91,8.96,8.98,8.99,9,9,9,9.01,9.01,8.99,8.99,8.99,9,9,9.02,9.05,9.05,9.05,9.06,9.06,9.08,9.07,9.06,9.08,9.07,9.11,9.15,9.15,9.17,9.2,9.23,9.26,9.27,9.28,9.29,9.29,9.11,9.06,9.11,9.13,9.13,9.19,9.2,9.23,9.24,9.28,9.32,9.32,9.32,9.36,9.37,9.38,9.41,9.44,9.44,9.44,9.47,9.48,9.56,9.58,9.56,9.58,9.7,9.74,9.76,9.78,9.84,9.88,9.96,9.97,9.96,9.96) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > if (par1 == 'Default') { + par1 = 10*log10(length(x)) + } else { + par1 <- as.numeric(par1) + } > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > if (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/html/rcomp/tmp/1pfhc1260301809.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2m91u1260301809.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 0.225847419 -0.091652334 0.055142739 0.152792463 [6] -0.038654921 0.009489968 -0.111416794 -0.064443137 -0.049881290 [11] -0.025010284 -0.020328531 0.076358696 0.043549436 0.038780161 [16] 0.124984284 0.008449348 0.058901911 0.058144974 0.042428740 [21] 0.010755924 -0.046788359 -0.201278162 0.073807376 0.120386757 [26] -0.064450705 -0.189265438 0.065456902 0.044267190 -0.052403192 [31] -0.074126337 -0.051887703 -0.150158382 0.021476082 0.019513124 [36] -0.094644560 -0.010295854 0.026936866 0.005178932 0.020309000 [41] -0.006922413 -0.001139006 0.086700203 0.035197620 -0.041109564 [46] -0.066102880 -0.010745060 -0.049630809 -0.078462519 > (mypacf <- c(rpacf$acf)) [1] 0.225847419 -0.150327135 0.121724097 0.102089873 -0.093710843 [6] 0.080612260 -0.188600935 0.016211350 -0.061614346 -0.012798225 [11] 0.039633956 0.063116121 0.039400379 0.024777259 0.118428364 [16] -0.104867971 0.129803328 -0.045226150 0.052803822 0.035847337 [21] -0.110804702 -0.120809818 0.153936415 0.039046143 -0.052448919 [26] -0.099107481 0.059712885 -0.017991570 -0.082291230 -0.035836451 [31] -0.079828273 -0.154697267 0.107269751 -0.014299460 -0.099119119 [36] 0.094143256 -0.047889164 0.016796738 0.024726146 -0.055698141 [41] 0.066427345 0.040717574 0.015422097 -0.013894868 -0.005723779 [46] 0.017267498 -0.050894439 -0.134423871 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #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,'Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','ACF(k)','click here for more information about the Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 2:(par1+1)) { + a<-table.row.start(a) + a<-table.element(a,i-1,header=TRUE) + a<-table.element(a,round(myacf[i],6)) + mytstat <- myacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/38wfh1260301809.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Partial Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','PACF(k)','click here for more information about the Partial Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:par1) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,round(mypacf[i],6)) + mytstat <- mypacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/4ixl11260301809.tab") > > system("convert tmp/1pfhc1260301809.ps tmp/1pfhc1260301809.png") > system("convert tmp/2m91u1260301809.ps tmp/2m91u1260301809.png") > > > proc.time() user system elapsed 0.590 0.315 1.511