R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(93.43,93.59,95.28,94.95,94.49,94.45,94.35,95.52,96.89,97.54,97.65,97.35,98.2,99.46,100.35,99.72,99.69,99.62,99.77,100.19,100.82,100.36,101.08,100.73,101.51,102.12,102.88,103.47,103.53,103.67,103.68,103.76,103.67,103.01,103.39,103.43,103.4,104.8,105.53,107.45,108.73,109.04,108.75,108.75,108.76,108.41,110.15,109.93,110.6,112.17,113.47,113.35,114.12,115,114.01,113.86,113.83,112.7,111.79,113.77) > 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/1nkko1495114135.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/21nwy1495114135.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/3kz0p1495114135.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.119834409 -0.048128298 -0.002651353 -0.161332692 [6] -0.240579049 0.011783660 -0.057737348 -0.339507438 -0.044893457 [11] 0.138847891 0.101781450 0.198572523 0.185111434 -0.020031343 [16] -0.009735322 -0.139552056 -0.156647324 -0.119746269 -0.095341671 [21] -0.017991446 -0.062318749 0.079221164 -0.054667306 0.088713196 [26] 0.070342513 0.062954018 0.069722814 -0.017919571 -0.030796108 [31] 0.024412287 -0.066186688 0.040955504 -0.014162456 -0.094678072 [36] -0.043149410 -0.013448514 0.115338264 0.011440893 0.108630393 [41] 0.037799817 0.053781247 0.010537453 -0.051797207 -0.054975858 [46] -0.080084304 -0.007584682 0.037085774 -0.018466585 > (mypacf <- c(rpacf$acf)) [1] 0.119834409 -0.063399011 0.011285885 -0.168575590 -0.207636621 [6] 0.045632757 -0.095971253 -0.376808796 -0.078241456 0.071351069 [11] 0.058538108 0.054937436 0.011385142 0.017211105 0.071453041 [16] -0.242467950 -0.121074317 -0.017543365 -0.056195157 0.020880238 [21] -0.169841485 0.006970410 -0.172419371 -0.119400404 -0.159368870 [26] -0.041406287 0.033494192 -0.051055642 -0.024575256 0.089381631 [31] -0.110186260 0.040815912 -0.103025404 -0.125080523 -0.036600696 [36] -0.108750372 0.077023296 -0.058894630 -0.061128977 -0.021903924 [41] 0.055772334 -0.122470462 -0.102285324 -0.096901700 0.045707903 [46] 0.081679630 0.038625677 -0.006930238 > 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/48ak81495114135.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/5tiwd1495114135.tab") > > try(system("convert tmp/1nkko1495114135.ps tmp/1nkko1495114135.png",intern=TRUE)) character(0) > try(system("convert tmp/21nwy1495114135.ps tmp/21nwy1495114135.png",intern=TRUE)) character(0) > try(system("convert tmp/3kz0p1495114135.ps tmp/3kz0p1495114135.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.928 0.179 2.139