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(6.94,6.98,7.05,7.07,7.08,7.1,7.12,7.13,7.18,7.2,7.21,7.22,7.26,7.29,7.32,7.36,7.41,7.48,7.48,7.51,7.51,7.51,7.51,7.54,7.58,7.64,7.63,7.71,7.77,7.85,7.88,7.89,7.94,8.02,8.08,8.15,8.17,8.17,8.25,8.33,8.41,8.43,8.48,8.52,8.56,8.63,8.7,8.72,8.73,8.82,8.83,8.81,8.82,8.83,8.84,8.83,8.82,8.87,8.87,8.87) > 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/1k6441333212495.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/2bqhz1333212495.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/3iajd1333212495.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.0000000000 0.2432280164 0.0446945724 0.0953267165 0.2285486025 [6] 0.1694130197 0.1214142804 0.0105792221 0.0003844471 -0.1637848528 [11] 0.0428652738 0.1895739795 -0.1044911040 -0.1333154002 -0.0951142893 [16] 0.0461111387 -0.0488530662 -0.0302010324 -0.1956645220 -0.1441128219 [21] -0.2255561495 -0.0919936872 -0.0589012202 -0.2013417550 -0.1994801306 [26] -0.0772588576 -0.1181395531 -0.0766689102 -0.0901672749 -0.0987272839 [31] 0.0478111337 -0.0752846698 0.1021099565 0.1013832014 -0.0198734904 [36] -0.0945734080 -0.0063075877 0.0923798661 0.0450963369 -0.0966289878 [41] 0.0188488753 0.0503065764 -0.0428185167 0.0140121153 0.0797999028 [46] 0.0482169390 0.0180984531 0.0897441522 0.0569010562 > (mypacf <- c(rpacf$acf)) [1] 0.243228016 -0.015374871 0.093585525 0.197158319 0.077950531 [6] 0.069007736 -0.060720188 -0.048338923 -0.239645412 0.088355283 [11] 0.181273563 -0.176872850 0.013740915 -0.074456366 0.054219773 [16] -0.092189399 0.048095242 -0.206830655 -0.053186701 -0.112638900 [21] -0.096979850 0.032533864 -0.122129256 0.038953533 -0.012505285 [26] -0.095124175 -0.018787614 -0.078536964 0.006959651 0.083265474 [31] -0.044721771 0.106930911 0.062161628 -0.056495256 -0.151276200 [36] -0.094939773 0.066909386 -0.108495794 -0.050643384 0.024509399 [41] -0.020983729 -0.071290701 -0.066075356 0.006481763 -0.023674120 [46] 0.078908366 -0.023436918 -0.078576900 > 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/4epp21333212495.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/56oyy1333212495.tab") > > try(system("convert tmp/1k6441333212495.ps tmp/1k6441333212495.png",intern=TRUE)) character(0) > try(system("convert tmp/2bqhz1333212495.ps tmp/2bqhz1333212495.png",intern=TRUE)) character(0) > try(system("convert tmp/3iajd1333212495.ps tmp/3iajd1333212495.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.017 0.205 1.234