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(203089,198480,192684,187827,182414,182510,211524,211451,200140,191568,186424,191987,203583,201920,195978,191395,188222,189422,214419,224325,216222,210506,207221,210027,215191,215177,211701,210176,205491,206996,235980,241292,236675,229127,225436,229570,239973,236168,230703,224790,217811,219576,245472,248511,242084,235572,229827,229697,239567,237201,233164,227755,220189,221270,245413,247826,237736,230079,225939,228987) > 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/1l6kj1476812488.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/2th1m1476812488.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/37g7o1476812488.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.23291969 -0.39115383 -0.44266140 -0.28739134 0.13726139 [7] 0.52836593 0.15689064 -0.22809338 -0.36819092 -0.33365442 0.16625990 [13] 0.74025277 0.20710043 -0.28125808 -0.33783955 -0.23992120 0.07701764 [19] 0.36677864 0.12758378 -0.15404343 -0.28580677 -0.27828427 0.13660244 [25] 0.56436335 0.12176632 -0.20783390 -0.25917077 -0.19646804 0.06543500 [31] 0.26741000 0.08100960 -0.09485261 -0.19827783 -0.20066320 0.08663490 [37] 0.37678155 0.08800218 -0.12191255 -0.16041360 -0.13412248 0.01239395 [43] 0.17230694 0.07563335 -0.04162983 -0.10252546 -0.10890414 0.03003730 [49] 0.19452670 > (mypacf <- c(rpacf$acf)) [1] 0.2329196937 -0.4709554924 -0.2703212036 -0.4061994237 -0.0787162237 [6] 0.2198336548 -0.1666304590 -0.0003521781 -0.2210530694 -0.3334014226 [11] -0.0147212476 0.4763703657 -0.1285702722 0.1745666292 0.1604408130 [16] 0.1589618677 0.0139256081 -0.1386560613 0.0185981781 -0.0980512107 [21] -0.1432296353 -0.1496401065 -0.0190140656 -0.0050380092 -0.2309565655 [26] 0.0354689426 -0.1094320124 -0.0447262837 -0.0649739921 -0.0771615843 [31] -0.0093264935 -0.0408191750 0.0462530786 0.0703156855 -0.0749187764 [36] -0.0820082275 0.0461614092 -0.0427776911 -0.0260560941 -0.0042712531 [41] -0.0627819635 0.0419891815 -0.0392367615 -0.0068216334 0.0739254151 [46] 0.0822282187 -0.0194496433 -0.0673218971 > 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/4z2ms1476812488.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/5xmyr1476812488.tab") > > try(system("convert tmp/1l6kj1476812488.ps tmp/1l6kj1476812488.png",intern=TRUE)) character(0) > try(system("convert tmp/2th1m1476812488.ps tmp/2th1m1476812488.png",intern=TRUE)) character(0) > try(system("convert tmp/37g7o1476812488.ps tmp/37g7o1476812488.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.185 0.092 1.295