R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(0.62,0.7,1.65,1.79,2.28,2.46,2.57,2.32,2.91,3.01,2.87,3.11,3.22,3.38,3.52,3.41,3.35,3.68,3.75,3.6,3.56,3.57,3.85,3.48,3.65,3.66,3.36,3.19,2.81,2.25,2.32,2.85,2.75,2.78,2.26,2.23,1.46,1.19,1.11,1,1.18,1.59,1.51,1.01,0.9,0.63,0.81,0.97,1.14,0.97,0.89,0.62,0.36,0.27,0.34,0.02,-0.12,0.09,-0.11,-0.38) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > 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/1p70i1445540034.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/2jh101445540034.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/38p0m1445540034.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 1.739064e-01 1.167840e-01 4.241638e-02 7.201075e-03 [6] -1.112833e-01 2.088045e-01 2.157158e-01 1.378288e-01 2.868508e-01 [11] 1.011663e-01 -2.952522e-05 -2.384376e-01 9.535000e-02 3.782251e-03 [16] 3.975300e-02 1.997699e-01 3.076554e-02 -9.045842e-02 -1.278315e-02 [21] 4.347679e-03 -1.932843e-01 7.239242e-02 4.257207e-02 -9.209018e-02 [26] -1.395869e-01 -6.929972e-02 -3.125368e-02 -1.241693e-01 1.320884e-01 [31] -2.216818e-02 -9.006480e-02 -1.406361e-01 -3.142732e-03 -2.377786e-01 [36] -8.965167e-02 4.153563e-02 -2.260950e-02 1.946485e-03 2.724823e-02 [41] -1.388636e-02 -1.685240e-01 -3.981947e-02 -4.894370e-02 1.655202e-02 [46] 1.620786e-02 1.991009e-02 -1.282482e-01 -5.164467e-02 > (mypacf <- c(rpacf$acf)) [1] 1.739064e-01 8.923947e-02 8.731487e-03 -1.170815e-02 -1.199676e-01 [6] 2.580940e-01 1.817776e-01 4.084736e-02 2.365571e-01 -1.502525e-02 [11] -1.144302e-03 -2.982587e-01 1.329036e-01 2.864029e-02 -1.206207e-01 [16] 1.440893e-01 -1.954382e-01 -1.067633e-02 2.628203e-02 -7.181012e-03 [21] -8.507258e-03 -2.146718e-02 4.394364e-02 -2.200399e-01 -1.152386e-01 [26] -1.859753e-02 1.138239e-01 -7.977052e-06 7.341279e-02 -1.940984e-03 [31] -7.691399e-02 -8.533462e-02 5.589819e-02 -2.588404e-02 -6.599373e-02 [36] -2.452909e-02 -1.430341e-02 -3.311194e-02 7.585856e-02 1.126719e-01 [41] 4.987032e-02 -8.941392e-02 -1.507122e-02 7.381131e-02 -6.041563e-02 [46] -1.204526e-01 -1.228967e-01 8.174171e-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/4grh61445540034.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/5l6gi1445540034.tab") > > try(system("convert tmp/1p70i1445540034.ps tmp/1p70i1445540034.png",intern=TRUE)) character(0) > try(system("convert tmp/2jh101445540034.ps tmp/2jh101445540034.png",intern=TRUE)) character(0) > try(system("convert tmp/38p0m1445540034.ps tmp/38p0m1445540034.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.219 0.246 1.468