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(78.7,75.7,77.1,86.1,86.8,86.3,91.5,90.7,78.2,73,73.7,77.3,67.5,72.7,76.6,82.4,82.3,86.3,93,88.8,96.9,103.9,115.7,112.8,114.7,118,129.3,137,156,166.2,167.8,144.3,126,90.4,67.5,52.4,54.6,52.9,59.1,63.3,73.8,87.6,81.8,90.7,86.3,93.6,98,94.3,97.6,94.2,100.2,106.7,95.7,94.6,94.7,96.2,96.3,103.3,106.8,113.7,117.4,123.6,137.6,147.4,137.2,133.8,136.7,127.3,128.7,127,133.7,132,135.1,142.6,149.3,143.5,131.4,114.7,122.3,133.4,134.6,130.9,127.9,128) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > 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/wessaorg/rcomp/tmp/1uv7v1385365213.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/23qoc1385365213.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/305tk1385365213.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.000000e+00 4.699561e-01 2.700208e-01 5.354259e-03 -5.701135e-02 [6] -2.175245e-01 -2.723029e-01 -2.093325e-01 -1.323208e-01 -1.543506e-01 [11] -8.038080e-02 -2.391971e-03 -1.082647e-02 -7.200747e-02 -1.056222e-01 [16] -1.751568e-02 -4.049700e-02 -9.373706e-03 -3.045614e-02 3.946885e-02 [21] -2.675381e-02 7.520247e-02 8.506253e-02 1.383790e-01 -7.292022e-03 [26] 7.491619e-02 -1.037134e-01 -1.191023e-01 -1.383244e-01 -1.112270e-01 [31] -5.494395e-02 -6.248624e-02 3.065519e-02 1.562361e-01 1.257880e-01 [36] 5.258216e-02 -1.700333e-02 -3.467282e-02 -3.386964e-02 -9.323685e-02 [41] 7.312405e-03 6.431919e-03 8.279693e-02 9.912166e-02 1.581637e-01 [46] 5.648651e-02 -1.659661e-05 -7.307253e-02 -1.561738e-02 > (mypacf <- c(rpacf$acf)) [1] 0.4699561171 0.0630977928 -0.1845137417 -0.0155980016 -0.1834151443 [6] -0.1377553673 0.0275261394 -0.0192505916 -0.1520663447 0.0046218133 [11] 0.0190195526 -0.1206176396 -0.1118318833 -0.0899083100 0.0286389877 [16] -0.0810199012 -0.0193038298 -0.0879288931 -0.0208058096 -0.1119048547 [21] 0.0955721006 -0.0004749302 -0.0038769451 -0.1384177696 0.1157734019 [26] -0.2498783070 -0.0920135947 0.0448223667 -0.1231566659 -0.0289781088 [31] -0.0555571451 -0.0233423740 0.0764335834 -0.0860527621 -0.0994078609 [36] -0.1069569667 -0.0465045390 -0.0368143607 -0.0755217193 -0.0356747978 [41] -0.0662674338 0.0269667520 0.0532562730 -0.0623295476 -0.1079817859 [46] -0.0710655589 -0.0483836369 0.0301086628 > 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/40h4y1385365213.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/5gdr21385365214.tab") > > try(system("convert tmp/1uv7v1385365213.ps tmp/1uv7v1385365213.png",intern=TRUE)) character(0) > try(system("convert tmp/23qoc1385365213.ps tmp/23qoc1385365213.png",intern=TRUE)) character(0) > try(system("convert tmp/305tk1385365213.ps tmp/305tk1385365213.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.853 0.648 3.477