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(16198.90,16554.20,19554.20,15903.80,18003.80,18329.60,16260.70,14851.90,18174.10,18406.60,18466.50,16016.50,17428.50,17167.20,19630.00,17183.60,18344.70,19301.40,18147.50,16192.90,18374.40,20515.20,18957.20,16471.50,18746.80,19009.50,19211.20,20547.70,19325.80,20605.50,20056.90,16141.40,20359.80,19711.60,15638.60,14384.50,13721.40,14134.30,15021.70,14212.60,13635.00,15446.90,14762.10,12521.00,16236.80,16065.00,16032.10,15794.30,15160.00,15692.10,18908.90,17424.50,17014.20,19790.40,17681.20,16006.90,19601.70) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1k1561293659637.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/2dsm91293659637.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/361mu1293659637.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.8461498866 0.7900509627 0.7267531636 0.5234844124 [6] 0.4025364952 0.2385770864 0.0233683522 -0.0876517221 -0.2401095147 [11] -0.3667302913 -0.4422182742 -0.5009953983 -0.5136563152 -0.4927579903 [16] -0.4666058871 -0.4340394498 -0.3705219762 -0.3028406013 -0.2480334522 [21] -0.1746075172 -0.1300287749 -0.0923004591 -0.0256733642 -0.0305443229 [26] -0.0001713744 0.0229594032 0.0067148219 0.0421372691 0.0566333763 [31] 0.0348739581 0.0678948035 0.0684684560 0.0620528547 0.0798329148 [36] 0.0856775265 0.0631850581 0.0653881778 0.0626150551 0.0396175371 [41] 0.0343703863 0.0316065409 0.0164107624 0.0170875011 0.0110399235 > (mypacf <- c(rpacf$acf)) [1] 0.84614989 0.26082187 0.04501957 -0.54677884 -0.16840532 -0.19082565 [7] -0.22276089 0.06622701 0.02758819 0.06676871 -0.11949879 0.08098270 [13] 0.07451511 0.05278472 -0.06577421 -0.26421767 -0.14076210 -0.06973875 [19] 0.00890944 0.04585673 -0.05266544 -0.08422093 0.05190439 -0.10896244 [25] 0.06872071 -0.04320452 -0.06553636 -0.03000201 0.05409047 -0.04020208 [31] -0.06007641 -0.03428450 -0.10038152 -0.07516174 0.07893296 -0.10378120 [37] -0.11668246 -0.01175853 0.06746923 0.04845875 0.05347893 0.03313472 [43] -0.14228623 -0.11472299 > 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/4rk201293659637.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/5cki61293659637.tab") > > try(system("convert tmp/1k1561293659637.ps tmp/1k1561293659637.png",intern=TRUE)) character(0) > try(system("convert tmp/2dsm91293659637.ps tmp/2dsm91293659637.png",intern=TRUE)) character(0) > try(system("convert tmp/361mu1293659637.ps tmp/361mu1293659637.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.80 0.64 1.45