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(20.89,21.04,21.07,21.12,21.25,21.24,21.24,21.22,21.29,21.25,21.15,21.16,21.16,21.52,21.59,21.6,21.68,21.67,21.67,21.65,21.74,21.72,21.84,21.94,21.94,21.95,21.96,22.1,22.13,22.18,22.18,22.27,22.3,22.04,22.05,22.06,22.06,22.06,21.97,22.03,22.08,22.13,22.13,22.4,22.4,22.12,22.22,22.14,22.14,22.19,22.29,22.24,22.26,22.29,22.29,22.29,22.29,22.35,22.39,22.43) > 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/1lx591321389285.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/2nr7e1321389285.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/311jf1321389285.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.053266360 -0.128533355 0.054658964 -0.084271673 [6] -0.071596948 -0.170841291 0.131149728 -0.118513948 0.195019717 [11] -0.120929700 -0.060354345 0.257264524 -0.127447437 0.137215825 [16] 0.037876871 0.029916074 -0.115008899 0.013616032 0.054289107 [21] -0.208123516 0.084663121 -0.087979747 0.100074945 -0.027279255 [26] -0.180705779 0.106454831 0.096858600 0.086062826 -0.106772914 [31] 0.195694542 -0.081470772 -0.275279663 -0.011353022 -0.119524668 [36] 0.082708286 0.026525854 0.013425605 -0.014880120 0.051034047 [41] 0.012503484 -0.072021957 0.066571009 -0.051440271 -0.053021526 [46] 0.040221951 0.010628829 -0.024404475 -0.005627286 > (mypacf <- c(rpacf$acf)) [1] -0.053266360 -0.131744459 0.040713074 -0.097849312 -0.071011856 [6] -0.212598760 0.103071621 -0.179250764 0.250063959 -0.269804417 [11] 0.081972303 0.097516208 -0.022986278 0.157052398 0.078376822 [16] -0.003713680 -0.006293315 0.044499337 0.033394289 -0.076730985 [21] -0.055362516 -0.030117286 0.055016921 -0.109468444 -0.159160705 [26] -0.009662566 0.087058831 0.034536979 0.007220997 0.106649658 [31] -0.110560712 -0.161422737 -0.073929507 -0.061965255 -0.002005494 [36] 0.047098323 -0.085997013 -0.036686888 -0.007180064 -0.003667438 [41] 0.043957483 -0.157363616 0.071453136 -0.101476687 0.062380450 [46] 0.071251254 0.056219034 0.010007629 > 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/4vpa21321389285.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/50x9t1321389285.tab") > > try(system("convert tmp/1lx591321389285.ps tmp/1lx591321389285.png",intern=TRUE)) character(0) > try(system("convert tmp/2nr7e1321389285.ps tmp/2nr7e1321389285.png",intern=TRUE)) character(0) > try(system("convert tmp/311jf1321389285.ps tmp/311jf1321389285.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.960 0.175 1.162