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(760,730,730,680,730,710,800,830,820,770,800,840,800,710,800,780,760,730,770,880,850,810,770,810,890,790,840,830,740,760,630,890,900,820,810,820,890,810,810,840,830,790,610,870,870,820,800,840,860,860,730,850,860,900,610,960,820,860,810,820,820,880,840,910,860,880,620,970,810,880,870,800,740,1010,850,980,880,870,660,940,860,880,1000,840,800,1060,790,930,920,840,690,940,1010,890,1000,820,800,1000,780,1010,950,830,670,1000,960,920,1040,860) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/1qgnm1312388699.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/2e5ow1312388699.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/3frf31312388699.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.554676087 0.057680888 -0.017837790 0.047684615 [6] -0.168950622 0.261141451 -0.173984602 0.079915213 -0.005128347 [11] 0.023036000 -0.440749213 0.760203523 -0.424716831 0.062164166 [16] 0.012211719 -0.023535259 -0.109410652 0.269360800 -0.244527315 [21] 0.133200758 -0.024682642 0.041181532 -0.351196295 0.526998987 [26] -0.262080636 0.033577710 0.019876159 -0.078718567 -0.007639096 [31] 0.190040525 -0.219312004 0.150484160 -0.044393204 0.011649497 [36] -0.226727135 0.325286095 -0.117151581 -0.028890646 0.077116231 [41] -0.140740976 0.089132960 0.054717978 -0.139866517 0.150954443 [46] -0.069702292 0.003915731 -0.125986200 0.192057215 -0.048851590 [51] -0.057080586 0.098380736 -0.136573954 0.096072404 -0.012920497 [56] -0.063614949 0.114157029 -0.054500332 -0.026956271 -0.028885132 [61] 0.056320613 > (mypacf <- c(rpacf$acf)) [1] -5.546761e-01 -3.610750e-01 -2.899507e-01 -1.723169e-01 -3.887556e-01 [6] -1.346066e-01 -1.770730e-01 -1.096080e-01 -1.216886e-02 9.359336e-02 [11] -7.232757e-01 -2.144678e-02 9.506343e-04 -6.196206e-02 3.106356e-02 [16] -1.216690e-01 -5.997022e-02 1.753245e-01 1.016000e-02 4.876057e-02 [21] -4.774939e-02 3.164585e-02 1.524242e-01 -1.088409e-01 4.176193e-02 [26] 3.593991e-02 -4.063195e-02 -1.000418e-01 1.918154e-02 -1.170981e-01 [31] -1.086112e-03 6.545552e-02 6.727235e-02 -3.690427e-02 2.010472e-02 [36] -4.917510e-02 7.489171e-02 -1.260692e-01 9.161481e-03 -6.703402e-02 [41] 1.147642e-01 -1.129289e-02 -9.948093e-02 -1.945875e-02 -5.539081e-02 [46] -4.643058e-02 -1.099639e-01 -1.861519e-02 9.883974e-05 -1.191306e-02 [51] -3.446110e-02 1.247789e-01 -2.022523e-02 8.574698e-03 6.112011e-03 [56] 1.125809e-02 3.435070e-02 2.040145e-02 -2.142813e-02 -1.356995e-02 > 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/45it41312388699.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/5mcde1312388699.tab") > > try(system("convert tmp/1qgnm1312388699.ps tmp/1qgnm1312388699.png",intern=TRUE)) character(0) > try(system("convert tmp/2e5ow1312388699.ps tmp/2e5ow1312388699.png",intern=TRUE)) character(0) > try(system("convert tmp/3frf31312388699.ps tmp/3frf31312388699.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.044 0.210 1.247