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(740,691,683,594,729,731,386,331,706,715,657,653,642,643,718,654,632,731,392,344,792,852,649,629,685,617,715,715,629,916,531,357,917,828,708,858,775,785,1006,789,734,906,532,387,991,841,892,782) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1ar3d1293201773.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/231kg1293201773.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/331kg1293201773.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.1890933234 -0.2063691997 0.1829838101 0.0017698757 [6] 0.0298467265 0.2438943572 -0.0165927627 0.0639549981 0.1753162462 [11] -0.2094876633 0.0820738520 0.5762958185 0.0160175136 -0.2625245176 [16] 0.0004183946 -0.0523918472 -0.0002946045 0.0283786612 -0.1123623320 [21] -0.0634601648 -0.0336887250 -0.2278170432 -0.0466714168 0.2941108696 [26] 0.0089285231 -0.2368421255 -0.0941907506 -0.1120388178 -0.1037061774 [31] -0.0487740838 -0.1267432492 -0.1015268015 -0.0387146507 -0.0987141783 [36] -0.0326032798 0.1260535162 -0.0080032110 -0.1312925950 -0.0780882283 [41] -0.0349326854 -0.0241493071 -0.0108593955 -0.0258127574 0.0031552224 [46] 0.0051114196 0.0077399893 0.0035094540 > (mypacf <- c(rpacf$acf)) [1] 0.1890933234 -0.2511040320 0.3091364464 -0.2216260397 0.2853687812 [6] 0.0269682741 -0.0002625131 0.1877901650 -0.0470260067 -0.1773985600 [11] 0.2890083559 0.3742666299 -0.1931053534 -0.1528323997 -0.1467395526 [16] 0.0611596375 -0.1070104328 -0.1865497608 0.0476059095 -0.2501835570 [21] -0.0206618810 -0.0565137665 -0.0248496616 0.0780101724 0.0328125859 [26] 0.1077121016 -0.0273063701 -0.1332008949 -0.0302172646 -0.0028795385 [31] -0.0760026228 -0.0285214310 -0.0225677822 0.1248442544 -0.0402701974 [36] -0.1362401686 0.0566947064 0.0453387321 -0.0273711131 0.1181084320 [41] -0.0657710897 0.0453523278 -0.0365000910 0.1105094294 0.0008180918 [46] -0.0728182595 -0.0626859730 > 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/4hai71293201773.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/59kza1293201773.tab") > > try(system("convert tmp/1ar3d1293201773.ps tmp/1ar3d1293201773.png",intern=TRUE)) character(0) > try(system("convert tmp/231kg1293201773.ps tmp/231kg1293201773.png",intern=TRUE)) character(0) > try(system("convert tmp/331kg1293201773.ps tmp/331kg1293201773.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.890 0.510 1.435