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(117541.78,116587,116809,122819.55,116955,117186,117265,117536,117781,117928,120437.52,121753.21,119369.88,118622,118885,124998.3,119369,119647,119879,120075,120295,120538,123250.68,124631.03,122443.31,121532,121844,128241.75,122391,122644,122927,122909,123417,123756,126540.18,128088.74,125874.28,124817,124961,131499.9,125639,125851,125970,126322,126540,126733,129557.34,131179.77,128754.8,127890,127996,134790.6,128585,128851,129142,129334,129536,129944,132842.76,134447.96,132088.81,130902,131374,138243,131885,131839,132002,132005,132127,132116,134993.94,136459.55) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > 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/10r4s1322745732.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/2bwu01322745732.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/3cnk81322745732.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.382705262 -0.153271932 -0.091997459 0.207433901 [6] 0.074787041 -0.309465871 0.087838595 0.219925692 -0.109973609 [11] -0.139904522 -0.321798306 0.826212472 -0.314651436 -0.120782184 [16] -0.071496770 0.165503685 0.061052635 -0.254356593 0.076336750 [21] 0.174472191 -0.086029417 -0.113177659 -0.259232713 0.658584686 [26] -0.248317888 -0.096782275 -0.048124985 0.120091444 0.047663816 [31] -0.195983432 0.057691766 0.134510274 -0.061926260 -0.087413952 [36] -0.198999925 0.492217473 -0.183318647 -0.068381712 -0.032244419 [41] 0.086041808 0.031329243 -0.143498191 0.042703464 0.099865346 [46] -0.046847788 -0.058277751 -0.133149628 0.324878173 -0.122377390 [51] -0.043419321 -0.007825131 0.043565063 0.014388538 -0.085398154 [56] 0.029352710 0.055823461 -0.024157298 -0.034055697 -0.066479637 [61] 0.158165449 > (mypacf <- c(rpacf$acf)) [1] -0.382705262 -0.351168562 -0.408468355 -0.153754401 0.046204233 [6] -0.281725215 -0.199922731 0.079746744 -0.070728228 -0.139972019 [11] -0.747815740 0.274597405 0.049858870 0.117914279 0.112513147 [16] -0.013414119 -0.061035414 0.101583874 0.067654768 -0.120455678 [21] -0.048329555 -0.046261083 0.039195191 0.022344643 0.040653338 [26] -0.031180392 0.033896919 0.026731674 -0.008826919 0.012603392 [31] -0.032412342 -0.033614984 -0.001022490 0.021910028 0.058639624 [36] -0.050924366 -0.038536226 -0.016592847 -0.002640020 0.022935877 [41] -0.007294800 -0.028171757 -0.007969052 0.030996894 -0.001276284 [46] 0.017597474 0.096087511 -0.055475430 -0.014810170 -0.008986607 [51] 0.027761310 -0.010902063 -0.014395217 -0.009234506 0.009662716 [56] 0.001503392 0.025247485 0.002977547 0.072118566 -0.067046304 > 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/4c3561322745732.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/5p8em1322745732.tab") > > try(system("convert tmp/10r4s1322745732.ps tmp/10r4s1322745732.png",intern=TRUE)) character(0) > try(system("convert tmp/2bwu01322745732.ps tmp/2bwu01322745732.png",intern=TRUE)) character(0) > try(system("convert tmp/3cnk81322745732.ps tmp/3cnk81322745732.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.008 0.159 1.182