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(10,9.99,9.95,9.96,9.97,9.95,9.94,9.9,9.9,9.92,9.87,9.96,9.94,9.96,9.96,9.89,9.82,9.83,9.83,9.82,9.77,9.66,9.69,9.67,9.7,9.77,9.79,9.81,9.77,9.78,9.77,9.79,9.77,9.77,9.8,9.8,9.8,9.8,9.76,9.78,9.77,9.79,9.81,9.82,9.84,9.87,9.99,9.99,9.99,10.08,10.06,10.08,10.07,10.04,10.04,10.12,10.1,10.11,10.13,10.16,10.15,10.25,10.41,10.46,10.46,10.5,10.5,10.48,10.5,10.5,10.53,10.53) > 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/17ewo1354476687.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/2cbqe1354476687.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/37tlb1354476687.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.153898267 0.094201483 0.149843794 -0.045423880 [6] 0.033420235 0.071231323 0.071582327 0.018026540 -0.023459396 [11] -0.067334738 0.010850615 0.049063659 0.166529064 0.111778574 [16] 0.120470169 0.218552354 0.065679893 0.005782130 0.071149548 [21] 0.067949939 0.026508665 0.048855604 -0.054464592 -0.005566213 [26] -0.147731008 -0.067748017 -0.069194650 -0.037524560 -0.070870883 [31] -0.063586135 -0.034707407 0.005091131 -0.014778495 -0.141858767 [36] 0.064606437 0.036418552 0.096225575 0.079337125 -0.139511979 [41] -0.083065756 -0.197674221 -0.195145954 -0.064393664 -0.049371259 [46] -0.101553696 -0.079441231 -0.158186272 -0.014158262 > (mypacf <- c(rpacf$acf)) [1] 0.1538982673 0.0722274913 0.1289898374 -0.0945940388 0.0342611366 [6] 0.0548975131 0.0738141757 -0.0264903802 -0.0483710450 -0.0729882105 [11] 0.0485316086 0.0591110269 0.1670803909 0.0397386369 0.0798924735 [16] 0.1707321179 0.0236144688 -0.0657508590 -0.0002443184 0.0475414855 [21] 0.0045187320 0.0091951455 -0.0842000582 0.0241874277 -0.1531935674 [26] -0.0206248988 -0.1153017880 -0.0286798027 -0.1572830824 -0.0485192312 [31] -0.0540075265 0.0202931883 -0.0640708255 -0.1638689480 0.0554093356 [36] 0.0578287149 0.1601131400 0.0680665589 -0.1372464120 -0.0271083199 [41] -0.0850921104 -0.0578010733 -0.0020322641 0.0065599694 0.0124665363 [46] 0.0277603578 -0.0370400839 0.0531894879 > 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/4e99k1354476687.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/5zqbk1354476687.tab") > > try(system("convert tmp/17ewo1354476687.ps tmp/17ewo1354476687.png",intern=TRUE)) character(0) > try(system("convert tmp/2cbqe1354476687.ps tmp/2cbqe1354476687.png",intern=TRUE)) character(0) > try(system("convert tmp/37tlb1354476687.ps tmp/37tlb1354476687.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.626 0.341 1.952