R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(114.7,108,101.3,108.4,105.6,120.4,107.6,111.4,122.1,104.8,103.2,112.3,123.1,115.5,106.3,119.9,119.5,120.9,127.5,116.6,126.7,110.6,100.4,125.2,125,105.2,102.7,94.2,97,111.1,102,97.3,109.8,98.9,93.2,115.2,115,107,104.1,106,110.8,127.8,116.9,113.8,131.6,106.1,107.2,127.4,123,121.8,117.6,118.4,121.8,141.9,122.1,132.2,131.6,108.8,120.4,134.7) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > 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/1hxm31324321497.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/2i5yi1324321497.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/3nkdc1324321497.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.5048077411 0.0382034066 0.3781755257 -0.4190010623 [6] 0.3019605031 0.0009797258 -0.2283494721 0.2494328682 -0.1597932027 [11] -0.0756828373 0.2152450969 -0.2728408283 0.0104238914 -0.0053377189 [16] -0.0281933994 0.0171171548 -0.1231724351 0.1496043552 -0.1065823001 [21] -0.0300413420 0.1676836527 -0.1708029840 0.0585651214 0.0329895332 [26] -0.1266468676 0.2134627836 -0.1275437643 -0.0563678301 0.1864758799 [31] -0.1243008545 -0.0111664586 0.1381138430 -0.1580878590 0.0449239963 [36] 0.0939696973 -0.1533318748 > (mypacf <- c(rpacf$acf)) [1] -0.504807741 -0.290709097 0.375721998 -0.038373244 0.112573876 [6] 0.072970463 -0.070093289 -0.073967049 -0.061211293 -0.133929762 [11] 0.049332570 -0.075303438 -0.204524355 -0.317570307 0.078649126 [16] 0.081615348 -0.121812532 0.099235043 0.053695805 -0.114426238 [21] 0.019591969 0.010698362 -0.113399827 -0.126611621 -0.106511303 [26] -0.031328465 -0.018243886 -0.016631263 -0.057946018 0.093381199 [31] -0.009263338 -0.006655753 -0.053244732 -0.052112845 0.015781430 [36] -0.129791362 > 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/4jjji1324321497.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/58eh11324321497.tab") > > try(system("convert tmp/1hxm31324321497.ps tmp/1hxm31324321497.png",intern=TRUE)) character(0) > try(system("convert tmp/2i5yi1324321497.ps tmp/2i5yi1324321497.png",intern=TRUE)) character(0) > try(system("convert tmp/3nkdc1324321497.ps tmp/3nkdc1324321497.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.946 0.233 1.175