R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(32.98,32.7,32.74,32.87,32.95,32.94,32.94,32.97,32.87,32.96,32.97,32.99,32.99,33.04,33.23,33.03,33.05,33.03,33.04,33.11,33.14,33.08,33.09,33.07,33.07,33.02,33,33.08,33.35,33.36,33.36,33.35,33.41,33.47,33.47,33.48,33.48,33.55,33.68,33.72,33.79,33.83,33.83,33.84,33.91,34.06,34.16,34.16,34.16,34.29,34.48,34.48,34.39,34.29,34.29,34.25,34.2,34.1,34.09,34.06,34.06,34.04,34.19,34.21,34.17,34.08,34.08,34.08,34.3,34.28,34.45,34.41) > 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/1asaj1352992806.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/2qy3c1352992806.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/3ah4h1352992806.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.050357890 -0.051063403 -0.192021220 0.064957006 [6] 0.095550553 0.018003228 -0.017823437 -0.017870500 -0.008577507 [11] 0.072144057 -0.063092159 -0.039544804 -0.169952929 0.102575512 [16] -0.171489213 -0.040919180 0.028429722 0.053278155 -0.028728884 [21] -0.106477379 0.007761271 0.069201824 -0.003864886 0.047692188 [26] -0.019294995 -0.054157608 -0.181542952 -0.045311408 -0.051994483 [31] 0.049646195 0.022746795 0.011455088 -0.031749568 0.035237541 [36] 0.069749992 0.062505207 -0.091816076 -0.034660192 -0.086397610 [41] 0.127315907 0.039388710 0.099478546 -0.050221041 -0.074628017 [46] -0.069570054 0.056205853 -0.033968184 -0.006710931 > (mypacf <- c(rpacf$acf)) [1] 0.050357890 -0.053735589 -0.187621766 0.083811424 0.073517625 [6] -0.022286971 0.017010934 0.009632780 -0.022584670 0.069938901 [11] -0.076322908 -0.035377600 -0.149655355 0.091619022 -0.228339398 [16] -0.054456227 0.092366917 -0.022296858 -0.042241567 -0.044736352 [21] 0.034065083 0.035641293 -0.023715979 0.044710828 0.023219026 [26] -0.116865365 -0.181955431 -0.132071727 -0.081350347 -0.016661584 [31] -0.029924545 0.022221212 0.004911842 0.082134555 0.059426810 [36] 0.066470375 -0.006164731 -0.040504467 -0.184069479 0.011872212 [41] -0.050074754 -0.016583895 -0.052630567 -0.086400026 -0.056375424 [46] 0.030618257 -0.060460252 0.021994172 > 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/4756a1352992806.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/55dx41352992806.tab") > > try(system("convert tmp/1asaj1352992806.ps tmp/1asaj1352992806.png",intern=TRUE)) character(0) > try(system("convert tmp/2qy3c1352992806.ps tmp/2qy3c1352992806.png",intern=TRUE)) character(0) > try(system("convert tmp/3ah4h1352992806.ps tmp/3ah4h1352992806.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.142 0.538 2.658