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(13.15,13.47,13.65,13.52,14.13,14.84,15.29,15.51,15.43,15.42,15.56,15.43,15.36,15.18,15.41,15.15,15.21,15.09,15.09,15.5,15.41,15.42,15.47,15.23,15.59,15.22,15.45,15.02,15.5,15.59,15.98,15.76,15.43,15.45,15.32,15.4,15.42,15.54,15.6,15.67,15.61,16.01,16.06,16.15,15.87,15.89,15.73,15.78,16.07,16.2,16.42,16.61,16.89,17.62,17.83,17.94,18.07,17.85,17.86,17.85) > 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/16b3r1334684520.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/2ycji1334684520.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/3o9n71334684520.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.056757775 0.286992652 -0.120543428 0.019846968 [6] 0.048295566 -0.094928406 -0.092951557 -0.123433156 -0.048784782 [11] -0.009824484 -0.031403870 0.137927175 0.007240892 0.060660627 [16] 0.028497730 -0.186397513 0.015894654 -0.095701558 0.026176960 [21] -0.057874975 -0.142303569 -0.029462546 0.099117071 0.142148342 [26] 0.034793132 -0.126775005 -0.119724613 -0.152989688 0.015089070 [31] -0.112647413 -0.009323859 0.023232312 -0.055601995 0.076538044 [36] -0.014061176 0.008359954 0.014098758 -0.143561486 -0.088092598 [41] -0.124910682 -0.073144911 -0.037518021 0.014243580 0.049212128 [46] 0.001277281 0.106304371 0.128663419 0.165422602 > (mypacf <- c(rpacf$acf)) [1] 0.0567577746 0.2846883151 -0.1619593049 -0.0494404355 0.1479418076 [6] -0.1389570450 -0.1565091365 -0.0013838220 0.0002789567 -0.0190126860 [11] -0.0208092653 0.1788890852 -0.0103556035 -0.0866120484 0.0823505387 [16] -0.2377996013 -0.0369946655 0.1062111044 -0.0338626974 -0.0573941005 [21] -0.0880896534 0.0086570011 0.1760602669 0.0256215295 -0.0854060405 [26] -0.1752908607 -0.1455492467 -0.0587715254 0.0438264824 -0.0314447416 [31] 0.0355428246 0.0770844810 -0.0965758523 -0.0141915663 -0.0045616525 [36] -0.1547538629 -0.0945549268 -0.1582573412 -0.0475853723 0.0725072659 [41] -0.0700365508 -0.0610109027 0.0196753142 -0.0041105279 0.0031609137 [46] -0.0418652426 0.0221551735 0.0512030357 > 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/4f0wa1334684520.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/5gxzg1334684520.tab") > > try(system("convert tmp/16b3r1334684520.ps tmp/16b3r1334684520.png",intern=TRUE)) character(0) > try(system("convert tmp/2ycji1334684520.ps tmp/2ycji1334684520.png",intern=TRUE)) character(0) > try(system("convert tmp/3o9n71334684520.ps tmp/3o9n71334684520.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.057 0.236 1.283