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(128.27,128.38,128.47,128.52,128.71,128.92,128.92,128.82,128.97,129.04,128.95,129.39,129.39,129.48,130.16,129.89,129.85,129.9,129.9,129.57,129.54,129.57,128.97,129.01,129.01,128.72,128.32,128.39,128.33,128.44,128.44,128.6,128.3,128.56,128.01,128.01,128.01,128.26,128.38,128.36,128.48,128.46,128.46,129.56,129.66,129.47,129.41,129.48,129.48,130.17,129.77,129.87,129.97,130.05,130.05,129.89,130.33,130.6,131.46,131.73) > 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/1bnry1333224734.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/2lqvn1333224734.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/3jcjv1333224734.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.84124809 0.70215284 0.60903146 0.51959763 0.45750247 [7] 0.38921037 0.29090154 0.19277890 0.11725691 0.03975573 -0.08734547 [13] -0.13823027 -0.19070368 -0.24596492 -0.28986420 -0.36284862 -0.45036970 [19] -0.44319366 -0.42167202 -0.41849653 -0.40810649 -0.37699785 -0.34770953 [25] -0.29211750 -0.21462131 -0.14504677 -0.12144846 -0.07077506 -0.03971853 [31] -0.01716244 0.01315460 0.06073981 0.09629354 0.15103173 0.18004347 [37] 0.17315082 0.18423381 0.21185003 0.19102008 0.17621994 0.15947198 [43] 0.12176207 0.07851224 0.06294174 0.03196961 -0.03388189 -0.05914665 [49] -0.08820317 > (mypacf <- c(rpacf$acf)) [1] 0.841248087 -0.018971861 0.079057713 -0.030941294 0.056444383 [6] -0.052007652 -0.128226580 -0.081562840 -0.016873632 -0.079086691 [11] -0.254462796 0.138393424 -0.090667763 -0.033943240 -0.079118751 [16] -0.136252547 -0.150551529 0.171816263 -0.031693603 -0.046280096 [21] 0.008687281 0.013239292 0.029379039 0.024886856 0.080437469 [26] 0.066883617 -0.160295638 -0.031485891 0.004049075 -0.045093722 [31] -0.052412512 0.088525614 -0.055640015 0.055553729 -0.002952139 [36] -0.059194844 0.090309797 -0.003335417 -0.125455724 0.002671462 [41] -0.005327991 -0.040646418 0.012399131 -0.047105057 0.019429214 [46] -0.139891656 0.010847299 -0.032894878 > 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/4q1mp1333224734.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/5u2qk1333224734.tab") > > try(system("convert tmp/1bnry1333224734.ps tmp/1bnry1333224734.png",intern=TRUE)) character(0) > try(system("convert tmp/2lqvn1333224734.ps tmp/2lqvn1333224734.png",intern=TRUE)) character(0) > try(system("convert tmp/3jcjv1333224734.ps tmp/3jcjv1333224734.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.980 0.245 1.276