R version 3.0.1 (2013-05-16) -- "Good Sport" 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(67.66,68,68.02,68.11,68.41,68.4,68.4,68.55,68.54,68.99,68.97,68.98,68.98,68.94,69.21,69.21,69.67,69.66,69.66,69.66,69.77,70.32,70.34,70.38,70.38,70.29,70.42,70.29,70.59,70.64,70.64,70.68,70.78,70.9,71.04,71.15,71.15,71.15,71.07,71.17,71.24,71.23,71.23,71.23,71.24,71.28,71.52,71.52,71.52,71.6,71.61,71.78,71.66,71.86,71.86,71.82,71.8,72.22,72.51,72.56,72.56,72.78,72.88,73.05,73.02,73.08,73.08,73.24,73.82,74,74.37,74.38) > 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/1vslc1369575383.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/2l1go1369575383.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/34la41369575383.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.088854995 0.053150106 -0.160745468 -0.134902103 [6] 0.248078412 -0.106615815 0.262655523 -0.074411891 -0.150059948 [11] 0.003263807 0.053591123 0.330260080 -0.026216205 -0.015147682 [16] -0.037053590 -0.156347173 0.105218065 -0.052114831 0.068541277 [21] -0.056961886 -0.104152268 -0.039120645 -0.018244436 -0.018219228 [26] 0.100296202 -0.126593007 -0.072034474 -0.041755938 -0.019989975 [31] 0.045379874 -0.108671045 -0.059296370 -0.036993325 -0.107755809 [36] 0.022241439 0.001209140 0.140196556 -0.138546519 -0.058320246 [41] -0.001825840 -0.013904514 0.140401624 -0.175174879 -0.026757092 [46] -0.079959898 -0.073828788 0.132959228 0.021059865 > (mypacf <- c(rpacf$acf)) [1] -0.088854995 0.045615036 -0.153716053 -0.168413628 0.249260551 [6] -0.089887454 0.198290179 0.023956659 -0.169408456 -0.007561899 [11] 0.187494303 0.202651015 0.006693340 0.002137965 0.055245211 [16] -0.118296852 0.003591137 -0.054311991 -0.115094177 -0.038033072 [21] 0.025847278 -0.153497305 -0.036284700 -0.152352549 0.084410620 [26] -0.140537368 -0.096371141 0.042062004 0.009847788 -0.044675484 [31] -0.010119715 -0.142238390 0.041845044 -0.056182050 -0.016505577 [36] 0.018272029 0.164117441 -0.107059462 0.048246276 -0.041525415 [41] 0.051524518 0.045735570 -0.079550855 -0.165190366 0.024469331 [46] -0.073859444 0.038549214 -0.072045141 > 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/460kg1369575383.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/5wx0s1369575383.tab") > > try(system("convert tmp/1vslc1369575383.ps tmp/1vslc1369575383.png",intern=TRUE)) character(0) > try(system("convert tmp/2l1go1369575383.ps tmp/2l1go1369575383.png",intern=TRUE)) character(0) > try(system("convert tmp/34la41369575383.ps tmp/34la41369575383.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.684 0.363 2.032