R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-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(55.7,59.2,59.8,61.6,65.8,64.2,67,62.8,65.5,75.2,80.9,83.2,83.7,86.4,85.9,80.4,81.8,87.5,83.7,87,99.7,101.4,101.9,115.7,123.2,136.9,146.8,149.6,146.5,157,147.9,133.6,128.7,100.8,91.8,89.3,96.7,91.6,93.3,93.3,101,100.4,86.9,83.9,80.3,87.7,92.7,95.5,92,87.4,86.8,83.7,85,81.7,90.9,101.5,113.8,120.1,122.1,132.5,140,149.4,144.3,154.4,151.4,145.5,136.8,146.6,145.1,133.6,131.4,127.5,130.1,131.1,132.3,128.6,125.1,128.7,156.1,163.2,159.8,157.4,156.2,152.5) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/fisher/rcomp/tmp/1sug01387020640.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/fisher/rcomp/tmp/2qs1c1387020640.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/fisher/rcomp/tmp/3rovv1387020640.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.314581304 0.128105936 0.074856432 0.071531333 [6] -0.049853778 -0.044161164 -0.100330227 -0.235859668 -0.059982855 [11] -0.160203234 0.060109365 -0.136777922 -0.194654440 -0.114886289 [16] 0.062142166 0.065783258 0.012626649 0.081482200 0.015639568 [21] 0.050009258 -0.068858723 -0.086489836 -0.059021494 -0.160943691 [26] -0.158039695 -0.138625931 -0.017573152 -0.091633943 -0.071101765 [31] -0.080818079 0.117002448 0.154572102 0.085120544 0.095404638 [36] 0.103176521 0.067894783 0.063951873 0.174855510 0.017460928 [41] -0.026004663 -0.037793201 0.015294853 -0.007753017 -0.073129121 [46] -0.220265908 -0.097029103 -0.043282554 -0.045974957 > (mypacf <- c(rpacf$acf)) [1] 0.314581304 0.032345495 0.028535766 0.040924518 -0.098140345 [6] -0.011436077 -0.086056979 -0.199940048 0.100735139 -0.164810478 [11] 0.206949897 -0.231857217 -0.151100242 0.029166738 0.050831721 [16] 0.065927649 -0.038279102 0.001105510 0.038038353 -0.110193262 [21] -0.088376237 -0.149228049 0.078260806 -0.153611577 -0.083338306 [26] -0.136169353 0.039427033 -0.038855897 -0.126526361 -0.111040272 [31] 0.200954123 0.028843672 -0.022226901 -0.182116725 0.100979185 [36] -0.053128874 0.042005843 -0.030260880 -0.006893926 0.036332182 [41] -0.001762995 -0.132100682 0.032931631 -0.037635505 -0.107578001 [46] -0.072469477 -0.069844016 0.027210478 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/4diq51387020640.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/fisher/rcomp/tmp/55ibk1387020640.tab") > > try(system("convert tmp/1sug01387020640.ps tmp/1sug01387020640.png",intern=TRUE)) character(0) > try(system("convert tmp/2qs1c1387020640.ps tmp/2qs1c1387020640.png",intern=TRUE)) character(0) > try(system("convert tmp/3rovv1387020640.ps tmp/3rovv1387020640.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.075 0.789 3.852