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(103.43,103.49,103.5,103.5,103.5,103.5,103.54,103.71,103.76,103.76,103.76,103.82,105.11,105.58,105.91,105.92,105.92,105.92,105.96,105.98,105.98,105.98,106.01,106.01,106.91,107.11,107.18,107.2,107.35,107.35,107.35,107.52,107.56,107.55,107.6,107.6,110.04,110.27,110.33,110.33,110.33,110.33,110.33,110.35,110.38,110.54,110.54,110.54,110.54,106.74,106.78,106.75,106.75,106.75,106.82,107.08,107.25,107.28,107.28,107.28,108.44,109.33,109.44,109.44,109.45,109.45,109.45,109.45,109.46,109.46,109.46,109.46,110.95,110.95,110.95,110.95,110.95,110.95,110.95,110.95,110.97,110.97,110.97,111) > 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/1gxsf1389455781.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/2cpuy1389455781.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/3fcgf1389455781.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.0000000000 0.0734106970 0.0147537812 -0.0202181983 -0.0272004872 [6] 0.0035255200 -0.0403822899 -0.0334517348 -0.0083977147 -0.0089275880 [11] 0.0030559159 -0.1044836448 0.0208938196 -0.3500883843 -0.0010559591 [16] -0.0147786420 0.0099796070 0.0064288831 -0.0170569482 0.0180836204 [21] 0.0040669374 -0.0296151168 0.0182315673 -0.1716133081 0.1993472705 [26] -0.0336248887 0.0091949701 -0.0008803411 0.0026685050 0.0199996219 [31] 0.0068161457 -0.0003469267 0.0104770481 0.0073545282 -0.0041118371 [36] -0.0374329442 0.1020524935 -0.1605572177 -0.0101484826 -0.0125785969 [41] -0.0086971411 -0.0049153531 -0.0241289298 -0.0009321133 0.0065912681 [46] -0.0097046237 0.0055816874 0.0313309025 0.1098664544 > (mypacf <- c(rpacf$acf)) [1] 0.0734106970 0.0094153915 -0.0221033431 -0.0244115982 0.0078662926 [6] -0.0412210389 -0.0289929796 -0.0032701939 -0.0086712443 0.0010223288 [11] -0.1068228462 0.0348536669 -0.3621459367 0.0590388948 -0.0371405913 [16] 0.0059432770 -0.0306183938 -0.0166610986 -0.0122892553 -0.0292343216 [21] -0.0355521380 0.0008905810 -0.1966698690 0.1909883356 -0.0793461227 [26] -0.1285584073 0.0303002024 -0.0216921237 0.0004007836 -0.0080261447 [31] -0.0113011908 0.0031197351 -0.0195594220 -0.0556854471 0.0236667926 [36] -0.0754660170 -0.0286445429 -0.0502954893 -0.0551333168 -0.0090522630 [41] -0.0380153181 -0.0182361248 -0.0160087685 -0.0401564428 0.0073246232 [46] -0.0702168190 0.0942681689 0.0202315947 > 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/43yft1389455781.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/5nv7u1389455781.tab") > > try(system("convert tmp/1gxsf1389455781.ps tmp/1gxsf1389455781.png",intern=TRUE)) character(0) > try(system("convert tmp/2cpuy1389455781.ps tmp/2cpuy1389455781.png",intern=TRUE)) character(0) > try(system("convert tmp/3fcgf1389455781.ps tmp/3fcgf1389455781.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.657 0.794 4.412