R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(6,6.81,9.75,6.96,3.94,5,4.9,5.7,6.5,7.1,7.5,7.8,7,7.4,8.55,7.43,4.7,4.7,5.3,6.2,7.4,7.5,7.32,8.15,7.24,7.4,9.4,8.9,4.5,4.9,5.6,6.4,6,6.9,6.7,5.4,5.6,6.9,6.9,7,4,3.7,4.9,5,5.7,6.1,5.3,5.5,5.7,5.21,5.4,4.5,3.7,4.1,4.8,4.1,5,5.2,5.5,5.9) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/www/html/rcomp/tmp/1komb1292497271.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/www/html/rcomp/tmp/2dfmw1292497271.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/www/html/rcomp/tmp/3dfmw1292497271.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.6206258852 0.2168823778 0.1272470015 0.0855354570 [6] 0.0744594392 0.1142514663 0.0733037585 0.0477110565 0.0447229145 [11] 0.1375217970 0.3848671555 0.5687980439 0.3350736794 0.0002534104 [16] -0.0914469699 -0.0904320050 -0.0967784628 -0.0744807608 -0.1058595995 [21] -0.1498336063 -0.1247088155 -0.0674145515 0.0737727887 0.2227860928 [26] 0.0717091335 -0.1969179806 -0.2364664136 -0.2247511507 -0.2339865797 [31] -0.2202667822 -0.1874906261 -0.1964547901 -0.1799991732 -0.0891658309 [36] 0.0076864838 0.0739274596 0.0209704876 -0.1272979193 -0.1529886723 [41] -0.1456868326 -0.1565783903 -0.1212125021 -0.1012442874 -0.1038947611 [46] -0.0551676923 -0.0185894478 0.0032747955 0.0211816796 > (mypacf <- c(rpacf$acf)) [1] 0.6206258852 -0.2737275146 0.2209768290 -0.1157937797 0.1231213898 [6] 0.0336611999 -0.0663095375 0.0869796863 -0.0562430577 0.2476703246 [11] 0.3278792981 0.2543282800 -0.3173575099 -0.1642122242 -0.0544553792 [16] -0.0714309154 -0.0400169941 -0.0942497104 -0.0705459339 -0.0595126928 [21] 0.0249040176 -0.1489403551 -0.0275362549 0.0638617606 -0.0955981459 [26] -0.0112510058 0.0243511347 -0.1086961730 0.0023437905 -0.0908846490 [31] 0.1386517428 -0.0802478210 0.0398733535 0.0798540217 -0.0989160465 [36] 0.0488590546 0.0075857052 0.1037899218 0.0001473194 -0.0475034086 [41] 0.0623587479 -0.0248657157 -0.0357805636 -0.0071236688 0.0093282686 [46] -0.1150844746 -0.0424129032 -0.1206628725 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/4r7141292497271.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/www/html/rcomp/tmp/5c7is1292497271.tab") > > try(system("convert tmp/1komb1292497271.ps tmp/1komb1292497271.png",intern=TRUE)) character(0) > try(system("convert tmp/2dfmw1292497271.ps tmp/2dfmw1292497271.png",intern=TRUE)) character(0) > try(system("convert tmp/3dfmw1292497271.ps tmp/3dfmw1292497271.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.731 0.498 4.051