R version 2.12.2 (2011-02-25) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64-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(106.42,106.22,106.32,105.81,105.92,107.54,107.34,107.24,107.74,105.71,105.41,106.22,106.32,106.12,106.22,105.92,105.71,105.71,105.92,105.71,105.41,104.49,101.35,99.72,99.01,97.89,95.86,94.95,95.35,95.15,95.46,95.56,95.05,94.64,93.63,93.12,93.53,97.18,96.27,95.15,97.08,101.95,103.07,103.68,102.87,102.56,103.38,103.27,102.89,102.69,101.54,102.9,101.53,101.96,101.99,101.11,101.75,101.71,104.11,103.57,103.32,103.64,103.68,103.79,103.01,101.54,101.9,103.68,104.62,104.11,105.04,104.83,105.05,104.68,107.32,109.9,109.77,110.69,110.54,110.89,110.95,109.73,110.85,110.39,110.58,110.4,111.07,110.86,111.38,111.44,110.36,110.06,108.34,107.94,107.39,107.1,107.61,107.74,106.9,106.71,106.6,108.21,110.54,110.91,109.51,110.27,111.39,112.13,111.64) > 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/www/wessaorg/rcomp/tmp/1jw5x1301847090.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/www/wessaorg/rcomp/tmp/29xve1301847090.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/www/wessaorg/rcomp/tmp/32do31301847090.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.00000000 0.96426846 0.91568889 0.87050171 0.82788348 0.77941001 [7] 0.71703081 0.65612469 0.60221758 0.55529694 0.51051477 0.46549785 [13] 0.42200117 0.37635330 0.33203836 0.29045042 0.26009084 0.22755370 [19] 0.18811964 0.15657207 0.12886558 0.10781229 0.08544611 0.06865979 [25] 0.05745988 0.05040841 0.04602096 0.03313224 0.02006215 0.00367661 [31] -0.01506510 -0.03705029 -0.06155922 -0.08128811 -0.10818916 -0.12956258 [37] -0.14765290 -0.16427403 -0.18396074 -0.20823241 -0.23123063 -0.25634287 [43] -0.27931293 -0.29693560 -0.31658070 -0.33790772 -0.36150456 -0.38441232 [49] -0.40602968 > (mypacf <- c(rpacf$acf)) [1] 0.964268458 -0.201246750 0.057805924 -0.010651769 -0.116243270 [6] -0.199546643 0.045549142 0.024792901 0.042831390 0.009018143 [11] -0.002611546 -0.032619525 -0.105701793 -0.022209032 -0.002104745 [16] 0.141899980 -0.103957751 -0.074241849 0.114526390 -0.067130029 [21] 0.017456292 -0.017215192 0.124486876 -0.016929915 0.025689443 [26] -0.006701984 -0.145618542 -0.018351019 -0.098410347 -0.015400845 [31] -0.029410870 -0.002296021 0.029541470 -0.113121043 0.092658692 [36] -0.047381720 -0.010717906 -0.087842571 -0.019893304 -0.058725262 [41] -0.068956903 -0.010823106 0.108348797 -0.064256773 -0.079411037 [46] -0.029203990 -0.085846636 -0.030680851 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/wessaorg/rcomp/tmp/4pf991301847090.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/www/wessaorg/rcomp/tmp/5gxfz1301847090.tab") > > try(system("convert tmp/1jw5x1301847090.ps tmp/1jw5x1301847090.png",intern=TRUE)) character(0) > try(system("convert tmp/29xve1301847090.ps tmp/29xve1301847090.png",intern=TRUE)) character(0) > try(system("convert tmp/32do31301847090.ps tmp/32do31301847090.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.920 0.100 1.073