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(462.23,464.79,465.22,468.52,469.02,469.15,469.15,469.15,469.15,469.41,469.45,469.45,469.93,477.19,478.97,480.44,480.56,481.8,483.24,483.45,483.53,483.59,483.59,483.59,492.36,495.71,499.29,499.78,500,500,500.29,500.42,500.61,498.9,499.06,496.61,498.41,501.26,505.4,506.07,506.2,507.14,507.14,507.28,507.34,507.48,506.97,506.97,510.1,515.84,519,520.1,521.26,521.04,521.12,521.12,521.1,521.16,521.14,521.13,522.17,531.39,532.12,533.34,535.72,536.25,536.25,536.68,536.76,536.79,536.99,536.99,542.38,544.1,546.96,547.04,550.27,550.32,551.17,552.83,552.35,552.44,552.47,548.78) > 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/fisher/rcomp/tmp/10zwv1384794088.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/fisher/rcomp/tmp/2bow51384794088.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/fisher/rcomp/tmp/36fc51384794088.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.196333923 0.094214570 -0.114288447 -0.149634130 [6] -0.210115312 -0.169698448 -0.203458239 -0.189241768 -0.187738444 [11] -0.004585215 0.306149653 0.425538073 0.260541385 0.011759758 [16] -0.044051319 -0.175981535 -0.161449092 -0.158191748 -0.216004895 [21] -0.174692654 -0.073259500 -0.156048926 0.308485367 0.338328702 [26] 0.297601747 0.012479146 -0.006256375 -0.095389763 -0.124485301 [31] -0.117788823 -0.110203398 -0.161793875 -0.123435559 -0.055641458 [36] 0.170365194 0.243798693 0.249663731 0.025006733 -0.053646531 [41] -0.025691251 -0.110623150 -0.103127304 -0.093297859 -0.096265122 [46] -0.113211044 0.024330701 0.082101302 0.365144447 > (mypacf <- c(rpacf$acf)) [1] 0.196333923 0.057899409 -0.149319689 -0.113407081 -0.149793084 [6] -0.110697217 -0.177815171 -0.198961666 -0.236413225 -0.089548111 [11] 0.212664579 0.275362511 0.074118085 -0.147402043 -0.051193663 [16] -0.104947439 -0.071972365 -0.051400585 -0.131309027 -0.021091678 [21] 0.078571012 -0.316461127 0.042413343 0.078298955 0.080351067 [26] -0.144428695 -0.056952619 0.007255341 -0.024048948 0.017028481 [31] -0.018106876 -0.072188607 0.049270925 -0.017636527 -0.094974803 [36] -0.163572677 0.141801443 -0.108116305 -0.149677170 0.069490373 [41] -0.103251093 -0.073352674 0.041010952 -0.102401858 -0.036625037 [46] 0.127859034 -0.018306592 0.054061523 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/4jjpu1384794088.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/fisher/rcomp/tmp/5480s1384794088.tab") > > try(system("convert tmp/10zwv1384794088.ps tmp/10zwv1384794088.png",intern=TRUE)) character(0) > try(system("convert tmp/2bow51384794088.ps tmp/2bow51384794088.png",intern=TRUE)) character(0) > try(system("convert tmp/36fc51384794088.ps tmp/36fc51384794088.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.782 0.439 2.202