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(31,36,24,22,17,8,12,5,6,5,8,15,16,17,23,24,27,31,40,47,43,60,64,65,65,55,57,57,57,65,69,70,71,71,73,68,65,57,41,21,21,17,9,11,6,-2,0,5,3,7,4,8,9,14,12,12,7,15,14,19) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > 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/1ysgr1324547511.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/2gy6s1324547511.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/3ppsk1324547511.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.000000000 0.225635976 0.307995778 0.289686206 0.049618211 [6] 0.129842032 0.063969283 0.011326077 0.000477396 -0.197720864 [11] -0.003380015 0.001377501 -0.079755476 0.005770692 -0.170691708 [16] -0.095973302 -0.214290394 -0.148288895 -0.149728732 -0.181523563 [21] -0.135031690 -0.199565691 -0.127058476 -0.068314798 -0.228697174 [26] -0.084476662 -0.103049471 -0.194035035 -0.052589794 -0.031677043 [31] 0.069643349 0.043963139 0.064266684 0.078448087 0.099812101 [36] 0.117566007 0.166186339 0.113106911 0.041397821 0.049637587 [41] 0.086810867 0.041703762 0.009645694 0.070766026 -0.064857023 [46] -0.007888316 0.014889657 -0.008744824 0.004195604 > (mypacf <- c(rpacf$acf)) [1] 0.225635976 0.270874855 0.202281471 -0.119729693 0.008172231 [6] 0.008339750 -0.012813568 -0.051190492 -0.232064772 0.083969874 [11] 0.143351542 -0.020168652 -0.067655203 -0.190335875 0.001088867 [16] -0.145245521 -0.025399881 -0.102908624 -0.004272256 0.029477099 [21] -0.124425342 -0.026576100 -0.020234725 -0.185871182 -0.086164888 [26] -0.011301980 -0.085150329 -0.049596177 0.072863474 0.102370375 [31] -0.002336916 -0.056119498 -0.139133881 0.045559383 0.059480465 [36] 0.011530331 -0.036942386 -0.089030611 0.013788307 0.022957945 [41] -0.084954618 -0.206581528 -0.002686999 -0.023029838 -0.033110464 [46] 0.010540175 -0.043949002 -0.051178425 > 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/4laf01324547511.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/5eimz1324547511.tab") > > try(system("convert tmp/1ysgr1324547511.ps tmp/1ysgr1324547511.png",intern=TRUE)) character(0) > try(system("convert tmp/2gy6s1324547511.ps tmp/2gy6s1324547511.png",intern=TRUE)) character(0) > try(system("convert tmp/3ppsk1324547511.ps tmp/3ppsk1324547511.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.086 0.236 1.391