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(192.89,194.76,194.76,194.76,194.76,194.76,194.76,194.76,194.76,194.76,194.76,194.76,194.76,194.76,199.15,199.15,199.15,199.15,199.15,199.15,199.15,199.15,199.15,199.15,199.15,200.4,200.4,200.4,200.4,200.4,200.4,200.4,200.4,200.4,200.4,200.4,200.4,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,204.15,212.25,212.25,212.25,212.25,212.25,212.25,212.25,212.25,212.25,212.25,212.25) > 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/1bjfo1321612806.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/2do2b1321612806.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/3o5u91321612806.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.04906008 -0.04981321 -0.05056633 -0.05131946 -0.05207258 [7] -0.05282571 -0.05357883 -0.05433196 -0.05508508 -0.05583821 0.02136437 [13] 0.01250793 0.04742763 -0.02435363 -0.02510675 -0.02585988 -0.02661300 [19] -0.02736612 -0.02811925 -0.02887237 -0.02962550 -0.03037862 0.13561934 [25] 0.29946486 -0.02918553 -0.02993865 -0.03069178 -0.03144490 -0.03219803 [31] -0.03295115 -0.03370428 -0.03445740 -0.03521053 -0.03596365 -0.02635937 [37] 0.14647578 -0.01750820 -0.01826133 -0.01901445 -0.01976758 -0.02052070 [43] -0.02127383 -0.02202695 -0.02278008 -0.02353320 -0.02428633 0.33859537 [49] -0.02234011 > (mypacf <- c(rpacf$acf)) [1] -0.049060085 -0.052346093 -0.055994036 -0.060073105 -0.064671401 [6] -0.069902852 -0.075917385 -0.082916340 -0.091176524 -0.101089174 [11] -0.031084793 -0.036484520 0.003137352 -0.061988064 -0.066087400 [16] -0.070785990 -0.075794868 -0.081571509 -0.088316594 -0.096307964 [21] -0.105936902 -0.124239006 0.042065717 0.258283855 -0.010474296 [26] -0.027737637 -0.026231279 -0.025341426 -0.024450183 -0.023445602 [31] -0.022275661 -0.021042102 -0.017230083 -0.037227306 -0.080893414 [36] 0.102838480 -0.053665613 -0.035848203 -0.035633802 -0.037499328 [41] -0.039704552 -0.042165152 -0.044883907 -0.048301648 -0.049905883 [46] -0.079194792 0.247861296 -0.099765624 > 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/4tfmg1321612806.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/5abme1321612806.tab") > > try(system("convert tmp/1bjfo1321612806.ps tmp/1bjfo1321612806.png",intern=TRUE)) character(0) > try(system("convert tmp/2do2b1321612806.ps tmp/2do2b1321612806.png",intern=TRUE)) character(0) > try(system("convert tmp/3o5u91321612806.ps tmp/3o5u91321612806.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.045 0.198 1.694