R version 2.12.0 (2010-10-15) 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(99.1,99.7,100.1,100.2,100.1,100.4,99.8,99.7,99.4,100.2,100.5,100.6,100.9,101.9,102.1,102.6,103.5,103.9,103.7,103,103.1,103.2,103.2,103.1,103.7,104.2,104.4,104.9,105.4,105.9,105.5,106.1,105.4,105.7,106.2,106.7,106.8,106.8,106.8,107.3,107.3,107.5,107.4,106.9,108.1,108.6,108.2,108.3,108.3,109.3,109.2,109.4,109.7,109.6,109.3,108.4,108.7,109.4,109,110.3,109.5,109.7,109.5,110.9,110.9,110.4,111.1,110.8,111.3,111.7,112.2,111.7,111.3,111.9,111.7,111.8,111.5,112.9,112,112.4,111.1,111.7,111.4,112.2,112.5,113.2,114.7,115.2,114.1,113.7,115.5,115,115.4,115,114.6,114.6,114.5,115.2,116.3,116.5,118.4,118.5,118.7,119.2,119.5,118.5,118.6,118.2,118.6,120.6,124.5,124.6,126.5,126,126.3,126.3,125.1,126.7,123.9,123.6,124.9,126.2,126.3,126.4,126.2,125.8,124.9,126.2,125.9,124.6,122.9,119.9) > 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/18kj01322081805.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/2p7oh1322081805.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/3w1ks1322081805.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.980201429 0.957458541 0.931625042 0.904880177 0.877755030 [7] 0.852450156 0.825963866 0.797901537 0.769640871 0.743464380 0.716474873 [13] 0.688843639 0.661304198 0.632336650 0.600380528 0.570465553 0.541679131 [19] 0.512695192 0.483883772 0.454829350 0.427805830 0.403469691 0.383421560 [25] 0.364190954 0.344431313 0.323932827 0.303803558 0.282165865 0.262200921 [31] 0.243681704 0.225367790 0.208611066 0.193888113 0.179582324 0.166862408 [37] 0.154715784 0.142180273 0.128770686 0.114406297 0.101118827 0.087721534 [43] 0.074170981 0.061427708 0.047371068 0.034068846 0.023626115 0.013291158 [49] 0.003585634 > (mypacf <- c(rpacf$acf)) [1] 0.9802014293 -0.0850985160 -0.0855226711 -0.0262917653 -0.0158542921 [6] 0.0360474705 -0.0495542079 -0.0580940063 -0.0122779709 0.0453616167 [11] -0.0390831838 -0.0411781393 -0.0135128776 -0.0481464497 -0.0833250067 [16] 0.0424326960 0.0098224901 -0.0310579732 -0.0186345946 -0.0341635219 [21] 0.0461509089 0.0538124606 0.0678168165 -0.0288359636 -0.0388699361 [26] -0.0278838228 -0.0002023080 -0.0471905075 0.0202865234 0.0070030167 [31] -0.0171911134 0.0330268341 0.0260424774 -0.0169811174 0.0076747323 [36] -0.0187658018 -0.0384275685 -0.0161725720 -0.0292950152 0.0109794980 [41] -0.0180323601 -0.0160631528 0.0059095973 -0.0383848442 0.0223208621 [46] 0.0479899622 -0.0333866269 -0.0104839060 > 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/4v1z01322081805.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/588bz1322081805.tab") > > try(system("convert tmp/18kj01322081805.ps tmp/18kj01322081805.png",intern=TRUE)) character(0) > try(system("convert tmp/2p7oh1322081805.ps tmp/2p7oh1322081805.png",intern=TRUE)) character(0) > try(system("convert tmp/3w1ks1322081805.ps tmp/3w1ks1322081805.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.430 0.140 1.573