R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(27.88,28.06,28.08,28.12,28.11,28.18,28.2,28.37,28.64,28.75,28.97,29.08,29.16,29.24,29.36,29.35,29.43,29.49,29.61,29.66,29.75,29.74,29.97,30.02,30.09,30.16,30.33,30.41,30.44,30.45,30.46,30.51,30.54,30.82,30.88,30.89,31.13,31.41,31.47,31.56,31.62,31.65,31.79,31.98,32.14,32.32,32.5,32.55,32.66,32.68,32.72,32.8,32.93,32.96,32.98,33.09,33.46,33.65,33.82,33.83,33.92,33.87,34.03,34.11,34.29,34.44,34.64,34.77,35.01,35.19,35.32,35.35) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > 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/1r10p1413823628.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/2ldlk1413823628.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/3mdhr1413823628.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.95561423 0.91088678 0.86552360 0.82069607 0.77646252 [7] 0.73280300 0.68960941 0.64812710 0.60969965 0.57137788 0.53514028 [13] 0.49729516 0.45924125 0.42021881 0.38268596 0.34567222 0.31259519 [19] 0.27996515 0.24731821 0.21367625 0.18079779 0.14716689 0.11490688 [25] 0.08157715 0.04876162 0.01560519 -0.01520682 -0.04429433 -0.07241775 [31] -0.09965984 -0.12654597 -0.15390703 -0.18174229 -0.20680948 -0.23182857 [37] -0.25459911 -0.27322502 -0.28976394 -0.30602270 -0.31869083 -0.33125449 [43] -0.34364212 -0.35542604 -0.36596405 -0.37543847 -0.38288607 -0.38732267 [49] -0.39120264 > (mypacf <- c(rpacf$acf)) [1] 0.9556142278 -0.0266329237 -0.0307212818 -0.0180844570 -0.0177577977 [6] -0.0184095697 -0.0199317810 -0.0058597283 0.0099650809 -0.0232728188 [11] -0.0007287665 -0.0420965793 -0.0274657425 -0.0364054433 -0.0094260114 [16] -0.0199940742 0.0187718013 -0.0203698830 -0.0260645819 -0.0393400467 [21] -0.0186803224 -0.0377542536 -0.0121080934 -0.0406661858 -0.0211176869 [26] -0.0356965860 -0.0041885406 -0.0147793554 -0.0212314491 -0.0238507147 [31] -0.0254231313 -0.0393804597 -0.0362337240 -0.0040441531 -0.0311109529 [36] -0.0106842921 0.0169566069 -0.0093218511 -0.0278763166 0.0074871276 [41] -0.0273248037 -0.0278903474 -0.0200074815 -0.0105877301 -0.0140966394 [46] -0.0051850353 0.0080278370 -0.0206087814 > 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/4ldis1413823628.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/5fgsb1413823628.tab") > > try(system("convert tmp/1r10p1413823628.ps tmp/1r10p1413823628.png",intern=TRUE)) character(0) > try(system("convert tmp/2ldlk1413823628.ps tmp/2ldlk1413823628.png",intern=TRUE)) character(0) > try(system("convert tmp/3mdhr1413823628.ps tmp/3mdhr1413823628.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.182 0.219 1.407