R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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.93,10.92,10.89,10.94,10.98,10.99,11.02,11.04,11.05,11.05,11.02,10.91,11.01,11.02,11.03,11.04,11.06,11.08,11.06,11.06,11.09,11.07,11.06,11.08,11.08,11.08,11.11,11.09,11.08,11.05,11.07,11.06,11.06,11.07,11.02,11.01,11.04,11.02,11.03,11.17,11.19,11.15,11.13,11.06,11.01,11.03,10.99,10.94,11,11.06,11.06,11.05,11.04,11.15,11.2,11.16,11.3,11.23,11.25,11.25,11.12,11.14,11.17,11.25,11.27,11.34,11.39,11.44,11.46,11.49,11.51,11.48,11.49,11.52,11.56,11.58,11.58,11.58,11.6,11.62,11.62,11.64,11.67,11.66,11.72,11.82,11.9,12.04,12.08,12.15,12.19,12.22,12.23,12.25,12.26,12.27,12.34,12.38,12.42,12.43,12.48,12.5,12.5,12.49,12.46,12.45,12.45,12.38,12.42,12.37,12.35,12.35,12.36,12.32,12.32,12.34,12.35,12.34,12.31,12.24) > 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/10zi21321613083.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/22rfq1321613083.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/32fsj1321613083.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.0000000000 0.1349889773 0.1272249152 0.2148980875 -0.0433859687 [6] 0.0211474644 -0.0228257672 -0.0552529317 0.0231811899 0.1424897804 [11] 0.0872707601 0.0585860886 0.0342701003 0.0944861173 0.1523951180 [16] -0.0333351079 0.0528110395 0.0850096256 -0.0737907628 -0.0306539900 [21] -0.0456467031 -0.1311938324 -0.0954212020 0.0555264687 -0.0013440824 [26] -0.0763448517 0.0379102747 -0.0815829510 -0.0869045055 -0.1052991520 [31] -0.0458631263 0.0009355771 -0.0612960403 0.1445183361 -0.0253923497 [36] -0.0111445472 0.0981010582 -0.0511563392 -0.1273325882 -0.0482832623 [41] -0.1136531542 -0.0680775357 -0.0494317545 -0.1531091021 -0.0623452604 [46] -0.1263199567 -0.0109332938 0.0485869564 -0.0414020947 > (mypacf <- c(rpacf$acf)) [1] 0.134988977 0.111026010 0.190417861 -0.108669372 -0.006060808 [6] -0.053983515 -0.017377058 0.034312073 0.175697915 0.064559446 [11] -0.006887805 -0.060448632 0.081061568 0.149396118 -0.061683273 [16] 0.019287417 0.049364431 -0.092287783 -0.084762835 -0.027707309 [21] -0.062772471 -0.100103875 0.075051237 0.046803778 -0.109426267 [26] -0.034948279 -0.096828409 -0.048451152 -0.075090009 0.067284026 [31] 0.090163797 -0.035231934 0.132224420 -0.038176765 0.032659386 [36] 0.081074411 -0.011400433 -0.096625894 -0.023349906 -0.109540683 [41] 0.021375144 -0.037562445 -0.142445853 -0.067853610 -0.134597446 [46] 0.033591646 0.026128442 0.024838808 > 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/4sf271321613083.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/50sv01321613083.tab") > > try(system("convert tmp/10zi21321613083.ps tmp/10zi21321613083.png",intern=TRUE)) character(0) > try(system("convert tmp/22rfq1321613083.ps tmp/22rfq1321613083.png",intern=TRUE)) character(0) > try(system("convert tmp/32fsj1321613083.ps tmp/32fsj1321613083.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.933 0.169 1.107