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 = '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/1q81o1353076251.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/2qq8s1353076251.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/3jefu1353076251.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.95763495 0.91045812 0.86217088 0.81388363 0.77720772 [7] 0.74053181 0.70385590 0.66717998 0.63736531 0.60944930 0.58205080 [13] 0.55033404 0.50948723 0.46617285 0.42264255 0.37911225 0.34191540 [19] 0.30471856 0.26752171 0.23032487 0.19802891 0.16567126 0.13358436 [25] 0.09785778 0.05293947 0.00506006 -0.04281935 -0.09069875 -0.12907798 [31] -0.16745721 -0.20583643 -0.24225531 -0.26887241 -0.28372738 -0.29904503 [37] -0.31898939 -0.34519523 -0.37207965 -0.39896407 -0.41318159 -0.41684336 [43] -0.41839397 -0.41994459 -0.42149520 -0.41422422 -0.40695324 -0.40020662 [49] -0.39383014 > (mypacf <- c(rpacf$acf)) [1] 0.957634948 -0.079659393 -0.035007900 -0.024668113 0.114586932 [6] -0.036689121 -0.024300208 -0.022854486 0.081790668 -0.008708505 [11] -0.017423864 -0.075460011 -0.102270245 -0.041353734 -0.023644079 [16] -0.043008783 0.031469016 -0.036692753 -0.026930233 -0.041177924 [21] 0.033827655 -0.046224173 -0.025727854 -0.074177383 -0.106015314 [26] -0.067588713 -0.034869020 -0.064924585 0.048557224 -0.064690732 [31] -0.042823553 -0.042501069 0.088184684 0.083693938 -0.051289720 [36] -0.092466407 -0.040211606 -0.002177124 -0.040208329 0.096177741 [41] 0.080245186 0.010475672 -0.034163524 -0.018441180 0.094421016 [46] -0.044728459 -0.033146017 0.003475960 > 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/43fqn1353076251.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/5wnvn1353076251.tab") > > try(system("convert tmp/1q81o1353076251.ps tmp/1q81o1353076251.png",intern=TRUE)) character(0) > try(system("convert tmp/2qq8s1353076251.ps tmp/2qq8s1353076251.png",intern=TRUE)) character(0) > try(system("convert tmp/3jefu1353076251.ps tmp/3jefu1353076251.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.930 0.338 2.254