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(7.08,7.08,7.09,7.07,7.06,6.99,6.99,6.99,6.98,6.96,6.95,6.91,6.91,6.87,6.91,6.89,6.88,6.9,6.91,6.85,6.86,6.82,6.8,6.83,6.84,6.89,7.14,7.21,7.25,7.31,7.3,7.48,7.49,7.4,7.44,7.42,7.14,7.24,7.33,7.61,7.66,7.69,7.7,7.68,7.71,7.71,7.72,7.68,7.72,7.74,7.76,7.9,7.97,7.96,7.95,7.97,7.93,7.99,7.96,7.92,7.97,7.98,8,8.04,8.17,8.29,8.26,8.3,8.32,8.28,8.27,8.32,8.31,8.34,8.32,8.36,8.33,8.35,8.34,8.37,8.31,8.33,8.34,8.25,8.27,8.31,8.25,8.3,8.3,8.35,8.78,8.9,8.9,8.9,9,9.05) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/10o1x1321617491.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/2kqq81321617491.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/31v0v1321617491.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.169154716 0.003539683 0.034554380 -0.060794810 [6] -0.052044555 -0.007028344 -0.143644410 0.006364584 -0.041543974 [11] -0.132261962 0.063806088 0.089492603 0.152637370 0.073663672 [16] -0.094944484 -0.103820393 -0.008522559 -0.125202167 -0.089338683 [21] -0.017991133 -0.123747261 -0.034274694 0.055657809 -0.020857000 [26] 0.180040378 0.151381912 0.017934098 -0.086907465 -0.092379847 [31] -0.004419762 -0.047120428 -0.110017593 0.050025082 -0.001879611 [36] -0.084960892 0.000747275 -0.004270478 0.068520563 0.109560096 [41] 0.036418741 -0.043899386 0.006298182 -0.076135651 -0.039426592 [46] -0.033421801 -0.032594829 -0.004773149 -0.009934190 > (mypacf <- c(rpacf$acf)) [1] 1.691547e-01 -2.581221e-02 3.946108e-02 -7.571526e-02 -2.845026e-02 [6] 3.459463e-03 -1.444236e-01 5.853811e-02 -6.788162e-02 -1.084200e-01 [11] 9.254619e-02 5.394484e-02 1.513239e-01 -2.172316e-02 -1.068704e-01 [16] -8.119758e-02 7.211155e-05 -8.463184e-02 -6.276787e-02 1.141600e-02 [21] -1.133180e-01 -1.280998e-03 6.596622e-02 -5.901942e-02 1.308767e-01 [26] 4.164744e-02 1.432565e-02 -1.369118e-01 -4.234072e-02 6.818091e-02 [31] -9.690326e-02 -2.599313e-02 9.319053e-02 -3.634408e-02 -6.441809e-02 [36] -3.856977e-02 -4.013228e-02 -5.610268e-03 3.074940e-02 5.951097e-02 [41] -1.411888e-02 1.550540e-02 -6.902638e-02 9.588108e-03 -3.134880e-02 [46] -3.240683e-02 4.665039e-03 -9.107475e-03 > 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/4b23i1321617491.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/5htfz1321617491.tab") > > try(system("convert tmp/10o1x1321617491.ps tmp/10o1x1321617491.png",intern=TRUE)) character(0) > try(system("convert tmp/2kqq81321617491.ps tmp/2kqq81321617491.png",intern=TRUE)) character(0) > try(system("convert tmp/31v0v1321617491.ps tmp/31v0v1321617491.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.038 0.196 1.231