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(2.2,2.28,2.28,2.28,2.28,2.27,2.28,2.27,2.28,2.28,2.28,2.28,2.27,2.28,2.28,2.28,2.27,2.28,2.27,2.27,2.27,2.27,2.27,2.27,2.27,2.35,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.54,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.66,2.93,2.93,2.93,2.93,2.93,2.93,2.93,2.93,2.93,2.93,2.93) > 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 (par8 != '') par8 <- as.numeric(par8) > ox <- x > if (par8 == '') { + if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } + } else { + x <- log(x,base=par8) + } > 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/1yn7f1321374650.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > plot(ox,type='l',main='Original Time Series',xlab='time',ylab='value') > if (par8=='') { + mytitle <- paste('Working Time Series (lambda=',par2,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } else { + mytitle <- paste('Working Time Series (base=',par8,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(base=',par8,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } > plot(x,type='l', main=mytitle,xlab='time',ylab='value') > par(op) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2k0cx1321374650.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=mysub) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3twxj1321374650.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',sub=mysub) > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.00000000 0.06738453 -0.04263543 -0.04705353 -0.05147163 -0.04125815 [7] -0.05418599 -0.04703343 -0.05843080 -0.03912675 -0.06650177 -0.03591287 [13] -0.02263846 -0.02408783 -0.04840193 -0.04057634 -0.02959763 -0.03563839 [19] -0.02848583 -0.04591285 -0.02966972 -0.05321859 -0.03927115 0.13460954 [25] 0.32991669 0.08065238 -0.02346701 -0.02405895 -0.02465090 -0.02524284 [31] -0.02583479 -0.03560951 -0.01783591 -0.03679340 -0.02820257 -0.02071811 [37] -0.01212728 -0.03108477 -0.02249394 -0.02308589 -0.02367784 -0.01508701 [43] -0.03404450 -0.01627090 -0.03522839 -0.02663757 -0.02722951 0.36474197 [49] 0.21033863 > (mypacf <- c(rpacf$acf)) [1] 0.06738453 -0.04739130 -0.04112968 -0.04777167 -0.03883117 -0.05584494 [7] -0.04861656 -0.06472783 -0.04643525 -0.08154047 -0.04966707 -0.04650948 [13] -0.05133132 -0.07930989 -0.07112551 -0.06874060 -0.08114411 -0.08012851 [19] -0.10543472 -0.09751045 -0.13694100 -0.13678505 0.03437777 0.24709405 [25] 0.01216880 -0.04552210 -0.03677938 -0.03604388 -0.04170042 -0.03340795 [31] -0.04514397 -0.02279852 -0.05051799 -0.02879419 -0.04055503 -0.04553304 [37] -0.06752781 -0.04536043 -0.05523481 -0.06577087 -0.06084702 -0.08398618 [43] -0.06395629 -0.09454633 -0.07763258 -0.11670280 0.26362310 0.06364223 > 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/4jm3o1321374650.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/5a8vc1321374650.tab") > > try(system("convert tmp/1yn7f1321374650.ps tmp/1yn7f1321374650.png",intern=TRUE)) character(0) > try(system("convert tmp/2k0cx1321374650.ps tmp/2k0cx1321374650.png",intern=TRUE)) character(0) > try(system("convert tmp/3twxj1321374650.ps tmp/3twxj1321374650.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.929 0.162 1.105