R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" 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(662,670,659,663,673,699,712,700,692,699,700,702,693,696,696,694,695,715,731,715,707,712,699,703,695,694,691,694,699,720,732,712,705,707,700,687,674,676,666,669,669,688,705,684,679,689,691,685,690,685,688,696,693,721,726,704,700,707,696,687) > 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) > 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/1ac8y1476792347.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/2c0fg1476792347.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/3bdd91476792347.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.107365213 -0.300821742 -0.009655209 0.057910158 [6] -0.067562008 -0.167467370 -0.116095090 0.013595048 -0.010169247 [11] -0.268747278 0.120745410 0.625547417 0.043422288 -0.229572904 [16] -0.087087711 0.054698299 -0.128405220 -0.155658440 -0.054853897 [21] 0.012720792 -0.031114726 -0.150734727 0.154303604 0.481144803 [26] 0.046472782 -0.238634597 -0.039946715 0.075142144 -0.103994675 [31] -0.109083782 -0.083199066 -0.019537474 -0.005382724 -0.110907189 [36] 0.070997961 0.312585403 0.018372326 -0.161887847 -0.020227690 [41] 0.050234625 -0.025793624 -0.044933986 -0.004590158 0.019078146 [46] -0.007706620 -0.052579260 0.084589809 0.140847050 > (mypacf <- c(rpacf$acf)) [1] 1.073652e-01 -3.159916e-01 7.504713e-02 -5.289676e-02 -5.642934e-02 [6] -1.625704e-01 -1.283653e-01 -5.897238e-02 -9.243876e-02 -3.320640e-01 [11] 1.620954e-01 4.872082e-01 -4.932737e-02 3.024016e-02 -1.846606e-01 [16] -2.440957e-02 -2.570732e-01 3.172370e-03 9.970279e-03 -1.248912e-02 [21] -3.357674e-02 5.551432e-02 -1.558341e-02 1.292270e-01 -5.154950e-02 [26] -5.903006e-02 1.628492e-02 -2.836601e-02 7.699974e-02 7.646704e-03 [31] -6.389932e-02 -7.912965e-02 -7.030209e-03 -8.062957e-02 -1.194126e-01 [36] -1.079050e-01 -2.313675e-02 3.015188e-02 1.474568e-02 2.700509e-02 [41] 6.574862e-02 1.448250e-02 1.101454e-01 3.738752e-02 7.081970e-03 [46] 2.742891e-05 2.294397e-02 -1.531667e-01 > 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/4dydu1476792347.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/5w4mh1476792347.tab") > > try(system("convert tmp/1ac8y1476792347.ps tmp/1ac8y1476792347.png",intern=TRUE)) character(0) > try(system("convert tmp/2c0fg1476792347.ps tmp/2c0fg1476792347.png",intern=TRUE)) character(0) > try(system("convert tmp/3bdd91476792347.ps tmp/3bdd91476792347.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.192 0.089 1.302