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 = '1' > par3 = '0' > 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/1hcti1322745961.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/2fvu51322745961.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/3xdji1322745961.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.79409885 0.65447127 0.51024247 0.39083396 0.28233135 [7] 0.20368850 0.13052274 0.10973540 0.05162085 0.01218499 -0.02621691 [13] -0.06051437 -0.04468838 -0.04886854 -0.06430018 -0.04403095 -0.05633602 [19] -0.09235238 -0.08373313 -0.15774137 -0.14001358 -0.14740660 -0.13214989 [25] -0.12379631 -0.10827422 -0.12751490 -0.13211724 -0.15174651 -0.13599765 [31] -0.14662241 -0.18037061 -0.15955697 -0.15432994 -0.19325532 -0.18643607 [37] -0.16061613 -0.17206544 -0.15165207 -0.15387109 -0.12318252 -0.16819126 [43] -0.20089504 -0.20597008 -0.20900263 -0.19741399 -0.17291525 -0.14626174 [49] -0.09492723 -0.03889671 -0.01964515 0.02789467 0.09198021 0.15358990 [55] 0.20371887 0.23477250 0.24692559 0.23818426 0.17284406 0.10423636 > (mypacf <- c(rpacf$acf)) [1] 0.794098847 0.064639505 -0.073963443 -0.027670264 -0.040747212 [6] 0.004285878 -0.033405279 0.080581094 -0.097807959 -0.025850156 [11] -0.022937574 -0.034713070 0.106140070 -0.039409048 -0.051630214 [16] 0.057060015 -0.061992591 -0.099426746 0.078488937 -0.204254791 [21] 0.126281826 -0.034210898 0.018927850 -0.019795732 -0.005847893 [26] -0.076856213 -0.055733699 0.026833653 -0.003641858 -0.067269650 [31] -0.099396163 0.060952377 -0.023385397 -0.132108181 0.028642080 [36] 0.092389170 -0.146435273 -0.005468087 0.020540063 -0.035525913 [41] -0.193547799 -0.075680617 0.076633043 -0.068676679 0.015737196 [46] -0.059139286 0.073812762 -0.008314040 0.017883497 -0.009830287 [51] 0.040194881 0.086622796 0.050348300 -0.007962891 0.016307813 [56] 0.034988061 -0.109931484 -0.108019832 -0.095525183 > 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/4km451322745961.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/53sh91322745961.tab") > > try(system("convert tmp/1hcti1322745961.ps tmp/1hcti1322745961.png",intern=TRUE)) character(0) > try(system("convert tmp/2fvu51322745961.ps tmp/2fvu51322745961.png",intern=TRUE)) character(0) > try(system("convert tmp/3xdji1322745961.ps tmp/3xdji1322745961.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.023 0.184 1.217