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(1770,2203,2836,1976,2837,2150,2180,2631,1781,2327,2260,2051,2250,2102,2957,2485,2871,2447,2570,2622,1840,2682,2369,2119,2531,2214,3206,2709,2734,2348,2702,2642,2064,2647,2534,2297,2718,2321,3112,2664,2808,2668,2934,2616,2228,2463,2416,2407,2582,2101,3305,2818,2401,3019,2507,2948,2210,2467,2596,2451) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/13oyu1324500598.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/2xolj1324500598.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.215961716 0.102586682 0.265975464 -0.100645593 [6] 0.091186741 0.226344565 -0.025403464 -0.027056676 0.270334307 [11] -0.016709915 0.004398008 -0.015385491 -0.166171404 0.042571312 [16] 0.077436556 -0.012706213 0.013255184 0.003874056 0.005903832 [21] 0.045442884 0.022666386 -0.183115716 0.080395051 -0.002976162 [26] -0.062426005 0.078524147 -0.088355603 -0.201985111 0.106077354 [31] -0.100272843 -0.194215965 0.058007233 -0.112195115 -0.153749902 [36] 0.030562210 -0.059281312 -0.188750532 0.084257391 -0.083014947 [41] -0.072861162 0.089501045 -0.158441884 0.079349414 -0.022542929 [46] -0.027490252 0.022774964 -0.009708872 > (mypacf <- c(rpacf$acf)) [1] -0.215961716 0.058684220 0.315241362 0.016163090 0.008194014 [6] 0.203795833 0.099315778 -0.120220627 0.153211002 0.132611899 [11] -0.036827387 -0.258030790 -0.270818355 -0.001086106 0.131227800 [16] 0.080973389 0.035840038 0.025166908 0.073355556 0.059375623 [21] 0.069902729 -0.152611929 -0.044793973 -0.048016084 -0.168237840 [26] -0.127753106 -0.015135628 -0.153024139 -0.012725255 -0.001148832 [31] -0.042843794 0.049631877 0.101825317 -0.058570303 -0.166289094 [36] 0.022073311 0.051616093 0.046670877 -0.077468548 -0.049051063 [41] 0.099712937 -0.084959157 0.085197751 0.032328557 0.036404747 [46] -0.018940044 -0.065447389 > 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/37ocs1324500598.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/40l5b1324500598.tab") > > try(system("convert tmp/13oyu1324500598.ps tmp/13oyu1324500598.png",intern=TRUE)) character(0) > try(system("convert tmp/2xolj1324500598.ps tmp/2xolj1324500598.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.867 0.199 1.071