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(236.77,239.23,240.23,240.33,240.33,240.34,240.34,240.27,240.29,240.29,240.29,240.29,240.31,239.95,242.33,242.11,241.53,241.53,241.53,241.41,241.41,241.66,241.8,241.99,246.24,247.57,247.84,248.27,248.3,248.31,248.31,248.38,248.37,248.41,248.68,248.75,248.75,247.95,248.13,247.86,246.23,245.98,245.98,246.27,246.31,246.3,246.67,246.78,246.78,247.91,247.99,248.6,248.68,248.75,248.75,249.03,249.05,249.57,249.35,249.46,249.46,250.82,254.19,255.18,256.68,256.73,256.73,257.39,257.78,258.67,258.71,258.91,258.91,261.38,262.42,262.77,263.24,262.83,262.83,263.09,263.6,265.68,266.08,266.28) > 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/wessaorg/rcomp/tmp/1sgzs1321967678.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/26p861321967678.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/3agwa1321967678.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.947732233 0.897431011 0.848453138 0.805068810 [6] 0.762738416 0.719663724 0.675049970 0.626656273 0.578660911 [11] 0.531142680 0.483830503 0.442275750 0.398179771 0.351531368 [16] 0.310271256 0.272130778 0.234635509 0.198634129 0.161095327 [21] 0.121025424 0.084737677 0.052128457 0.030813783 0.012760187 [26] 0.003703928 -0.002666850 -0.009055776 -0.013105918 -0.017277192 [31] -0.020675736 -0.024655801 -0.028643927 -0.033063507 -0.035096371 [36] -0.035760145 -0.033234244 -0.030474041 -0.031911841 -0.034584122 [41] -0.038509639 -0.047696419 -0.056324690 -0.065196761 -0.075102001 [46] -0.090743018 -0.108235070 -0.124195288 -0.143840813 > (mypacf <- c(rpacf$acf)) [1] 0.947732233 -0.007518140 -0.013166638 0.028922591 -0.011716792 [6] -0.029758775 -0.037370462 -0.063296235 -0.027885547 -0.027952891 [11] -0.032912445 0.024872511 -0.051327937 -0.055556434 0.025018855 [16] -0.000859037 -0.025780725 -0.010992788 -0.044534215 -0.055424609 [21] 0.003079328 -0.002986469 0.080419328 0.012690844 0.071409705 [26] 0.034259740 -0.005450328 0.009967233 -0.012277196 -0.016267445 [31] -0.025791712 -0.016817192 -0.022411544 0.010982876 -0.003172664 [36] 0.026918115 0.006709700 -0.045151115 -0.012002607 -0.021159816 [41] -0.079020026 -0.020999388 -0.021873142 -0.033093564 -0.055572064 [46] -0.029581742 0.014569503 -0.043518160 > 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/4b6o21321967678.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/5iyue1321967678.tab") > > try(system("convert tmp/1sgzs1321967678.ps tmp/1sgzs1321967678.png",intern=TRUE)) character(0) > try(system("convert tmp/26p861321967678.ps tmp/26p861321967678.png",intern=TRUE)) character(0) > try(system("convert tmp/3agwa1321967678.ps tmp/3agwa1321967678.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.941 0.176 1.120