R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 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(37729,48191,52498,57319,44377,48081,52597,53331,39587,46278,50365,57176,39251,47946,50427,54317,41210,50592,55728,59099,47519,53203,53882,55163,45255,50423,52161,54562,40971,48014,48440,44967,27218,30269,33234,36811,27745,31891,32398,34093,28358,29532,30769,32080,23951,34628,22978,35704,23090,22111,28925,35968,28963,34074,39160,51314,34527,40722,50609,52435) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '4' > 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) > x <- na.omit(x) > 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/1pui01483821523.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/2eav11483821523.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/3eyh01483821523.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.384434807 -0.051851292 -0.291812566 0.677658430 [6] -0.270877208 -0.074797628 -0.287850860 0.662862360 -0.330375560 [11] 0.042870656 -0.311395369 0.513207271 -0.208475141 -0.049679606 [16] -0.258680827 0.504104193 -0.186772969 -0.012343514 -0.282377426 [21] 0.452725289 -0.171138367 -0.069446372 -0.259881704 0.430180974 [26] -0.140973993 -0.038656668 -0.261193292 0.354562731 -0.126081112 [31] -0.031519857 -0.251918448 0.292870457 -0.100632217 0.046965583 [36] -0.234067547 0.278734070 -0.066511489 -0.011133247 -0.185891746 [41] 0.242811868 -0.048483475 0.001845742 -0.192873670 0.244312065 [46] -0.050375589 -0.052965804 -0.109675721 0.133675350 > (mypacf <- c(rpacf$acf)) [1] -0.384434807 -0.234263200 -0.504660782 0.476627282 0.144729463 [6] -0.030859336 -0.211444869 0.274957515 -0.095090160 0.156973774 [11] -0.051363219 -0.120434622 0.074737772 -0.143651480 -0.081230775 [16] 0.122082944 0.116345561 -0.027174794 0.019423414 -0.037006428 [21] -0.107061126 -0.061149966 -0.167665092 -0.012083843 0.017536294 [26] -0.006205532 -0.030263805 -0.114296960 -0.110532899 -0.018703553 [31] -0.036721270 -0.156886235 -0.100074584 0.028205156 0.018900230 [36] 0.116765113 0.107138275 -0.091332081 0.047466800 0.018417043 [41] -0.037867660 -0.016999385 -0.046767735 -0.085016697 0.004388656 [46] -0.106816091 0.048833644 -0.066564400 > 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/4ghqp1483821523.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/5v0tl1483821523.tab") > > try(system("convert tmp/1pui01483821523.ps tmp/1pui01483821523.png",intern=TRUE)) character(0) > try(system("convert tmp/2eav11483821523.ps tmp/2eav11483821523.png",intern=TRUE)) character(0) > try(system("convert tmp/3eyh01483821523.ps tmp/3eyh01483821523.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.222 0.096 1.333