R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(3.43,3.43,3.43,3.43,3.43,3.43,3.43,3.43,3.5,3.52,3.53,3.53,3.53,3.53,3.53,3.53,3.53,3.53,3.53,3.53,3.58,3.58,3.59,3.59,3.59,3.59,3.59,3.59,3.59,3.59,3.59,3.61,3.71,3.83,3.83,3.83,3.83,3.83,3.83,3.83,3.83,3.83,3.83,3.83,3.92,3.92,3.92,3.92,3.92,3.92,3.92,3.92,3.92,3.92,3.92,3.92,3.98,3.98,3.98,3.98,3.98,3.98,3.98,3.98,3.98,3.98,3.98,3.98,4.09,4.09,4.09,4.09) > 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/fisher/rcomp/tmp/17djb1353076608.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/fisher/rcomp/tmp/2v1ze1353076608.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/fisher/rcomp/tmp/3gm4u1353076608.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.185840019 -0.053661854 -0.126711034 -0.108160995 [6] -0.109873306 -0.111585618 -0.113297929 -0.102116017 -0.096181106 [11] -0.070290849 0.175694300 0.483108419 0.053374896 -0.092992732 [16] -0.108576101 -0.099236221 -0.100948532 -0.102660844 -0.104373155 [21] -0.096875307 -0.094624459 -0.052881565 0.133656193 0.488628225 [26] 0.086636818 -0.105307143 -0.107019454 -0.092153479 -0.093865790 [31] -0.095578102 -0.093606349 -0.076898342 -0.056506272 -0.028494888 [36] 0.237306058 0.340617470 -0.019760764 -0.065067828 -0.044675758 [41] -0.027967751 -0.025995998 -0.027708310 -0.029420621 -0.014554646 [46] -0.016266957 0.015707586 0.004087377 0.170809338 > (mypacf <- c(rpacf$acf)) [1] 0.18584002 -0.09135339 -0.10324810 -0.07205218 -0.09628613 -0.10525683 [7] -0.11746337 -0.12085417 -0.13757063 -0.13237473 0.11819810 0.39556369 [13] -0.14114943 -0.07629134 -0.02681000 -0.06322785 -0.06671324 -0.06312328 [19] -0.07266321 -0.08885106 -0.09450725 -0.08108882 -0.07736613 0.28558240 [25] -0.03838619 -0.12503429 -0.03421558 -0.05010940 -0.07369252 -0.06575665 [31] -0.06029804 -0.06330969 -0.05460070 -0.04986534 0.07121048 -0.09890946 [37] -0.14238679 0.03263943 -0.01572858 -0.01666493 0.02159106 0.02575404 [43] 0.02325149 0.03940670 0.04607522 0.01652139 -0.30262819 -0.07754777 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/472c01353076608.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/fisher/rcomp/tmp/5z49z1353076609.tab") > > try(system("convert tmp/17djb1353076608.ps tmp/17djb1353076608.png",intern=TRUE)) character(0) > try(system("convert tmp/2v1ze1353076608.ps tmp/2v1ze1353076608.png",intern=TRUE)) character(0) > try(system("convert tmp/3gm4u1353076608.ps tmp/3gm4u1353076608.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.760 0.408 2.152