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.3,6.2,6.3,6.5,6.6,6.4,6.2,6.3,6.6,7.1,7.2,7.3,7.3,7.3,7.4,7.3,7.4,7.4,7.6,7.6,7.7,7.7,7.8,7.8,8,8.1,8.1,8.2,8.1,8.1,8.1,8.1,8.2,8.4,8.4,8.5,8.6,8.5,8.3,7.8,7.8,8,8.6,8.9,8.9,8.6,8.3,8.3,8.3,8.4,8.5,8.4,8.6,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.6,8.6,8.6,8.6,8.4,8.1,7.9,7.9,8,8,7.9,7.9,7.9,7.9,8,7.9,7.5,7.2,7,6.9,7.1,7.1,7.2,7.1,6.9,6.8,6.8,6.7,6.9,7.3,7.4,7.3,7.1,7,7.1,7.5,7.7,7.8,7.7,7.7,7.8,8,8.1,8.1,8,8.1,8.2,8.3,8.4,8.5,8.5,8.5,8.5,8.5,8.3,8.2,8.1,7.9,7.6) > 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/1w7aa1321964672.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/2sd5u1321964672.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/3wybo1321964672.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.00000000 0.94731980 0.86383011 0.78246902 0.72877971 0.69669174 [7] 0.66081959 0.60637345 0.53945529 0.47239523 0.41411760 0.35773207 [13] 0.30172495 0.24608049 0.19250155 0.13986866 0.08288396 0.02837475 [19] -0.02539340 -0.07197161 -0.11629508 -0.16098121 -0.20546235 -0.24559170 [25] -0.27837344 -0.29794209 -0.30937477 -0.32381902 -0.33972964 -0.35791077 [31] -0.36816089 -0.36636472 -0.36251879 -0.36185787 -0.36854456 -0.38183780 [37] -0.38146069 -0.35967146 -0.32902095 -0.30956529 -0.32049341 -0.34578564 [43] -0.37044716 -0.37093727 -0.35258533 -0.32267589 -0.29699211 -0.28119449 [49] -0.27220838 > (mypacf <- c(rpacf$acf)) [1] 0.947319805 -0.327383535 0.069624901 0.213925181 0.040554942 [6] -0.143314910 -0.116876367 -0.012410104 -0.022643111 -0.040519130 [11] -0.111629829 -0.010711278 0.009450777 -0.028610967 -0.070926186 [16] -0.094739071 0.037275424 -0.060239762 -0.010375882 -0.076942383 [21] -0.037584389 -0.010450346 -0.005379698 -0.019068163 0.055635716 [26] 0.019033607 -0.087517748 0.017906966 -0.041571666 0.037346859 [31] 0.023113906 -0.093740123 -0.030342220 -0.044869153 -0.073855328 [36] 0.100487789 0.106474949 -0.065715556 -0.122035834 -0.219801751 [41] -0.001646471 -0.064245362 0.052788192 -0.012368999 0.083471169 [46] 0.020152261 -0.034384718 -0.042555281 > 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/4gr6e1321964672.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/5aiv61321964672.tab") > > try(system("convert tmp/1w7aa1321964672.ps tmp/1w7aa1321964672.png",intern=TRUE)) character(0) > try(system("convert tmp/2sd5u1321964672.ps tmp/2sd5u1321964672.png",intern=TRUE)) character(0) > try(system("convert tmp/3wybo1321964672.ps tmp/3wybo1321964672.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.924 0.188 1.115