R version 2.12.1 (2010-12-16) Copyright (C) 2010 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(2.12,2.13,2.16,2.25,2.26,2.39,2.36,2.26,2.26,2.27,2.29,2.21,2.17,2.17,2.08,2.12,2.18,2.13,2.21,2.06,1.91,1.99,2.04,2.02,2.01,2.1,2.01,2.07,2.05,2.1,2.15,2.15,1.96,2.06,2.07,2.05,2.08,2.14,2.16,2.35,2.31,2.2,2.3,2.22,2.14,2.17,2.12,2.1,2.17,2.29,2.17,2.25,2.13,2.23,2.17,2.24,2.13,2.16,2.1,2.05,2.03,2.24,2.17,2.13,2.21,2.18,2.21,2.23,2.09,2.16,2.13,2.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/www/rcomp/tmp/1d4k01321297563.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/www/rcomp/tmp/2nc5i1321297563.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/www/rcomp/tmp/34xq61321297563.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.6473557796 0.5116690362 0.4078551118 0.2638447288 [6] 0.1544601697 0.1880121494 0.0238906122 0.0521046056 0.0590183534 [11] -0.0083473353 -0.0008390418 0.0922709060 -0.0428988411 -0.1899982767 [16] -0.2567952695 -0.3512903365 -0.4324339753 -0.3704213519 -0.4103345397 [21] -0.3519796648 -0.2672967558 -0.2023114041 -0.1998179742 -0.0628279695 [26] -0.1241060273 -0.1272866313 -0.1290196459 -0.1668519237 -0.2329897462 [31] -0.0902998578 -0.0310660894 0.0434578433 0.1205796820 0.1369415363 [36] 0.1256311663 0.1780147344 0.1295840334 0.0734500883 0.0836079876 [41] 0.0282753867 -0.0473363922 -0.0149347292 0.0475690405 0.0636336220 [46] 0.0825675326 0.0664103227 0.0198020335 0.0557709707 > (mypacf <- c(rpacf$acf)) [1] 0.647355780 0.159398640 0.046334982 -0.095119226 -0.065233646 [6] 0.168861310 -0.225680618 0.127741713 0.019770352 -0.084177157 [11] 0.051082134 0.111867582 -0.184303313 -0.346224338 -0.077072341 [16] -0.044599273 -0.172333867 0.026009187 -0.036767462 0.037849261 [21] -0.047596231 0.116974727 -0.069991870 0.003423599 -0.113839291 [26] 0.034729179 -0.020946581 -0.144886754 -0.090308786 0.133351634 [31] 0.118945604 -0.046368305 -0.059002679 -0.065865420 -0.057332460 [36] -0.062482926 -0.005733503 -0.058987801 -0.029331198 -0.020892825 [41] 0.020623733 -0.084054220 0.030831011 -0.063267886 -0.067045856 [46] -0.075285422 -0.004981842 0.037269154 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/4tzsm1321297563.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/www/rcomp/tmp/5twaf1321297563.tab") > > try(system("convert tmp/1d4k01321297563.ps tmp/1d4k01321297563.png",intern=TRUE)) character(0) > try(system("convert tmp/2nc5i1321297563.ps tmp/2nc5i1321297563.png",intern=TRUE)) character(0) > try(system("convert tmp/34xq61321297563.ps tmp/34xq61321297563.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.14 0.20 1.32