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.94,6.98,7.05,7.07,7.08,7.1,7.12,7.13,7.18,7.2,7.21,7.22,7.26,7.29,7.32,7.36,7.41,7.48,7.48,7.51,7.51,7.51,7.51,7.54,7.58,7.64,7.63,7.71,7.77,7.85,7.88,7.89,7.94,8.02,8.08,8.15,8.17,8.17,8.25,8.33,8.41,8.43,8.48,8.52,8.56,8.63,8.7,8.72,8.73,8.82,8.83,8.81,8.82,8.83,8.84,8.83,8.82,8.87,8.87,8.87) > 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/12ys61333212262.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/2x2kf1333212262.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/3siu01333212262.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.96059455 0.91978069 0.87918724 0.83865538 0.79523853 [7] 0.74941983 0.70203903 0.65290403 0.60365235 0.55225869 0.49902312 [13] 0.44673455 0.39419302 0.34145687 0.29040820 0.24126303 0.19355784 [19] 0.14814725 0.10298817 0.05806504 0.01465902 -0.02743321 -0.06821564 [25] -0.10921515 -0.14925636 -0.18579390 -0.22186611 -0.25308238 -0.28122808 [31] -0.30691677 -0.33163268 -0.35397757 -0.37336896 -0.38770507 -0.40087989 [37] -0.40960469 -0.41674421 -0.42366266 -0.42816324 -0.42990309 -0.42904964 [43] -0.42689325 -0.42316239 -0.41564625 -0.40514871 -0.39069406 -0.37250882 [49] -0.35268971 > (mypacf <- c(rpacf$acf)) [1] 0.960594549 -0.038328626 -0.018089991 -0.020907117 -0.059487513 [6] -0.054213717 -0.045984016 -0.050783652 -0.030023528 -0.057421102 [11] -0.055181661 -0.020961390 -0.039351735 -0.038231916 -0.013937707 [16] -0.013874040 -0.019267443 -0.008262412 -0.037074336 -0.038178242 [21] -0.024959055 -0.030639206 -0.028887348 -0.050086703 -0.038186267 [26] -0.004586837 -0.045371285 0.014580863 -0.005202188 -0.014416254 [31] -0.031721655 -0.016047779 -0.009881004 0.020604165 -0.030821262 [36] 0.016558683 -0.020543628 -0.042912957 -0.010906803 -0.006169032 [41] -0.007255012 -0.016909467 -0.013298965 0.016970706 0.010467832 [46] 0.024252583 0.029994978 0.004980030 > 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/42hgd1333212262.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/5w4ur1333212262.tab") > > try(system("convert tmp/12ys61333212262.ps tmp/12ys61333212262.png",intern=TRUE)) character(0) > try(system("convert tmp/2x2kf1333212262.ps tmp/2x2kf1333212262.png",intern=TRUE)) character(0) > try(system("convert tmp/3siu01333212262.ps tmp/3siu01333212262.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.957 0.229 1.188