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(101.15,101.14,101.23,101.11,101.55,101.55,101.55,101.6,101.71,101.81,101.95,102.12,102.11,102.25,102.35,102.42,102.34,102.32,102.39,102.45,102.68,102.77,102.83,102.83,103.21,103.58,102.5,102.68,102.7,102.7,102.73,102.72,102.71,102.91,103.1,103.1,103.39,103.38,103.34,103.33,103.33,103.33,103.48,104.38,105.76,107.37,108.16,111.21,112.77,114.39,114.37,114.52,114.54,114.78,114.83,115.86,117,117.27,117.38,117.83) > 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/1qckr1333022416.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/2vypv1333022416.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/3e8dg1333022416.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.000000e+00 9.414585e-01 8.767877e-01 8.043738e-01 7.274614e-01 [6] 6.545425e-01 5.862469e-01 5.156503e-01 4.443341e-01 3.697834e-01 [11] 2.928861e-01 2.131465e-01 1.420945e-01 7.926716e-02 3.729303e-02 [16] -6.545464e-05 -2.624965e-02 -4.299860e-02 -5.288733e-02 -6.100630e-02 [21] -6.878046e-02 -7.681717e-02 -8.375348e-02 -9.098468e-02 -9.898396e-02 [26] -1.049352e-01 -1.107980e-01 -1.186386e-01 -1.250601e-01 -1.320699e-01 [31] -1.391934e-01 -1.458636e-01 -1.530702e-01 -1.608680e-01 -1.671247e-01 [36] -1.818376e-01 -1.947104e-01 -2.049641e-01 -2.159792e-01 -2.273769e-01 [41] -2.388443e-01 -2.492562e-01 -2.598798e-01 -2.699976e-01 -2.788841e-01 [46] -2.851895e-01 -2.875493e-01 -2.873084e-01 -2.784464e-01 > (mypacf <- c(rpacf$acf)) [1] 9.414585e-01 -8.408207e-02 -1.004147e-01 -7.434225e-02 -1.730515e-03 [6] -1.277298e-03 -7.067210e-02 -5.927379e-02 -7.688482e-02 -6.786835e-02 [11] -8.028980e-02 1.731033e-02 9.714331e-03 1.173642e-01 -3.161479e-02 [16] 3.547735e-02 3.904105e-02 3.051952e-02 -1.869953e-02 -4.266756e-02 [21] -3.553999e-02 -3.192739e-02 -4.252267e-02 -5.373980e-02 6.013766e-05 [26] -2.106844e-02 -1.960867e-02 -1.951960e-03 8.826645e-03 8.306454e-03 [31] 2.210559e-03 -1.735041e-02 -1.949064e-02 -5.202524e-03 -1.076495e-01 [36] -1.884840e-02 -1.013081e-02 -3.342445e-02 -4.833720e-02 -4.014944e-02 [41] -4.703421e-03 -2.128364e-02 -1.830183e-02 -1.330974e-02 7.209536e-03 [46] 2.087549e-03 -9.152176e-03 2.982168e-02 > 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/4fiya1333022416.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/5l93p1333022416.tab") > > try(system("convert tmp/1qckr1333022416.ps tmp/1qckr1333022416.png",intern=TRUE)) character(0) > try(system("convert tmp/2vypv1333022416.ps tmp/2vypv1333022416.png",intern=TRUE)) character(0) > try(system("convert tmp/3e8dg1333022416.ps tmp/3e8dg1333022416.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.950 0.226 1.169