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(20.98,20.1,20.61,20.27,20.08,23.58,22.31,22.89,21.78,22.19,22.58,22.78,25.06,25.16,25.47,25.34,24.2,25.32,25.57,25.76,24.79,23.14,22.66,22.06,24.26,23.15,22.92,21.43,21.56,23.48,24.35,24.83,24.19,23.58,23.58,24.35,27.18,25.69,24.81,23.26,23.49,26.86,27.12,27.66,26.26,25.51,24.63,23.57,27.63,25.85,26.09,24.47,24.19,25.09,25.26,25.58,24.76,25.02,24.24,24.14,28.69,26.74,26.48,24.45,23.88,26.58,26.23,28.63,26.81,26.56,26.64,26.8,28.37,27.13,28.44,28.62,27.28,31.32,31.26,31.41,31.76,32.72,32.15,33.62,35.97,33.78,33.77,32.75,32.55,33.22,32.88,31.56,30.27,28.65,27.89,27.07,30.8,28.38,27.5,28,28.02,29.2,27.59,27.22,27.16,26.31,25.67,26.41,28.34,25.43,23.72,23.33,23.8,27.7,26.28,27.51,27.93,28.76,28.65,29.52,31.23,27.9,27.87,27.52,27.59,31.2,30.22,30.62,31.52,30.59,31.42,31.95) > 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/17v761321358494.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/2bfjb1321358494.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/3xpdb1321358494.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.209023881 -0.026331747 -0.141279928 -0.265784737 [6] 0.339469457 -0.019464334 0.320462398 -0.226195412 -0.189835949 [11] -0.036271064 -0.181542903 0.621151377 -0.175821338 -0.102393068 [16] -0.145067202 -0.244881753 0.366356057 -0.060003026 0.297642904 [21] -0.266170392 -0.151036505 -0.077566630 -0.108620761 0.508641192 [26] -0.213226215 -0.037021687 -0.133713398 -0.265407076 0.340335705 [31] -0.029949224 0.209029284 -0.200856103 -0.174130892 0.006127669 [36] -0.114992399 0.494137130 -0.210105118 -0.038997589 -0.051585558 [41] -0.177913400 0.259717277 -0.019675224 0.179811319 -0.209028019 [46] -0.098045193 0.042231244 -0.045527521 0.425696859 > (mypacf <- c(rpacf$acf)) [1] -0.209023881 -0.073221866 -0.170831714 -0.365910524 0.193949545 [6] 0.040368744 0.337245002 -0.094280637 -0.067923387 -0.151377115 [11] -0.224465591 0.401345948 -0.049558042 -0.193142662 -0.115745750 [16] -0.023797844 0.151564036 -0.044495652 0.079460360 -0.149141515 [21] 0.080895421 -0.205490482 -0.019328578 -0.017080542 -0.146191285 [26] -0.022263944 0.030616688 -0.128341735 -0.034662797 0.064160664 [31] -0.049110998 -0.008749047 -0.081967018 -0.019525953 -0.100517240 [36] 0.029470620 -0.083373112 -0.107217495 0.100833950 0.107528650 [41] -0.064698752 -0.101802475 0.009590404 -0.109449700 0.064444897 [46] -0.042301122 0.014749180 0.034628390 > 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/4iivg1321358494.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/5s9ed1321358494.tab") > > try(system("convert tmp/17v761321358494.ps tmp/17v761321358494.png",intern=TRUE)) character(0) > try(system("convert tmp/2bfjb1321358494.ps tmp/2bfjb1321358494.png",intern=TRUE)) character(0) > try(system("convert tmp/3xpdb1321358494.ps tmp/3xpdb1321358494.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.954 0.164 1.115