R version 2.9.0 (2009-04-17) 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(0.397232704,0.382767296,0.396037736,0.441761006,0.445220126,0.438490566,0.467484277,0.465786164,0.402075472,0.376163522,0.37591195,0.392955975,0.34490566,0.368553459,0.390880503,0.424842767,0.426855346,0.442327044,0.474842767,0.447610063,0.480754717,0.516037736,0.580628931,0.573522013,0.578867925,0.593584906,0.645974843,0.690503145,0.782201258,0.839056604,0.847484277,0.726855346,0.635534591,0.470943396,0.346163522,0.272327044,0.286792453,0.27672956,0.297421384,0.321698113,0.365597484,0.435220126,0.412893082,0.458679245,0.428427673,0.463522013,0.487169811,0.473584906,0.491886792,0.474842767,0.502327044,0.539371069,0.484402516,0.474654088,0.473522013,0.48754717,0.493333333,0.525157233,0.542704403) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '2' > 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/html/rcomp/tmp/1pii51292429945.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/html/rcomp/tmp/209h81292429945.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/html/rcomp/tmp/309h81292429945.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.3332344538 0.1540198144 -0.1651901935 0.0596504875 [6] -0.1334280940 -0.2224036513 0.0954421012 0.0723390526 -0.1110535653 [11] 0.0105668656 0.1022573917 -0.0073948392 -0.0846491747 0.0175079988 [16] 0.1406119877 -0.0905873149 -0.0572557916 -0.0459137502 0.2206020299 [21] -0.2611649242 0.1778308989 -0.1151388743 0.2093989406 -0.2138162639 [26] 0.1638706462 0.0114888372 -0.0515413911 -0.0289139060 -0.0321712084 [31] 0.0759052594 -0.1274743398 -0.0006008203 0.0533102122 -0.0167596149 [36] 0.0389813311 -0.0158132124 0.0476412613 -0.0397420302 -0.0389890499 [41] 0.0877173386 -0.0532557015 0.0034966237 -0.0370840589 0.0745009636 [46] -0.0061986284 -0.0467195779 0.0123232718 0.0484800213 > (mypacf <- c(rpacf$acf)) [1] -3.332345e-01 4.834286e-02 -1.130226e-01 -3.588749e-02 -1.204053e-01 [6] -3.643627e-01 -1.025147e-01 9.328866e-02 -1.873503e-01 -1.674346e-01 [11] 1.407633e-02 -1.122786e-01 -1.592800e-01 -4.802707e-02 3.103102e-02 [16] -1.019909e-01 -1.212137e-01 -2.010574e-01 8.822367e-02 -1.775306e-01 [21] -4.288166e-05 -1.354218e-01 -2.465348e-02 -1.232756e-01 9.613317e-02 [26] 1.109326e-02 -1.028953e-01 3.055730e-02 -3.779158e-02 -2.354843e-02 [31] -2.038916e-02 -2.092351e-02 -4.658370e-02 -9.226287e-02 7.311237e-02 [36] -1.277225e-02 -3.852145e-02 -1.042220e-01 1.687441e-02 -2.693262e-02 [41] 1.545238e-02 -8.135156e-02 5.700159e-03 -9.037249e-02 6.862806e-02 [46] -4.983457e-02 -6.194888e-02 1.254536e-02 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/4msxw1292429945.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/html/rcomp/tmp/57se21292429945.tab") > > try(system("convert tmp/1pii51292429945.ps tmp/1pii51292429945.png",intern=TRUE)) character(0) > try(system("convert tmp/209h81292429945.ps tmp/209h81292429945.png",intern=TRUE)) character(0) > try(system("convert tmp/309h81292429945.ps tmp/309h81292429945.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.720 0.477 1.970