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(21571.00 + ,21493.00 + ,21422.00 + ,21272.00 + ,22747.00 + ,22676.00 + ,21571.00 + ,20831.00 + ,20909.00 + ,20909.00 + ,20980.00 + ,21130.00 + ,21051.00 + ,21643.00 + ,21864.00 + ,21643.00 + ,22455.00 + ,21935.00 + ,20759.00 + ,20467.00 + ,20467.00 + ,20610.00 + ,20026.00 + ,20467.00 + ,20097.00 + ,20467.00 + ,21051.00 + ,21272.00 + ,21792.00 + ,21571.00 + ,20246.00 + ,19726.00 + ,19506.00 + ,19726.00 + ,19363.00 + ,19506.00 + ,19064.00 + ,19805.00 + ,20168.00 + ,20246.00 + ,21643.00 + ,21643.00 + ,19805.00 + ,19363.00 + ,19363.00 + ,19584.00 + ,18622.00 + ,18180.00 + ,17668.00 + ,17817.00 + ,18480.00 + ,17960.00 + ,19363.00 + ,19584.00 + ,18180.00 + ,17668.00 + ,17375.00 + ,17668.00 + ,16855.00 + ,16563.00 + ,15388.00 + ,15680.00 + ,15751.00 + ,15830.00 + ,17226.00 + ,17076.00 + ,15388.00 + ,14647.00 + ,14355.00 + ,14725.00 + ,13322.00 + ,12367.00 + ,10601.00 + ,10750.00 + ,10750.00 + ,10601.00 + ,11854.00 + ,11926.00 + ,10451.00 + ,10159.00 + ,9568.00 + ,10380.00 + ,8905.00 + ,8022.00 + ,6333.00 + ,6697.00 + ,6255.00 + ,6404.00 + ,7509.00 + ,7730.00 + ,6996.00 + ,6917.00 + ,6917.00 + ,7879.00 + ,6184.00 + ,5079.00 + ,3163.00 + ,4709.00 + ,4488.00 + ,4566.00 + ,6333.00 + ,6112.00 + ,5300.00 + ,5671.00 + ,5671.00 + ,6996.00 + ,5450.00 + ,4566.00 + ,3163.00 + ,5008.00 + ,4859.00 + ,4930.00 + ,6476.00 + ,6333.00 + ,5813.00 + ,5892.00 + ,6255.00 + ,7067.00 + ,5813.00 + ,4787.00) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1ot9h1471279523.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/2i9x11471279523.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/3g9os1471279523.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.00000000 0.97755816 0.95635629 0.93892592 0.92222104 0.90223850 [7] 0.88172601 0.86473640 0.84965362 0.83175500 0.81611035 0.80182502 [13] 0.78238230 0.75241043 0.72263161 0.69637361 0.66955598 0.64049719 [19] 0.61027041 0.58433315 0.56048047 0.53434096 0.51013770 0.48886633 [25] 0.46251231 0.42952676 0.39771797 0.36905911 0.33964682 0.30798944 [31] 0.27475752 0.24579335 0.21890573 0.19199502 0.16634728 0.14436684 [37] 0.12054230 0.09194310 0.06391030 0.03890999 0.01320679 -0.01533227 [43] -0.04593315 -0.07021522 -0.09214200 -0.11484419 -0.13594947 -0.15320062 [49] -0.17051575 > (mypacf <- c(rpacf$acf)) [1] 0.977558160 0.016591588 0.074922664 0.012149740 -0.074811871 [6] -0.023521694 0.057624257 0.034282873 -0.054418840 0.049416535 [11] 0.009415371 -0.126698150 -0.246912693 -0.050060214 0.016773008 [16] -0.017787611 -0.020279258 -0.058051303 0.026763487 0.020573640 [21] -0.041030988 0.015410893 0.048923784 -0.078675000 -0.116574194 [26] -0.017611629 -0.001898843 -0.018100205 -0.015032098 -0.074609782 [31] -0.004405048 0.011735884 0.009030933 -0.013163924 0.057005463 [36] 0.006234067 -0.076341137 -0.030975191 -0.002742296 -0.020652460 [41] -0.024774317 -0.071780423 0.036621256 0.011988479 -0.014051026 [46] -0.015053292 0.032012534 0.018675974 > 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/4rtgt1471279523.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/58aa51471279523.tab") > > try(system("convert tmp/1ot9h1471279523.ps tmp/1ot9h1471279523.png",intern=TRUE)) character(0) > try(system("convert tmp/2i9x11471279523.ps tmp/2i9x11471279523.png",intern=TRUE)) character(0) > try(system("convert tmp/3g9os1471279523.ps tmp/3g9os1471279523.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.312 0.105 1.452