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(3.11,3.1,3.13,3.14,3.16,3.17,3.19,3.18,3.17,3.17,3.2,3.21,3.25,3.22,3.25,3.31,3.35,3.37,3.38,3.38,3.39,3.44,3.56,3.65,3.69,3.71,3.71,3.74,3.75,3.77,3.75,3.78,3.8,3.78,3.79,3.8,3.82,3.82,3.84,3.86,3.8,3.85,3.78,3.79,3.77,3.78,3.77,3.76,3.78,3.76,3.75,3.71,3.72,3.7,3.69,3.7,3.72,3.73,3.73,3.69) > 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/1y3w91321384923.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/2xwzi1321384923.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/39ttt1321384923.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.96469632 0.92270695 0.87821278 0.83359418 0.78890092 [7] 0.74209234 0.69387394 0.63827553 0.57944440 0.51560616 0.45213623 [13] 0.38708230 0.32381769 0.25485661 0.18738373 0.12715897 0.06926606 [19] 0.01195672 -0.04578564 -0.10326047 -0.16150304 -0.21398818 -0.25177800 [25] -0.27936321 -0.30127685 -0.32029249 -0.33869717 -0.35336269 -0.36333591 [31] -0.37015978 -0.37797910 -0.38123304 -0.38109125 -0.38329499 -0.38454185 [37] -0.38365970 -0.37779780 -0.36753229 -0.35003733 -0.32834530 -0.31275414 [43] -0.29165689 -0.27806533 -0.26229498 -0.24696512 -0.22825696 -0.21031528 [49] -0.19362041 > (mypacf <- c(rpacf$acf)) [1] 0.9646963194 -0.1143587408 -0.0495535636 -0.0198164322 -0.0247084794 [6] -0.0559819816 -0.0422480559 -0.1323781973 -0.0644433604 -0.1024232903 [11] -0.0272165110 -0.0704241058 -0.0160573785 -0.1390010273 -0.0112406807 [16] 0.0551365834 -0.0219278647 -0.0551877392 -0.0505938913 -0.0601423116 [21] -0.0614125437 0.0160920717 0.1442905578 0.0577260699 0.0130235302 [26] -0.0091753533 -0.0252977226 0.0174947713 -0.0004727055 -0.0356127559 [31] -0.0934649266 -0.0039194519 -0.0169094253 -0.0964813504 -0.0454603900 [36] -0.0541545602 0.0148550573 0.0579534362 0.0981286515 0.0470622870 [41] -0.1341208282 0.0623883454 -0.1529126778 0.0465729936 -0.0067029302 [46] 0.0421761607 -0.0227728723 -0.0103247671 > 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/4wq531321384923.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/5l70r1321384923.tab") > > try(system("convert tmp/1y3w91321384923.ps tmp/1y3w91321384923.png",intern=TRUE)) character(0) > try(system("convert tmp/2xwzi1321384923.ps tmp/2xwzi1321384923.png",intern=TRUE)) character(0) > try(system("convert tmp/39ttt1321384923.ps tmp/39ttt1321384923.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.370 0.230 1.571