R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(90,51,47,59,54,79,59,80,46,62,55,77,72,72,71,50,66,78,59,52,71,98,70,84,90,98,98,78,59,0,58,55,62,80,91,86,61,49,61,56,73,85,82,32,39,30,51,48,57,59,32,56,54,74,62,78,72,48,59,61,80,69,58,63,27,23,34,45,51,51,73,37,35,66,54,30,66,61,37,55,64,53,63,70,72,52,53,50,60,73,66,78) > 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/yougetitorg/rcomp/tmp/191xi1305846769.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/yougetitorg/rcomp/tmp/26l7q1305846769.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/yougetitorg/rcomp/tmp/3beyt1305846769.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.279575008 -0.068203315 -0.060987863 -0.034938360 [6] -0.170884585 -0.077277234 0.396672216 -0.165600130 -0.008610423 [11] 0.064920683 -0.082180482 -0.112150147 -0.083774052 0.368483473 [16] -0.122316210 0.006983310 -0.054170565 -0.029212407 -0.002244904 [21] -0.161321089 0.429109487 -0.176344585 0.015992586 -0.192132915 [26] 0.097178793 -0.095800537 -0.034745628 0.315187819 -0.076128128 [31] -0.006414247 -0.088753245 -0.042918610 -0.040891264 -0.131350675 [36] 0.311861491 -0.006303258 0.001718049 -0.055389348 -0.013394434 [41] -0.038049294 -0.150780872 0.244720769 0.018229314 -0.020066528 [46] -0.154071556 0.143909048 -0.087903167 -0.064215322 0.188244394 [51] -0.024801917 -0.067180957 -0.038341396 0.061874232 -0.100566299 [56] -0.068100720 0.190011229 -0.036495443 -0.017768436 0.026223582 [61] -0.028699141 > (mypacf <- c(rpacf$acf)) [1] -0.279575008 -0.158775761 -0.141857642 -0.124578429 -0.282745144 [6] -0.332543267 0.204077125 -0.076742277 -0.100912719 0.021765073 [11] -0.103294627 -0.094599204 -0.200860383 0.137443018 0.068684800 [16] -0.010045664 -0.148067818 -0.070536894 0.118270466 -0.157724780 [21] 0.232645775 0.039063001 0.025153003 -0.260070591 -0.015531087 [26] -0.006210096 0.043513670 0.019606427 0.002320372 0.059187673 [31] -0.028806359 -0.117873126 0.035360549 -0.063719358 -0.077489966 [36] 0.063132220 -0.020679565 0.120996059 0.006498040 0.021747551 [41] -0.016066431 -0.035550781 0.135529838 -0.016767742 -0.051456682 [46] 0.054488004 0.036658647 0.056355370 0.032366720 -0.037858750 [51] -0.008763444 0.017528092 0.019238036 -0.071397409 0.003645625 [56] -0.118178917 -0.154736439 -0.087301180 0.127084923 0.002382511 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/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/yougetitorg/rcomp/tmp/49fer1305846769.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/yougetitorg/rcomp/tmp/5jtp71305846769.tab") > > try(system("convert tmp/191xi1305846769.ps tmp/191xi1305846769.png",intern=TRUE)) character(0) > try(system("convert tmp/26l7q1305846769.ps tmp/26l7q1305846769.png",intern=TRUE)) character(0) > try(system("convert tmp/3beyt1305846769.ps tmp/3beyt1305846769.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.980 0.600 1.269