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(103.51,104.35,104.51,105.25,105.2,105.87,107.63,107.77,106.58,106.32,106.3,106.38,106.42,107.35,107.58,108.2,108.29,108.76,110.69,110.56,108.81,108.81,108.81,109.74,109.57,110.44,111.2,111.44,111.83,112.87,115.07,115.35,113.81,114.66,114.51,115.11,114.54,115.39,115.65,116.46,116.18,116.63,118.84,118.77,117.83,117.66,117.36,118,117.34,118.04,118.17,118.82,119,118.89,121.4,121.01,120.21,120.39,120.09,120.76,120.33,120.84,121.49,122.29,121.91,122.46,124.94,124.6,123.09,123.25,123.01,123.82) > 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/1vuax1358156806.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/2xp4e1358156806.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/346dl1358156806.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.0341716194 -0.2764801267 -0.0679559606 0.0596390461 [6] 0.0381057332 -0.3007174766 -0.0189892003 0.0744236489 -0.0651690436 [11] -0.2162825555 -0.0236662951 0.7459559986 -0.0320659805 -0.2327457771 [16] -0.0643708213 0.0429402740 0.0400938438 -0.2337123566 -0.0549117935 [21] 0.0654396998 -0.0454150779 -0.2266389592 0.0007932455 0.5753719740 [26] -0.0020308253 -0.1488027981 -0.0673903384 0.0702726205 0.0472159406 [31] -0.1613405296 -0.0714905876 0.0665871385 0.0024081506 -0.1882244592 [36] -0.0307880365 0.4362833068 0.0211501751 -0.0920783263 -0.0709778993 [41] 0.0100635174 0.0602194078 -0.1146051071 -0.0511527404 0.0334722349 [46] -0.0456186591 -0.1202731312 0.0024982597 0.2858585157 > (mypacf <- c(rpacf$acf)) [1] -0.034171619 -0.277972415 -0.097139204 -0.029037153 -0.006208075 [6] -0.324269664 -0.061426361 -0.124717740 -0.185110114 -0.360536519 [11] -0.269203521 0.603455546 -0.060684916 0.082765626 -0.047672595 [16] -0.045900457 -0.115942070 0.053593008 -0.091827662 -0.046653049 [21] -0.041455399 -0.213207460 -0.061855484 -0.086039853 -0.022852413 [26] 0.023443955 -0.024818126 0.027982534 -0.026849308 0.060715963 [31] -0.036652931 0.084232113 0.064343543 0.133801181 -0.071738584 [36] 0.040790719 -0.011725670 0.010088263 0.038646615 -0.131496643 [41] 0.015645965 -0.083539286 0.094322154 -0.116260096 -0.090605117 [46] 0.017264649 0.100367138 -0.064246421 > 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/4nnph1358156806.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/5v3o21358156806.tab") > > try(system("convert tmp/1vuax1358156806.ps tmp/1vuax1358156806.png",intern=TRUE)) character(0) > try(system("convert tmp/2xp4e1358156806.ps tmp/2xp4e1358156806.png",intern=TRUE)) character(0) > try(system("convert tmp/346dl1358156806.ps tmp/346dl1358156806.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.705 0.377 3.081