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(236.77,239.23,240.23,240.33,240.33,240.34,240.34,240.27,240.29,240.29,240.29,240.29,240.31,239.95,242.33,242.11,241.53,241.53,241.53,241.41,241.41,241.66,241.8,241.99,246.24,247.57,247.84,248.27,248.3,248.31,248.31,248.38,248.37,248.41,248.68,248.75,248.75,247.95,248.13,247.86,246.23,245.98,245.98,246.27,246.31,246.3,246.67,246.78,246.78,247.91,247.99,248.6,248.68,248.75,248.75,249.03,249.05,249.57,249.35,249.46,249.46,250.82,254.19,255.18,256.68,256.73,256.73,257.39,257.78,258.67,258.71,258.91,258.91,261.38,262.42,262.77,263.24,262.83,262.83,263.09,263.6,265.68,266.08,266.28) > 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/18lum1321968412.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/2kj2p1321968412.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/32r1a1321968412.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.246030437 0.057683894 0.008966080 -0.085786273 [6] -0.006488126 -0.019510308 0.029242972 -0.045357941 -0.090774970 [11] 0.135025715 0.097728232 0.078737883 0.054663674 -0.066716948 [16] -0.175300028 -0.192080330 -0.061535363 -0.001502640 0.068034750 [21] -0.007659951 -0.088494945 -0.040529682 0.066584657 0.070217721 [26] 0.022610513 -0.071251471 -0.017040842 -0.041971417 -0.046020697 [31] -0.018189385 -0.032405306 -0.012713163 -0.082385685 -0.102356206 [36] 0.012069367 -0.084514785 0.142685357 0.177260571 -0.028933820 [41] 0.022853397 -0.102726512 -0.069296495 -0.016781232 -0.087157845 [46] -0.032746642 -0.104015128 -0.012785690 0.113239841 > (mypacf <- c(rpacf$acf)) [1] 0.246030437 -0.003030523 -0.004814808 -0.092297560 0.039006994 [6] -0.023657469 0.042852617 -0.075977035 -0.064692536 0.186031014 [11] 0.037149412 0.028156802 0.006025489 -0.066118735 -0.153679552 [16] -0.107021001 0.004138537 0.019304030 0.096461986 -0.080734390 [21] -0.095419984 -0.010238332 0.081754313 0.008201074 0.008732112 [26] -0.038993725 0.075438571 -0.006466514 -0.091007154 -0.075684947 [31] -0.024431491 0.018025604 -0.091907929 -0.082648288 0.050083745 [36] -0.115547493 0.167392374 0.124096427 -0.065678923 0.063743676 [41] -0.114470337 -0.085847375 0.034818939 -0.063187915 -0.049626554 [46] -0.050826205 -0.015348557 0.049944804 > 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/40me21321968412.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/5tu471321968412.tab") > > try(system("convert tmp/18lum1321968412.ps tmp/18lum1321968412.png",intern=TRUE)) character(0) > try(system("convert tmp/2kj2p1321968412.ps tmp/2kj2p1321968412.png",intern=TRUE)) character(0) > try(system("convert tmp/32r1a1321968412.ps tmp/32r1a1321968412.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.993 0.228 1.232