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(101.76,102.37,102.38,102.86,102.87,102.92,102.95,103.02,104.08,104.16,104.24,104.33,104.73,104.86,105.03,105.62,105.63,105.63,105.94,106.61,107.69,107.78,107.93,108.48,108.14,108.48,108.48,108.89,108.93,109.21,109.47,109.80,111.73,111.85,112.12,112.15,112.17,112.67,112.80,113.44,113.53,114.53,114.51,115.05,116.67,117.07,116.92,117.00,117.02,117.35,117.36,117.82,117.88,118.24,118.50,118.80,119.76,120.09) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/15q0t1323197364.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/2hn141323197364.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.2437279678 0.1387194996 0.0083703408 0.2910488401 [6] -0.1031808659 -0.1730605958 0.2550014296 -0.2856946277 0.2897631375 [11] -0.2503038291 0.2921781834 -0.3092744487 0.1464609932 -0.0404844120 [16] -0.1045335449 -0.0557233618 -0.2050592242 0.2680671790 -0.2128367633 [21] 0.0856391469 -0.1379710691 0.3094174128 -0.1125668120 -0.1356220253 [26] 0.0482212782 0.0260253107 -0.0327280618 -0.1413878380 0.1637406519 [31] -0.1293479230 0.0317144050 0.0094943260 -0.0255333389 -0.0987601822 [36] -0.0128533734 -0.0007058091 -0.0891601553 -0.0399619964 -0.0083454987 [41] 0.0652732173 -0.0482132411 0.0006342053 0.0605181389 0.0067492692 > (mypacf <- c(rpacf$acf)) [1] -0.243727968 0.084325385 0.064119347 0.317081076 0.032315614 [6] -0.306899262 0.140552599 -0.284631409 0.309141712 -0.024819604 [11] 0.136937549 -0.210218702 -0.108258119 -0.035796216 -0.037297152 [16] -0.105713922 -0.074201074 0.059246780 0.214966537 -0.140106153 [21] 0.056534976 0.059177450 0.020792691 -0.200883195 -0.105041814 [26] 0.102398988 -0.037338869 0.099538504 -0.040360194 -0.079137660 [31] -0.090500932 -0.060934067 -0.092030470 0.069359208 -0.005406518 [36] -0.089660898 -0.007433570 0.043664720 -0.046694514 0.042832358 [41] -0.145712486 0.086016742 0.068961285 -0.088976177 > 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/3vz5h1323197364.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/48qcc1323197364.tab") > > try(system("convert tmp/15q0t1323197364.ps tmp/15q0t1323197364.png",intern=TRUE)) character(0) > try(system("convert tmp/2hn141323197364.ps tmp/2hn141323197364.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.801 0.128 0.925