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(20,32,11,14,199,162,88,89,24,36,142,193,39,25,95,144,33,131,31,24,160,52,57,210,13,52,96,133,74,131,129,74,127,55,175,185,34,115,95,58,63,56,70,32,32,14,6,23,18,4,6,17,20,20,44,32,20,14,9,59,10,47,43,34,5,49,130,10,117,108,17,55) > 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/1mvie1321795425.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/2utdy1321795425.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/38g0m1321795425.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.0000000000 0.2245153005 0.0871140836 0.3528008686 0.1150020569 [6] 0.2254841414 0.3857330872 0.2305600628 0.0575834487 0.1211164926 [11] 0.0769835237 0.0314684351 0.2104725444 -0.0133140605 -0.0727880273 [16] 0.0234421877 -0.0226059969 -0.0334597930 -0.0097103008 0.0048082948 [21] -0.1118625798 -0.1135408298 -0.0993455544 -0.0886235229 0.0274683601 [26] -0.0580247652 -0.1569628810 -0.0807596272 -0.0793587212 -0.1416123447 [31] -0.0655451292 0.0091911467 -0.1478243669 -0.1167118680 -0.0659627679 [36] -0.1923218758 -0.0780616773 -0.0963651705 -0.1047594709 -0.0380193835 [41] -0.1104820784 -0.1344698659 -0.0757564226 -0.0221175335 -0.1107983674 [46] -0.0331411520 0.0113621875 -0.1293845123 -0.0008850183 > (mypacf <- c(rpacf$acf)) [1] 0.2245153005 0.0386554746 0.3431013030 -0.0363561396 0.2290114964 [6] 0.2251632218 0.1452073858 -0.1333273713 -0.0504122512 -0.1095597444 [11] -0.0768028571 0.0673723666 -0.1819173132 -0.0402883262 -0.0584458338 [16] 0.0693587715 -0.0317232151 -0.0086015679 0.0649207473 -0.0143432498 [21] -0.0518523996 -0.1207139507 0.0096068161 0.0802736433 0.0226085396 [26] -0.0988007814 0.0072261351 0.0203268707 -0.0701271204 -0.0586020936 [31] 0.0327934924 -0.0260534171 -0.0019842004 -0.0527128208 -0.1373637699 [36] -0.0099545496 -0.0808137154 0.0847030165 0.0266503292 0.0002302959 [41] -0.0047259026 0.0189705307 0.0168039632 -0.0785226592 0.0608995944 [46] 0.0313195080 -0.0452768177 -0.0222686721 > 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/461wu1321795425.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/527yf1321795425.tab") > > try(system("convert tmp/1mvie1321795425.ps tmp/1mvie1321795425.png",intern=TRUE)) character(0) > try(system("convert tmp/2utdy1321795425.ps tmp/2utdy1321795425.png",intern=TRUE)) character(0) > try(system("convert tmp/38g0m1321795425.ps tmp/38g0m1321795425.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.932 0.148 1.100