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(68897,38683,44720,39525,45315,50380,40600,36279,42438,38064,31879,11379,70249,39253,47060,41697,38708,49267,39018,32228,40870,39383,34571,12066,70938,34077,45409,40809,37013,44953,37848,32745,39401,34931,33008,8620,68906,39556,50669,36432,40891,48428,36222,33425,39401,37967,34801,12657,69116,41519,51321,38529,41547,52073,38401,40898,40439,41888,37898,8771,68184,50530,47221,41756,45633,48138,39486,39341,41117,41629,29722,7054,56676,34870,35117,30169,30936,35699,33228,27733,33666,35429,27438,8170) > 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/1e94e1322833232.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/2fcii1322833232.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.0000000000 -0.1938670870 0.0638052591 -0.0104016716 0.1281458439 [6] 0.0816871464 -0.1961581947 0.0501892590 0.1020509582 -0.0512078404 [11] -0.0006091959 -0.3215797509 0.7980916029 -0.2158739816 0.0039793161 [16] -0.0907570551 0.0372781508 0.0050663868 -0.2426446548 -0.0204790783 [21] 0.0194145135 -0.0998199854 -0.0416812666 -0.3220731919 0.6418995257 [26] -0.1753802781 -0.0083308900 -0.0914347750 0.0401440500 -0.0086675943 [31] -0.1999286039 -0.0039621489 0.0182885801 -0.0667224187 -0.0208988907 [36] -0.2739840507 0.5092583952 -0.0890447664 0.0118686078 -0.0561877788 [41] 0.0680861230 0.0191361983 -0.1303919303 0.0133259664 0.0224239292 [46] -0.0230829616 -0.0081526356 -0.2045705923 0.3949593123 > (mypacf <- c(rpacf$acf)) [1] -0.1938670870 0.0272447921 0.0071882263 0.1307655771 0.1370863860 [6] -0.1778567303 -0.0369781209 0.1154306997 -0.0376590299 0.0135484117 [11] -0.3220070897 0.7817067262 -0.2331100573 -0.1634372160 -0.1785549728 [16] -0.1711701048 -0.1704148719 0.0173931186 -0.0062383656 -0.1294672784 [21] -0.0136240772 -0.0000984462 0.3003102142 -0.0950261329 0.0854482778 [26] -0.1690165407 -0.0301435633 -0.0049245858 -0.0309853099 0.0511181991 [31] -0.0643789951 0.0075013556 0.0070800286 0.1486568947 -0.1293412877 [36] -0.1437059496 0.0245245958 -0.0111594811 0.1060614021 -0.0090969952 [41] 0.1532928715 -0.0674954615 -0.0002115421 0.0022947694 0.0566578032 [46] -0.1296842460 -0.0304019031 0.0504622819 > 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/3nipd1322833232.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/48c931322833232.tab") > > try(system("convert tmp/1e94e1322833232.ps tmp/1e94e1322833232.png",intern=TRUE)) character(0) > try(system("convert tmp/2fcii1322833232.ps tmp/2fcii1322833232.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.746 0.168 0.928