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(0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.7,0.7,0.68,0.68,0.69,0.69,0.7,0.7,0.7,0.7,0.7,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.71,0.76,0.77,0.78,0.85,0.89,0.9,0.91,0.91,0.91,0.9,0.89,0.88,0.87,0.86,0.87,0.87,0.87,0.85,0.84,0.84,0.84,0.84,0.84,0.82,0.87,0.92,0.92,0.92,0.93,0.94,0.87,0.84,0.83,0.81,0.81,0.81,0.8,0.8,0.8,0.8,0.8,0.8) > 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/1kgmx1321861700.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/2nqjd1321861700.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/35vm21321861700.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.365925110 0.094139127 0.262275390 0.106939413 [6] -0.117403974 -0.230157033 -0.143967071 -0.135410446 -0.106382433 [11] -0.004034045 -0.044560156 -0.053862844 -0.005942837 -0.043735380 [16] -0.069682461 -0.043327270 -0.023411151 -0.007807995 0.060036687 [21] 0.077219238 0.211398509 0.142321796 -0.021640107 0.094193884 [26] 0.093031155 -0.131312233 -0.278022283 -0.122278196 -0.088390506 [31] -0.224287775 -0.086342255 -0.073472667 -0.061635760 0.005176240 [36] 0.009966615 -0.014887038 0.002842226 0.030837558 -0.013394056 [41] 0.012414421 0.038222898 -0.041605849 -0.024970012 -0.041744453 [46] -0.028874865 -0.037570093 -0.025793933 0.055536353 > (mypacf <- c(rpacf$acf)) [1] 0.365925110 -0.045909379 0.281213611 -0.107139626 -0.139313195 [6] -0.248531897 0.002277697 -0.038405643 0.112673549 0.061231134 [11] -0.088736872 -0.097983816 -0.066298701 -0.062779387 0.009851386 [16] 0.029709689 0.003991138 0.002646906 0.049551811 -0.009392777 [21] 0.228595417 -0.061739677 -0.118353437 0.032742290 0.026548187 [26] -0.106559626 -0.168622171 0.024778808 -0.035347743 -0.032905908 [31] 0.055499438 -0.169557994 0.010267323 -0.070347830 0.023379664 [36] -0.020775056 0.056965610 -0.089058214 -0.045607372 -0.003843395 [41] -0.041832826 -0.095282697 -0.018219896 -0.118875468 0.017145652 [46] -0.058229296 0.095765762 0.130180260 > 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/4njbe1321861700.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/5r9y81321861700.tab") > > try(system("convert tmp/1kgmx1321861700.ps tmp/1kgmx1321861700.png",intern=TRUE)) character(0) > try(system("convert tmp/2nqjd1321861700.ps tmp/2nqjd1321861700.png",intern=TRUE)) character(0) > try(system("convert tmp/35vm21321861700.ps tmp/35vm21321861700.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.954 0.185 1.133