R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(00.521505,00.424828,00.425031,00.477194,00.828021,00.615619,00.366627,00.430888,00.281029,00.464625,00.269395,00.577905,00.566115,00.507758,00.750718,00.680840,00.766109,00.456147,00.497750,00.419327,00.609551,00.457337,00.570548,00.347900,00.387499,00.582429,00.239103,00.236745,00.262616,00.424093,00.365275,00.375076,00.409006,00.389168,00.240261,00.158950,00.439337,00.509468,00.374347,00.433983,00.413056,00.328893,00.518665,00.548650,00.546911,00.496349,00.530893,00.595776,00.557058,00.573133,00.500542,00.543127,00.559366,00.691169,00.440349,00.567666,00.596911,00.473554,00.592394,00.597556,00.633413,00.605712,00.704611,00.480526,00.702686,00.700902,00.603085,00.698092,00.597656,00.802342,00.601711,00.599313,00.602563,00.701663,00.499571,00.498092,00.497569,00.600183,00.333954,00.274437,00.320943,00.540667,00.405021,00.288596,00.327594,00.313261,00.257556,00.213839,00.186186,00.159271) > par8 = '' > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > 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/rcomp/tmp/1lyz41293627140.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/rcomp/tmp/2vpx71293627140.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/rcomp/tmp/3vpx71293627140.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.00000000 0.56076745 0.46196854 0.37628550 0.39972306 0.32391694 [7] 0.21044154 0.25533525 0.18721871 0.21006123 0.05404737 0.08762142 [13] -0.06481816 -0.09531795 -0.15266945 -0.16984917 -0.11922137 -0.13976251 [19] -0.18842001 -0.28441716 -0.22236949 -0.20626161 -0.20272667 -0.25407346 [25] -0.22858455 -0.18260754 -0.19885091 -0.22658022 -0.14321497 -0.19883069 [31] -0.24102525 -0.20328310 -0.18534705 -0.13835882 -0.23415730 -0.20782988 [37] -0.23855849 > (mypacf <- c(rpacf$acf)) [1] 0.560767451 0.215171156 0.080007873 0.173324147 0.006581264 [6] -0.104434002 0.126238763 -0.052270616 0.059837693 -0.161995458 [11] 0.033572039 -0.222159648 -0.065339700 -0.080095304 -0.028048253 [16] 0.059598359 0.053989224 -0.145251535 -0.100918566 0.002344301 [21] 0.073978721 -0.013080568 -0.029928207 -0.046864934 -0.019619586 [26] -0.053240838 -0.079411336 0.125241552 -0.157094639 -0.108560363 [31] -0.002353281 -0.082099872 0.001309163 -0.135715903 -0.039110626 [36] -0.113675441 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/4z7ed1293627140.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/rcomp/tmp/5k8d11293627140.tab") > > try(system("convert tmp/1lyz41293627140.ps tmp/1lyz41293627140.png",intern=TRUE)) character(0) > try(system("convert tmp/2vpx71293627140.ps tmp/2vpx71293627140.png",intern=TRUE)) character(0) > try(system("convert tmp/3vpx71293627140.ps tmp/3vpx71293627140.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.900 0.490 1.369