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(6.19,6.31,6.35,6.38,6.38,6.36,6.34,6.49,6.5,6.5,6.55,6.57,6.65,6.61,6.66,6.73,6.73,6.75,6.75,6.71,6.77,6.83,6.9,6.89,7.14,7.35,7.43,7.42,7.41,7.46,7.47,7.45,7.47,7.44,7.43,7.43,7.44,7.49,7.48,7.43,7.33,7.42,7.98,7.41,7.25,7.04,6.98,6.94,6.9,6.92,6.86,6.86,6.89,6.91,6.9,6.88,6.78,6.79,6.81,6.78) > 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/1yycs1321986518.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/24hvb1321986518.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/3ab011321986518.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.919875312 0.855456661 0.796632532 0.742232480 [6] 0.683340589 0.611758609 0.540120674 0.475380664 0.413536992 [11] 0.352781629 0.288504151 0.220643468 0.152509681 0.071932215 [16] 0.003448834 -0.054504648 -0.117702545 -0.182250047 -0.258370581 [21] -0.319520200 -0.370595777 -0.410552640 -0.443419070 -0.472483607 [26] -0.482607469 -0.476145406 -0.460524611 -0.449720094 -0.438734364 [31] -0.417757243 -0.398905403 -0.376287092 -0.349353021 -0.318167360 [36] -0.288891886 -0.268686848 -0.240954000 -0.206519841 -0.171075403 [41] -0.140702380 -0.120608739 -0.095896461 -0.019004922 0.016165899 [46] 0.042689801 0.052359294 0.056988173 0.060220732 > (mypacf <- c(rpacf$acf)) [1] 0.919875312 0.060366037 0.011043925 0.003678956 -0.053050673 [6] -0.120232150 -0.062064678 -0.011126269 -0.022185306 -0.025878403 [11] -0.054962628 -0.075362312 -0.070223483 -0.152958933 -0.013213112 [16] 0.015342285 -0.076169110 -0.070072631 -0.150843977 -0.028738487 [21] -0.029038282 0.013766862 0.016116577 -0.006113928 0.069499896 [26] 0.072192596 0.056832583 -0.042265099 -0.029517977 0.040792576 [31] -0.041795094 0.001340397 -0.002287943 0.005448749 -0.031580451 [36] -0.099723451 0.002240084 -0.013305392 -0.017646369 -0.036388731 [41] -0.073413125 -0.017252285 0.320110811 -0.184147441 -0.055938848 [46] -0.095917181 -0.079653978 -0.067219052 > 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/4xcsf1321986518.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/5nvhq1321986518.tab") > > try(system("convert tmp/1yycs1321986518.ps tmp/1yycs1321986518.png",intern=TRUE)) character(0) > try(system("convert tmp/24hvb1321986518.ps tmp/24hvb1321986518.png",intern=TRUE)) character(0) > try(system("convert tmp/3ab011321986518.ps tmp/3ab011321986518.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.999 0.187 1.207