R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-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(561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502,516,528,533,536,537,524,536,587,597,581,564,558,575,580,575,563,552,537,545,601,604,586,564,549,551,556,548,540,531,521,519,572,581,563,548,539,541,562,559,546,536,528,530,582,599,584,571,563,565,578,572,565,561,551,553,611,622,613,599,591,596) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > 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/1t5u61419934935.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/2aiyl1419934935.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/3uxka1419934935.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.809504374 0.536089415 0.392854484 0.372430598 [6] 0.429697027 0.450123571 0.360501038 0.221920398 0.143933383 [11] 0.186508280 0.352375255 0.438718141 0.252239335 0.001775424 [16] -0.132560430 -0.149072067 -0.094381875 -0.064086242 -0.118764154 [21] -0.215717604 -0.257353295 -0.186684499 -0.010408426 0.111111649 [26] 0.015045388 -0.144110005 -0.210034010 -0.180262074 -0.099056184 [31] -0.041106691 -0.040747934 -0.081600590 -0.078891891 0.007278660 [36] 0.171477502 0.286341359 0.212992323 0.079165108 0.012287824 [41] 0.011632651 0.054105067 0.081838267 0.066740444 0.016605558 [46] -0.012088301 0.010608293 0.088488375 0.139931397 > (mypacf <- c(rpacf$acf)) [1] 8.095044e-01 -3.458282e-01 2.924743e-01 8.702826e-02 2.265184e-01 [6] -6.473510e-02 -1.147736e-01 -6.056412e-02 5.692262e-02 1.613356e-01 [11] 3.317330e-01 -1.790670e-01 -5.476456e-01 4.648413e-03 -3.156475e-02 [16] -4.614386e-02 -8.377319e-02 4.399056e-03 7.933586e-02 4.228394e-02 [21] 6.587502e-02 1.470094e-02 6.281362e-02 1.461994e-01 -6.144837e-02 [26] 1.477344e-02 -4.268675e-03 -9.633172e-03 -4.649002e-02 -3.641916e-02 [31] 1.086751e-01 1.216708e-05 8.480784e-02 -3.448025e-02 3.465349e-02 [36] 1.874672e-02 -6.372110e-02 7.406078e-04 -7.603602e-02 -6.283148e-02 [41] 3.072940e-02 -4.230101e-02 2.001184e-02 -2.032026e-02 -3.596956e-02 [46] -8.801859e-02 -8.541288e-02 3.723790e-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/4zb1e1419934935.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/5jpbx1419934935.tab") > > try(system("convert tmp/1t5u61419934935.ps tmp/1t5u61419934935.png",intern=TRUE)) character(0) > try(system("convert tmp/2aiyl1419934935.ps tmp/2aiyl1419934935.png",intern=TRUE)) character(0) > try(system("convert tmp/3uxka1419934935.ps tmp/3uxka1419934935.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.412 0.275 1.692