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(9700,9081,9084,9743,8587,9731,9563,9998,9437,10038,9918,9252,9737,9035,9133,9487,8700,9627,8947,9283,8829,9947,9628,9318,9605,8640,9214,9567,8547,9185,9470,9123,9278,10170,9434,9655,9429,8739,9552,9687,9019,9672,9206,9069,9788,10312,10105,9863,9656,9295,9946,9701,9049,10190,9706,9765,9893,9994,10433,10073,10112,9266,9820,10097,9115,10411,9678,10408,10153,10368,10581,10597,10680,9738,9556) > par8 = '' > 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/wessaorg/rcomp/tmp/1zd0f1356013564.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/2rfvk1356013564.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.000000e+00 -5.653526e-01 8.634946e-02 1.638758e-01 -2.428345e-01 [6] 1.030455e-01 -3.283783e-02 5.890022e-02 -2.518802e-01 2.751779e-01 [11] -9.609184e-02 -2.952280e-01 6.258459e-01 -4.353429e-01 1.736774e-01 [16] 8.655233e-02 -2.067552e-01 6.395507e-02 7.027751e-02 -9.146147e-02 [21] -7.793041e-02 1.593983e-01 -1.304520e-01 -8.984433e-02 3.712158e-01 [26] -2.833507e-01 8.860635e-02 1.358407e-01 -1.995341e-01 6.244177e-02 [31] 1.840380e-02 -1.151239e-01 5.907308e-02 3.743195e-02 -4.469195e-02 [36] -1.134077e-01 2.817434e-01 -2.200743e-01 9.998386e-02 9.964288e-02 [41] -2.134057e-01 1.796738e-01 -1.169676e-01 -5.893792e-05 6.005417e-04 [46] -2.143326e-02 7.347286e-02 -1.672424e-01 2.693277e-01 > (mypacf <- c(rpacf$acf)) [1] -0.5653526429 -0.3428604399 0.0592848124 -0.1044927188 -0.1326369775 [6] -0.1442527267 0.0595105747 -0.3428139462 -0.1139582300 -0.0047303717 [11] -0.4924977640 0.1888875387 0.1394427647 0.1058144645 0.0956274850 [16] 0.0148491437 -0.1081107235 0.0818407654 -0.1044991305 0.0687499877 [21] -0.0847621130 -0.0684882020 -0.0062321731 0.0711253499 0.1421313197 [26] -0.0334794679 0.0002380391 0.1000195931 0.0272052388 -0.1756254272 [31] -0.1169265149 -0.0048267396 -0.0011531859 0.1040566702 -0.0490604866 [36] -0.0464610221 -0.1101464197 -0.0249834412 -0.0082692653 -0.1005594557 [41] 0.0260488719 -0.0730032812 0.0589916738 0.0372685790 -0.1795136109 [46] -0.0217992216 -0.0406935949 -0.0017197078 > 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/3qawa1356013564.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/4mt881356013564.tab") > > try(system("convert tmp/1zd0f1356013564.ps tmp/1zd0f1356013564.png",intern=TRUE)) character(0) > try(system("convert tmp/2rfvk1356013564.ps tmp/2rfvk1356013564.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.543 0.310 1.799