R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(500,500.01,500.02,500.03,500.04,500.05,500.06,500.07,500.08,500.09,500.10,500.11,500.12,500.13,500.14,500.15,500.16,500.17,500.18,500.19,500.20,500.21,500.22,500.23,500.24,500.25,500.26,500.27,500.28,500.29,500.30,500.31,500.32,500.33,500.34,500.35,500.36,500.37,500.38,500.39,500.40,500.41,500.42,500.43,500.44,500.45,500.46,500.47,500.48,500.49,500.50,500.51,500.52,500.53,500.54,500.55,500.56,500.57,500.58,500.59,500.60,500.61,500.62,500.63,500.64,500.65,500.66,500.67,500.68,500.69,500.70,500.71) > 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/1dg8o1388235960.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/22zmm1388235960.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/3oou81388235960.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.185915765 -0.188498196 -0.191080628 -0.176995515 [6] -0.179577947 0.695113227 0.047076250 -0.170657697 -0.173240129 [11] -0.159155016 -0.161737448 0.390226453 0.280068264 -0.152817198 [16] -0.155399630 -0.141314516 -0.143896948 0.085339680 0.513060278 [21] -0.134976699 -0.137559130 -0.123474017 -0.126056449 -0.128638881 [26] 0.638476535 -0.117136199 -0.119718631 -0.122301063 -0.108215950 [31] -0.110798382 0.441165519 0.008280057 -0.101878132 -0.104460564 [36] -0.090375450 -0.092957882 0.243854504 0.133696314 -0.084037633 [41] -0.086620065 -0.072534951 -0.075117383 0.046543488 0.259112571 [46] -0.066197133 -0.068779565 -0.054694452 -0.057276884 > (mypacf <- c(rpacf$acf)) [1] -0.1859154930 -0.2310483087 -0.3032910983 -0.4183266952 -0.7228766530 [6] 0.0676920149 0.0947124751 0.0024822214 -0.0064737767 0.0026999044 [11] 0.0235934966 -0.2262103424 0.0574445612 -0.0084342863 -0.0090004268 [16] 0.0137464643 0.0324630620 -0.3043466100 0.0974079212 -0.0222940768 [21] -0.0211641921 0.0175411612 0.0605722654 -0.1283449256 0.2078583846 [26] -0.0288104041 -0.0139999691 -0.0462364473 -0.0254161731 0.2892204846 [31] -0.0859517070 -0.0607199351 -0.0130865064 0.0007661164 -0.0089011478 [36] -0.0506674462 0.0270985313 -0.0384690459 0.0011370762 0.0099961106 [41] -0.0158906197 -0.0872840039 0.0073000030 -0.0842712669 -0.0233634428 [46] -0.0226050024 0.0061572640 0.0401573022 > 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/4jxmm1388235960.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/5ramv1388235960.tab") > > try(system("convert tmp/1dg8o1388235960.ps tmp/1dg8o1388235960.png",intern=TRUE)) character(0) > try(system("convert tmp/22zmm1388235960.ps tmp/22zmm1388235960.png",intern=TRUE)) character(0) > try(system("convert tmp/3oou81388235960.ps tmp/3oou81388235960.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.667 0.532 3.177