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 = '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/14l861321612630.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/2rvso1321612630.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/3ww181321612630.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.984682723 0.966523811 0.946033229 0.924347220 [6] 0.903350458 0.882361610 0.861583011 0.840247647 0.818705819 [11] 0.795839867 0.771098876 0.742730310 0.716092602 0.687136989 [16] 0.656901642 0.626355911 0.594708005 0.562155441 0.529252577 [21] 0.496450881 0.464947844 0.433675014 0.403174017 0.372986157 [26] 0.343770399 0.314796548 0.285831645 0.257027783 0.228374640 [31] 0.200066292 0.172742779 0.146245122 0.120533405 0.096515728 [36] 0.073107463 0.051283812 0.030216163 0.008630633 -0.011700282 [41] -0.029351293 -0.046228063 -0.063186730 -0.080028401 -0.097323949 [46] -0.115345218 -0.132157984 -0.149053336 -0.166777297 > (mypacf <- c(rpacf$acf)) [1] 0.984682723 -0.101192796 -0.078116100 -0.037635133 0.022530633 [6] -0.010863373 -0.007094392 -0.032765931 -0.015218431 -0.052957549 [11] -0.066368059 -0.122204484 0.070776548 -0.090672878 -0.054585480 [16] -0.026728111 -0.041927637 -0.049821081 -0.022488176 -0.015639262 [21] 0.034263715 -0.019110404 0.005056867 -0.026675162 0.039090544 [26] -0.022893870 -0.018888478 -0.006682006 -0.009237896 -0.016840314 [31] 0.008919896 -0.011456705 0.004488140 0.014634421 -0.013920759 [36] 0.011420217 -0.001354438 -0.056476200 0.014714609 0.068045603 [41] -0.015727753 -0.051345849 -0.021443671 -0.041335233 -0.051019708 [46] 0.020259047 -0.046179437 -0.059001854 > 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/4r6ov1321612630.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/5hb4b1321612630.tab") > > try(system("convert tmp/14l861321612630.ps tmp/14l861321612630.png",intern=TRUE)) character(0) > try(system("convert tmp/2rvso1321612630.ps tmp/2rvso1321612630.png",intern=TRUE)) character(0) > try(system("convert tmp/3ww181321612630.ps tmp/3ww181321612630.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.070 0.199 1.351