R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(6,6,8,4,8,10,9,12,9,11,11,11,11,11,9,8,6,7,8,6,5,2,3,3,7,8,7,7,6,6,7,5,5,5,4,4,4,1,-1,3,4,3,2,1,4,3,5,6,6,6,6,6,5,6,5,6,5,7,4,5,6,6,5,3,2,3,3,2,0,4,4,5,6,6,5,5,3,5,5,5,3,6,6,4,6,5,4,5,5,4,3,2,3,2,-1,0,-2,1,-2,-2,-2,-6,-4,-2,0,-5,-4,-5,-1,-2,-4,-1,1,1,-2,1,1,3,3,1,1,0,2,2,-1,1,0,1,1,3,2) > par8 = '' > par7 = '' > 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 (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/15w8q1355411864.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2eb8h1355411864.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.303627071 -0.024218623 -0.095039917 0.027851865 [6] 0.162887182 -0.078964672 0.039551062 -0.095342875 0.056066157 [11] -0.124010480 0.039542086 -0.024313998 -0.019575523 -0.045651723 [16] 0.035011193 0.072861767 -0.145067688 0.084782011 -0.102478639 [21] 0.096483452 -0.031153538 0.042325365 0.025438867 -0.152559147 [26] 0.108032293 0.004171833 0.001653361 -0.050569728 -0.086273234 [31] 0.079868494 0.061049242 -0.100137453 0.004374926 0.001856454 [36] 0.080221944 -0.137926314 0.073471048 0.033391494 -0.030975129 [41] 0.006948379 -0.099574177 0.158938640 -0.004545480 -0.038024495 [46] -0.014177275 0.016562221 0.028192973 0.049669833 > (mypacf <- c(rpacf$acf)) [1] -0.3036270709 -0.1282294135 -0.1593378835 -0.0683207291 0.1495525078 [6] 0.0181001406 0.0596979462 -0.0417265872 0.0046063036 -0.1625579132 [11] -0.0697731229 -0.0751569678 -0.0613472220 -0.0960010233 0.0326767260 [16] 0.0888782064 -0.0898386117 0.0245656557 -0.0810048649 -0.0292176929 [21] -0.0529590841 0.0404151090 0.0442196463 -0.1275763305 0.0081459302 [26] 0.0544519962 -0.0706518564 -0.0568996838 -0.1242553919 -0.0273082356 [31] 0.0347316657 -0.0744780003 0.0072741889 -0.0153051688 0.0767452608 [36] -0.1596986816 0.0005516519 -0.0026977352 -0.0408703791 -0.0247884749 [41] -0.1193915841 0.0817945290 0.0449081785 -0.0123651033 0.0165934582 [46] -0.0377427682 -0.0048507779 0.0501311883 > 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/3s00c1355411864.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/49y501355411864.tab") > > try(system("convert tmp/15w8q1355411864.ps tmp/15w8q1355411864.png",intern=TRUE)) character(0) > try(system("convert tmp/2eb8h1355411864.ps tmp/2eb8h1355411864.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.829 0.392 2.161