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(21.94,21.95,21.96,22.1,22.13,22.18,22.18,22.27,22.3,22.04,22.05,22.06,22.06,22.06,21.97,22.03,22.08,22.13,22.13,22.4,22.4,22.12,22.22,22.14,22.14,22.19,22.29,22.24,22.26,22.29,22.29,22.29,22.29,22.35,22.39,22.43,22.43,22.11,22.12,22.05,22.05,22.08,22.08,22.09,22.09,22.24,22.25,22.24,22.24,22.25,22.28,22.23,22.29,22.31,22.31,22.31,22.39,22.42,22.42,22.42,22.15,21.95,21.96,21.97,21.66,21.66,21.68,21.75,21.55,21.59,21.54,21.54) > 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/1y5ip1420400467.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/2lk9y1420400467.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/3y7qh1420400467.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.016543370 -0.079814396 0.079896401 0.115015993 [6] -0.112963717 -0.101472875 0.075577976 -0.120906655 0.032354705 [11] -0.022375282 -0.041764342 0.075304766 -0.033652083 0.074238980 [16] -0.090522361 0.100159622 -0.018634106 -0.140553330 -0.063012321 [21] -0.106647294 0.023437769 0.003903845 0.150382382 0.027758682 [26] -0.010786197 0.028873798 0.104964179 0.121245464 -0.042696303 [31] -0.004135689 0.046585586 -0.092241083 0.035022103 -0.079967450 [36] -0.107941206 -0.107140553 0.097785754 -0.020444392 0.052996759 [41] 0.088739466 -0.040462660 -0.107573581 0.079173254 -0.049526808 [46] -0.122644635 -0.040434235 0.079246398 -0.034359998 > (mypacf <- c(rpacf$acf)) [1] -0.016543370 -0.080110004 0.077664475 0.112373207 -0.099374387 [6] -0.097355826 0.042705732 -0.132983003 0.079313307 -0.037015295 [11] -0.054442085 0.102140931 -0.069405966 0.089232022 -0.085060168 [16] 0.063884064 -0.003099284 -0.152944242 -0.062153282 -0.134223834 [21] 0.009866426 0.094526795 0.129333387 0.059782928 -0.031785256 [26] -0.069518290 0.130995074 0.101711822 0.042040079 -0.023713801 [31] 0.008502898 -0.090537283 0.083359836 -0.054430002 -0.136718779 [36] -0.103199143 0.020615923 -0.012022415 0.116638858 0.038222587 [41] -0.010762842 -0.101437525 0.082952104 -0.094115729 -0.085135975 [46] -0.016170322 0.066754397 0.092937374 > 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/4id2c1420400467.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/5wkfa1420400467.tab") > > try(system("convert tmp/1y5ip1420400467.ps tmp/1y5ip1420400467.png",intern=TRUE)) character(0) > try(system("convert tmp/2lk9y1420400467.ps tmp/2lk9y1420400467.png",intern=TRUE)) character(0) > try(system("convert tmp/3y7qh1420400467.ps tmp/3y7qh1420400467.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.422 0.205 1.636