R version 2.12.0 (2010-10-15) Copyright (C) 2010 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 = '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/www/rcomp/tmp/1okag1324137846.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/www/rcomp/tmp/2o00m1324137846.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/www/rcomp/tmp/3ko0m1324137846.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.957224773 0.914449546 0.871674318 0.826680896 [6] 0.781687474 0.736694051 0.691700629 0.646707206 0.601713784 [11] 0.563636942 0.525560100 0.487483258 0.433730162 0.379977067 [16] 0.326223971 0.293144774 0.260065577 0.226986379 0.193907182 [21] 0.160827985 0.127748787 0.108087043 0.088425298 0.068763553 [26] 0.037144494 0.005525434 -0.026093625 -0.047882486 -0.069671347 [31] -0.091460208 -0.113249069 -0.135037929 -0.156826790 -0.170339705 [36] -0.183852620 -0.197365534 -0.222378097 -0.247390659 -0.272403222 [41] -0.288942000 -0.305480779 -0.322019558 -0.338558337 -0.355097116 [46] -0.371635895 -0.378544879 -0.385453864 -0.392362849 > (mypacf <- c(rpacf$acf)) [1] 0.9572247728 -0.0218550408 -0.0223433557 -0.0493750627 -0.0246643649 [6] -0.0252880793 -0.0252539640 -0.0265984191 -0.0273252269 0.0550643579 [11] -0.0244729913 -0.0250869438 -0.2193822615 -0.0391876495 -0.0407859552 [16] 0.2340627856 -0.0253143367 -0.0259717955 -0.0566306755 -0.0290899811 [21] -0.0299615624 0.1230876038 -0.0233941372 -0.0239545328 -0.1313028355 [26] -0.0311959472 -0.0322004714 0.0290571548 -0.0303820028 -0.0313339922 [31] 0.0403612317 -0.0289027626 -0.0297629954 -0.0055185689 -0.0300933166 [36] -0.0310270226 -0.0518095973 -0.0344176866 -0.0356444874 0.0003821975 [41] -0.0356172514 -0.0369326923 0.0143267040 -0.0358893919 -0.0372253884 [46] 0.0392838454 -0.0344112267 -0.0356375588 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/4egku1324137846.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/www/rcomp/tmp/5sy8w1324137846.tab") > > try(system("convert tmp/1okag1324137846.ps tmp/1okag1324137846.png",intern=TRUE)) character(0) > try(system("convert tmp/2o00m1324137846.ps tmp/2o00m1324137846.png",intern=TRUE)) character(0) > try(system("convert tmp/3ko0m1324137846.ps tmp/3ko0m1324137846.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.010 0.080 1.107