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(18.94,18.97,19,19.08,19.18,19.24,19.23,19.25,19.3,19.33,19.35,19.35,19.31,19.47,19.7,19.76,19.9,19.97,20.1,20.26,20.44,20.43,20.57,20.6,20.69,20.93,20.98,21.11,21.14,21.16,21.32,21.32,21.48,21.58,21.74,21.75,21.81,21.89,22.21,22.37,22.47,22.51,22.55,22.61,22.58,22.85,22.93,22.98,23.01,23.11,23.18,23.18,23.21,23.22,23.12,23.15,23.16,23.21,23.21,23.22,23.25,23.39,23.41,23.45,23.46,23.44,23.54,23.62,23.86,24.07,24.13,24.12) > 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/1w7t01321383349.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/28qx21321383349.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/3uldg1321383349.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.96351875 0.92500834 0.88551080 0.84806823 0.81332203 [7] 0.77832134 0.74242845 0.70451510 0.66557956 0.62598666 0.58537961 [13] 0.54453043 0.50169572 0.45947176 0.41898409 0.37862904 0.33880533 [19] 0.29906214 0.25819504 0.21808153 0.17917212 0.13862499 0.09956221 [25] 0.06033434 0.02131401 -0.01522889 -0.05104393 -0.08267132 -0.11532237 [31] -0.14822492 -0.17979294 -0.21223140 -0.24216935 -0.26942957 -0.29124286 [37] -0.31279838 -0.33380050 -0.35427763 -0.36882854 -0.38045046 -0.38892572 [43] -0.39755647 -0.40438307 -0.41089008 -0.41817493 -0.42057388 -0.42171542 [49] -0.41968209 > (mypacf <- c(rpacf$acf)) [1] 0.9635187548 -0.0469073898 -0.0330573911 0.0085394383 0.0161277620 [6] -0.0255585301 -0.0322630877 -0.0461666088 -0.0337430818 -0.0321124718 [11] -0.0400574419 -0.0305725054 -0.0550325495 -0.0193855169 -0.0045030843 [16] -0.0291316913 -0.0232539606 -0.0259299359 -0.0439446860 -0.0192826405 [21] -0.0152646436 -0.0589325660 -0.0142450302 -0.0371846983 -0.0345785873 [26] -0.0037581775 -0.0291074342 0.0204345690 -0.0500807063 -0.0398451419 [31] -0.0148761415 -0.0505951413 -0.0106472075 -0.0027133051 0.0327192409 [36] -0.0376842286 -0.0259936827 -0.0280156531 0.0520248249 0.0027311449 [41] 0.0081729349 -0.0310366198 -0.0006085144 -0.0240517929 -0.0434185721 [46] 0.0328513158 -0.0166012263 0.0167838805 > 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/4mr5h1321383349.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/5n3hc1321383349.tab") > > try(system("convert tmp/1w7t01321383349.ps tmp/1w7t01321383349.png",intern=TRUE)) character(0) > try(system("convert tmp/28qx21321383349.ps tmp/28qx21321383349.png",intern=TRUE)) character(0) > try(system("convert tmp/3uldg1321383349.ps tmp/3uldg1321383349.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.947 0.171 1.131