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(589.85,589.85,589.85,589.85,589.85,589.85,589.85,589.85,589.85,599.12,599.12,599.12,599,599,599,599,599,599,599,599,599,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,665.27,665.27,665.27) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > 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/126jz1321612212.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/2j52c1321612212.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/3ymx01321612212.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.05944328 -0.06026888 -0.06419340 -0.06420510 -0.06503070 [7] -0.06585630 -0.06668190 -0.06750750 -0.06271398 -0.06195391 -0.06277951 [13] 0.50839715 -0.06452398 -0.06534958 -0.04508929 -0.04591489 -0.04674049 [19] -0.04756609 -0.04839170 -0.04921730 -0.03698270 -0.03683197 -0.03765757 [25] 0.40038283 -0.03930877 -0.04013437 -0.03093388 -0.03175948 -0.03258508 [31] -0.03341068 -0.03423628 -0.03506188 -0.02837746 -0.02807044 -0.02889604 [37] 0.39234674 -0.03054724 -0.03137284 -0.02355579 -0.02438139 -0.02520700 [43] -0.02603260 -0.02685820 -0.02768380 -0.02086532 -0.01930891 -0.02013451 [49] 0.12420181 > (mypacf <- c(rpacf$acf)) [1] -0.0594432775 -0.0640286272 -0.0723627512 -0.0779985355 -0.0854235982 [6] -0.0942418283 -0.1048861953 -0.1180211959 -0.1286976739 -0.1469242402 [11] -0.1731833506 0.4405662479 -0.0747757215 -0.0802944340 -0.0525241224 [16] -0.0583430619 -0.0612676589 -0.0637810924 -0.0668799359 -0.0702644550 [21] -0.0641208831 -0.0660158159 -0.0681683450 0.1220675924 -0.0341240558 [26] -0.0315930233 -0.0414703790 -0.0422538842 -0.0409551779 -0.0406271400 [31] -0.0400870765 -0.0392690599 -0.0459992813 -0.0465093479 -0.0467959069 [36] 0.1466829401 -0.0082059555 -0.0047356151 -0.0002926631 0.0011039291 [41] 0.0049886232 0.0093192200 0.0138053052 0.0185572835 0.0228537647 [46] 0.0287752281 0.0344170406 -0.2301300189 > 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/4ragy1321612212.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/5oxnh1321612212.tab") > > try(system("convert tmp/126jz1321612212.ps tmp/126jz1321612212.png",intern=TRUE)) character(0) > try(system("convert tmp/2j52c1321612212.ps tmp/2j52c1321612212.png",intern=TRUE)) character(0) > try(system("convert tmp/3ymx01321612212.ps tmp/3ymx01321612212.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.038 0.186 1.244