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(0.978,0.973,0.96,0.978,0.985,1.035,1.015,1.05,1.022,1.042,1.058,1.056,1.098,1.097,1.139,1.182,1.189,1.191,1.168,1.168,1.177,1.184,1.2,1.251,1.288,1.313,1.363,1.377,1.342,1.334,1.348,1.327,1.349,1.361,1.393,1.38,1.421,1.432,1.457,1.453,1.428,1.383,1.408,1.458,1.474,1.491,1.476,1.446,1.451,1.472,1.449,1.415,1.39,1.394,1.418,1.426,1.437,1.406,1.387,1.404) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > 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 <- '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) > 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/1hr2b1400800901.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/256kn1400800901.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/39gqs1400800901.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.95689549 0.90928732 0.85469721 0.80313891 0.75470278 [7] 0.71491493 0.67049511 0.62994032 0.58411895 0.53612585 0.48063111 [13] 0.41756376 0.35673159 0.29235997 0.23766855 0.19510328 0.15409861 [19] 0.11488515 0.07164000 0.02136623 -0.03285855 -0.08747539 -0.14174764 [25] -0.18812409 -0.22324846 -0.25231278 -0.26665703 -0.27775428 -0.29296658 [31] -0.31521747 -0.33469173 -0.35983562 -0.38271140 -0.40507127 -0.41714606 [37] -0.42813425 -0.42638834 -0.41701111 -0.40220914 -0.38969174 -0.38202286 [43] -0.38147993 -0.37725173 -0.36214996 -0.34455246 -0.32027261 -0.29445990 [49] -0.27339120 > (mypacf <- c(rpacf$acf)) [1] 0.956895492 -0.075418891 -0.105509043 0.014644790 0.011695445 [6] 0.066690509 -0.093700923 0.012751307 -0.075962028 -0.053251909 [11] -0.104543538 -0.131677837 0.010557741 -0.102846533 0.064099922 [16] 0.083126729 -0.053338199 -0.015397152 -0.093600439 -0.077428306 [21] -0.077989747 -0.040998530 -0.043927772 0.008098749 0.075493339 [26] -0.038510964 0.127949980 -0.003634281 -0.091060473 -0.062261552 [31] 0.028793311 -0.074997048 -0.059659105 -0.063570984 0.019315227 [36] -0.057641171 0.073415663 0.058676019 0.077286386 -0.005384371 [41] -0.073898476 -0.038792001 0.004181838 0.070217339 -0.060867466 [46] 0.012188080 -0.019820672 -0.092371692 > 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/44e6b1400800901.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/5sc2b1400800901.tab") > > try(system("convert tmp/1hr2b1400800901.ps tmp/1hr2b1400800901.png",intern=TRUE)) character(0) > try(system("convert tmp/256kn1400800901.ps tmp/256kn1400800901.png",intern=TRUE)) character(0) > try(system("convert tmp/39gqs1400800901.ps tmp/39gqs1400800901.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.599 0.309 1.930