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(100.44,100.47,100.49,100.52,100.47,100.48,100.48,100.53,100.62,100.89,100.97,101.01,101.02,100.92,100.93,100.98,101.07,101.1,101.11,101.19,101.31,101.52,101.61,101.65,101.66,101.56,101.75,101.83,101.98,102.06,102.07,102.1,102.42,102.91,103.14,103.23,103.23,102.91,103.11,103.14,103.26,103.3,103.32,103.44,103.54,103.98,104.24,104.29,104.29,103.98,103.98,103.89,103.86,103.88,103.88,104.31,104.41,104.8,104.89,104.9,104.9,104.54,104.67,104.87,105.04,105.09,105.1,105.46,105.83,106.27,106.46,106.52,106.53,105.96,106,106.15,106.32,106.41,106.41,106.81,106.99,107.35,107.53,107.56) > 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/1llwf1388236693.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/206yf1388236693.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/3iur31388236693.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.297505818 0.117715299 -0.202080898 -0.344141793 [6] -0.052835618 -0.278961951 -0.016051557 -0.272476648 -0.154367220 [11] 0.128326334 0.178406391 0.666846671 0.228852125 0.060680805 [16] -0.176435018 -0.330399049 -0.013151130 -0.268750130 -0.055296395 [21] -0.231752867 -0.096751601 0.188437540 0.175459615 0.490614604 [26] 0.121559613 -0.023634988 -0.187634299 -0.318201640 -0.020499440 [31] -0.111852172 -0.024551996 -0.172186288 -0.088242913 0.145689481 [36] 0.151424752 0.387356584 0.126593771 -0.025071055 -0.108105492 [41] -0.209182853 -0.038521643 -0.061360726 0.009285051 -0.091792311 [46] -0.061098195 0.113067225 0.117328888 0.213337650 > (mypacf <- c(rpacf$acf)) [1] 0.297505818 0.032041578 -0.269629456 -0.256879016 0.193317754 [6] -0.356427755 0.007233814 -0.371886255 -0.070277402 0.087411054 [11] 0.102781523 0.456160962 -0.073958806 -0.104527769 0.040611483 [16] -0.018012689 0.089073849 -0.162180431 -0.080255349 -0.048252182 [21] 0.109542874 0.002382232 0.041494861 -0.072628438 -0.043879382 [26] -0.070693878 -0.028920813 -0.075457350 -0.034255543 0.198061130 [31] -0.100316286 -0.070421399 0.024342469 -0.116917840 0.040433038 [36] 0.030518583 0.019850995 -0.001281891 0.144082621 0.062317811 [41] -0.042287926 0.032221210 0.042589885 0.025628143 0.024146482 [46] -0.002212289 -0.052637048 -0.039540663 > 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/4k8dy1388236693.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/5856g1388236693.tab") > > try(system("convert tmp/1llwf1388236693.ps tmp/1llwf1388236693.png",intern=TRUE)) character(0) > try(system("convert tmp/206yf1388236693.ps tmp/206yf1388236693.png",intern=TRUE)) character(0) > try(system("convert tmp/3iur31388236693.ps tmp/3iur31388236693.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.096 1.031 5.082