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(15.58,15.66,15.73,15.74,15.77,15.78,15.8,15.81,15.82,15.88,15.85,15.89,15.92,16.02,16.1,16.13,16.21,16.25,16.27,16.21,16.21,16.24,16.32,16.32,16.36,16.48,16.54,16.58,16.56,16.55,16.58,16.53,16.6,16.46,16.48,16.48,16.49,16.54,16.67,16.72,16.79,16.86,16.84,16.86,16.96,17.01,17.02,17.04,17.04,17.39,17.54,17.57,17.58,17.56,17.63,17.67,17.71,17.75,17.82,17.86) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > 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/1el0u1321628180.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/2a1531321628180.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/3ymfk1321628180.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.911174074 0.824380861 0.746229379 0.680633682 [6] 0.585620417 0.466103774 0.357012892 0.251376541 0.140169152 [11] -0.006953999 -0.146900485 -0.232217819 -0.278183783 -0.319305837 [16] -0.373551321 -0.386358660 -0.379084854 -0.358371357 -0.352508555 [21] -0.341847795 -0.306226838 -0.252262812 -0.187991960 -0.150922154 [26] -0.121983199 -0.096463634 -0.062091498 -0.072790439 -0.070433526 [31] -0.064657223 -0.049998615 -0.034550708 -0.044071108 -0.052602183 [36] -0.067515218 -0.074989390 -0.083712383 -0.084742424 -0.068167335 [41] -0.054946763 -0.044026508 -0.049535544 -0.051976590 -0.049073656 [46] -0.041578197 -0.032020292 -0.018086108 > (mypacf <- c(rpacf$acf)) [1] 0.911174074 -0.034503241 0.003515615 0.030139364 -0.209742434 [6] -0.206878094 -0.034551429 -0.097723948 -0.117766592 -0.286918890 [11] -0.135300117 0.166865479 0.180373967 0.099590665 -0.036372830 [16] 0.142735573 0.006157355 0.020355052 -0.091251846 -0.149957336 [21] -0.150722112 -0.083286591 0.102580556 -0.003767404 -0.079124305 [26] -0.098494232 0.091353037 -0.178770974 0.153513813 -0.025832392 [31] -0.014496764 0.064357196 -0.003375302 0.091399230 -0.048980597 [36] -0.112823843 -0.054606790 0.050314343 -0.002657772 -0.066292002 [41] -0.113464125 -0.068247673 -0.079048441 0.103610658 0.031206426 [46] -0.001801134 0.034914588 > 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/4xf3d1321628180.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/59y3g1321628180.tab") > > try(system("convert tmp/1el0u1321628180.ps tmp/1el0u1321628180.png",intern=TRUE)) character(0) > try(system("convert tmp/2a1531321628180.ps tmp/2a1531321628180.png",intern=TRUE)) character(0) > try(system("convert tmp/3ymfk1321628180.ps tmp/3ymfk1321628180.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.939 0.179 1.170