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(49.98,50.12,50.37,50.39,50.34,50.32,50.32,50.32,50.67,50.86,50.95,51.02,51.02,51.06,50.9,51.23,51.29,51.3,51.3,51.3,51.46,51.47,51.77,51.82,51.82,51.84,51.9,51.94,52.22,52.27,52.27,52.28,52.53,52.73,52.72,52.67,52.67,52.65,52.69,52.73,52.84,52.83,52.83,52.84,52.82,53.09,53.4,53.43,53.43,53.42,53.6,53.69,54.05,54.04,54.04,54.08,54.05,54.39,54.38,54.46) > 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/1dwav1321957896.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/2yhxj1321957896.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/3o59i1321957896.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.94030358 0.88253465 0.82809931 0.78196187 0.73242044 [7] 0.67908700 0.62126617 0.55683145 0.50808432 0.46501691 0.42678119 [13] 0.38746335 0.34456324 0.29911333 0.25443677 0.22375762 0.19360666 [19] 0.16085622 0.12476921 0.08597392 0.05036363 0.01472983 -0.01383602 [25] -0.04421758 -0.07888231 -0.11719855 -0.15577442 -0.18945999 -0.21124039 [31] -0.23332627 -0.25927095 -0.28630562 -0.30178846 -0.31165838 -0.32061456 [37] -0.33254662 -0.34552741 -0.36163725 -0.37049663 -0.37887622 -0.38111820 [43] -0.38413099 -0.38944438 -0.39549699 -0.40359557 -0.39772482 -0.38871225 [49] -0.37832199 > (mypacf <- c(rpacf$acf)) [1] 0.9403035838 -0.0141257724 -0.0016489033 0.0427133806 -0.0527338739 [6] -0.0585725263 -0.0681873906 -0.0999066685 0.0890481089 0.0149171700 [11] 0.0154852963 -0.0107078775 -0.0561455228 -0.0565772713 -0.0416819238 [16] 0.0626246628 -0.0127929524 -0.0362631766 -0.0316556098 -0.0569852077 [21] -0.0204913090 -0.0530154315 0.0094155551 -0.0182173434 -0.0581702889 [26] -0.0575186426 -0.0547467924 -0.0247783995 0.0587648049 -0.0389253165 [31] -0.0346801685 -0.0313008718 0.0478416834 -0.0009621369 -0.0409673250 [36] -0.0511109196 -0.0230789030 -0.0515410717 0.0216895603 -0.0511889967 [41] 0.0268400142 -0.0215956238 -0.0364319568 -0.0191491731 -0.0648830676 [46] 0.0635301777 0.0061156016 -0.0016926803 > 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/4uj4z1321957897.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/5wwjh1321957897.tab") > > try(system("convert tmp/1dwav1321957896.ps tmp/1dwav1321957896.png",intern=TRUE)) character(0) > try(system("convert tmp/2yhxj1321957896.ps tmp/2yhxj1321957896.png",intern=TRUE)) character(0) > try(system("convert tmp/3o59i1321957896.ps tmp/3o59i1321957896.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.933 0.149 1.094