R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(101.16,101.16,101.16,101.16,101.16,101.16,101.16,101.16,101.16,101.21,101.21,101.21,103.16,103.16,103.16,103.16,101.13,101.13,100.53,100.53,100.53,100.53,100.53,100.53,100.53,100.53,100.53,99.42,99.42,99.42,99.42,100.31,100.31,102.25,102.25,102.25,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.81,101.94,101.94,101.94,101.94,101.94,102,102,102,102,102,102,102,102,102,102,102,102,109.67,109.67,109.67,109.67,109.67,109.67,109.67,109.67,109.67,109.67,109.67,109.67) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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 (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/1g5es1389553735.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/2ehme1389553735.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/3tlo71389553735.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.915580744 0.831161488 0.742751370 0.655366007 [6] 0.574684574 0.494523312 0.418866303 0.343346859 0.267827416 [11] 0.190885285 0.113943153 0.033947091 0.030210422 0.027197492 [16] 0.024184561 0.028131445 0.027968426 0.031791525 0.034117290 [21] 0.034168431 0.033009003 0.026722419 0.020033713 0.013345006 [26] 0.008137214 0.002929422 -0.002278370 -0.009861391 -0.017248840 [31] -0.023472473 -0.029696106 -0.034117861 -0.038539616 -0.038943416 [36] -0.039347216 -0.039751017 -0.036471716 -0.033086700 -0.029701685 [41] -0.046125820 -0.062549955 -0.088225878 -0.113853009 -0.139823713 [46] -0.165629340 -0.179896219 -0.194171909 -0.208447598 > (mypacf <- c(rpacf$acf)) [1] 0.915580744 -0.044069798 -0.070828337 -0.044407196 -0.010409612 [6] -0.048289105 -0.027503909 -0.052591872 -0.056328397 -0.068536367 [11] -0.062856084 -0.088002063 0.411433189 -0.028378772 -0.058038979 [16] 0.023060126 -0.016061090 -0.002114521 -0.004442823 -0.043034078 [21] -0.029919871 -0.070453248 -0.043404346 -0.052708151 0.240079393 [26] -0.027640970 -0.056272517 0.014204414 -0.018425709 0.014881494 [31] 0.004857162 -0.027493168 -0.017616660 -0.031332354 -0.037236748 [36] -0.037586342 0.181039039 -0.019842120 -0.054811691 -0.157470777 [41] -0.018757999 -0.049606346 -0.001330575 -0.043379741 -0.030952356 [46] 0.048638786 -0.049478773 -0.066818148 > 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/4cr0n1389553735.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/5il571389553735.tab") > > try(system("convert tmp/1g5es1389553735.ps tmp/1g5es1389553735.png",intern=TRUE)) character(0) > try(system("convert tmp/2ehme1389553735.ps tmp/2ehme1389553735.png",intern=TRUE)) character(0) > try(system("convert tmp/3tlo71389553735.ps tmp/3tlo71389553735.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.012 0.682 3.670