R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(695,638,762,635,721,854,418,367,824,687,601,676,740,691,683,594,729,731,386,331,707,715,657,653,642,643,718,654,632,731,392,344,792,852,649,629,685,617,715,715,629,916,531,357,917,828,708,858) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/wessaorg/rcomp/tmp/11d4h1324649514.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2pcnz1324649514.ps",horizontal=F,onefile=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.066467951 -0.426652701 0.108670456 -0.017820922 [6] -0.073736534 0.075434242 -0.064241552 0.069295032 0.048331887 [11] -0.302976432 0.047269407 0.607039431 0.073671976 -0.345870091 [16] -0.049480562 -0.041500848 -0.099260413 0.022237785 -0.050929860 [21] -0.015220982 0.067437276 -0.166173422 -0.044370514 0.372705679 [26] 0.040405198 -0.328670822 -0.061150216 0.009444593 -0.073504391 [31] 0.015340194 -0.007374156 -0.017291304 0.087782970 -0.081283184 [36] -0.070133131 0.221927090 0.009793906 -0.173905584 0.041532409 [41] -0.033593344 -0.053679862 0.066106325 0.012132955 0.005757452 [46] 0.025448226 -0.002516332 0.007104719 > (mypacf <- c(rpacf$acf)) [1] 0.066467951 -0.432983606 0.220150547 -0.320688183 0.198946355 [6] -0.193032024 0.065693826 0.074369947 -0.100655003 -0.212824548 [11] 0.169671103 0.513396029 -0.024326484 0.049855758 -0.242502408 [16] -0.011481810 -0.188498561 0.001247264 -0.174309802 -0.161072955 [21] 0.093930977 -0.107501819 0.095903478 -0.147586873 -0.002351068 [26] -0.164834603 0.083025432 0.022209784 -0.013483788 0.012671199 [31] -0.018940930 0.030570388 0.023387487 -0.081526619 -0.015213930 [36] -0.172272504 0.017244028 0.158492382 0.044190559 -0.056657722 [41] -0.085896347 -0.005151750 0.061765567 -0.020585100 -0.176289340 [46] 0.084915832 -0.059743505 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/3xa0u1324649514.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/wessaorg/rcomp/tmp/49ezs1324649514.tab") > > try(system("convert tmp/11d4h1324649514.ps tmp/11d4h1324649514.png",intern=TRUE)) character(0) > try(system("convert tmp/2pcnz1324649514.ps tmp/2pcnz1324649514.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.736 0.140 0.874