R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(3200944,3153170,3741498,3918719,4403449,4400407,4847473,4716136,4297440,4272253,3271834,3168388,2911748,2720999,3199918,3672623,3892013,3850845,4532467,4484739,4014972,3983758,3158459,3100569,2935404,2855719,3465611,3006985,4095110,4104793,4730788,4642726,4246919,4308032,3508154,3236641,3257275,3045631,3657692,4125747,4472507,4513455,5150896,5057815,4681742,4603682,3580181,3534002,3422762,3295209,3868093,4189245,4544332,4612845,5221595,5137505,4760439,4643697,3692267,3587603) > 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/1x8ct1400830069.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/2kxbf1400830069.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/3h9f11400830069.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.08791809 0.32404622 0.07746154 -0.37868984 -0.19759592 [7] -0.58620666 -0.21437818 -0.38730200 0.03125548 0.27580570 0.12720924 [13] 0.66086908 0.12509743 0.26308212 0.04698492 -0.30180613 -0.12609262 [19] -0.49428551 -0.13038372 -0.30967100 0.04123942 0.21196841 0.06346419 [25] 0.53272640 0.05968278 0.20914854 0.02340388 -0.22018123 -0.12361166 [31] -0.32416938 -0.10511206 -0.19492854 0.03541026 0.11011436 0.07947581 [37] 0.35282595 0.07087697 0.10631256 0.03902457 -0.12273295 -0.08043621 [43] -0.16927221 -0.09300805 -0.13745966 0.02465487 0.06488139 0.03709417 [49] 0.17229378 > (mypacf <- c(rpacf$acf)) [1] 0.087918094 0.318780673 0.033684274 -0.548171564 -0.291285142 [6] -0.405079712 -0.008542182 -0.356484685 -0.029529512 0.193363706 [11] -0.053452314 0.180748026 -0.114186652 -0.109606198 -0.048757481 [16] -0.086459798 0.075542011 0.031312045 0.088443517 -0.131306741 [21] -0.016053000 -0.034090910 -0.110252834 0.045980336 0.010385473 [26] -0.031746848 -0.064644189 -0.025593842 -0.115754907 0.113761398 [31] -0.025470028 0.045909234 -0.052257508 -0.180933905 -0.037335586 [36] 0.001632570 0.123214481 -0.118014196 0.003776855 0.083058246 [41] 0.009929178 0.020465036 -0.085701319 0.036938081 0.025821243 [46] 0.059526148 -0.027939177 -0.079230094 > 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/4si3i1400830069.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/55z4c1400830069.tab") > > try(system("convert tmp/1x8ct1400830069.ps tmp/1x8ct1400830069.png",intern=TRUE)) character(0) > try(system("convert tmp/2kxbf1400830069.ps tmp/2kxbf1400830069.png",intern=TRUE)) character(0) > try(system("convert tmp/3h9f11400830069.ps tmp/3h9f11400830069.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.542 0.258 1.816