R version 2.10.1 (2009-12-14) 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(0.3,-0.1,-1,-1.2,-0.8,-1.7,-1.1,-0.4,0.6,0.6,1.9,2.3,2.6,3.1,4.7,5.5,5.4,5.9,5.8,5.2,4.2,4.4,3.6,3.5,3.1,2.9,2.2,1.5,1.1,1.4,1.3,1.3,1.8,1.8,1.8,1.7,1.6,1.5,1.2,1.2,1.6,1.6,1.9,2.2,2,1.7,2.4,2.6,2.9,2.6,2.5,3.2,3.1,3.1,2.9,2.5,2.8,3.1,2.6,2.3) > par8 = '' > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '1' > 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/yougetitorg/rcomp/tmp/1xxyj1293657803.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/yougetitorg/rcomp/tmp/276x41293657803.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/yougetitorg/rcomp/tmp/376x41293657803.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.2878706941 0.2216845316 0.2505039858 0.2940020020 [6] -0.0854996361 0.0083310511 0.0505545491 -0.0864969896 -0.2265296050 [11] -0.1876868207 -0.0792099744 -0.4998526304 -0.3155203447 -0.1315552931 [16] -0.0528028052 -0.1943583619 0.0513668211 -0.0049904292 0.0089344427 [21] -0.1211612505 -0.0080075702 0.0570924507 -0.0135113216 -0.0414295328 [26] 0.1190757418 0.0193524671 -0.0606157743 0.0140863377 0.0057395428 [31] -0.0177070534 -0.0241420709 0.1232075828 0.1343673981 0.0728796717 [36] 0.0116187664 0.1493879310 0.0176072814 0.0119715381 0.0492913810 [41] 0.0243434455 -0.0726147725 0.0086759509 0.0237133260 -0.0776949050 [46] -0.0887959555 -0.0692437614 0.0029309161 -0.0557485497 -0.0345762053 [51] -0.0008314941 -0.0503733119 -0.0217374749 0.0542607574 -0.0003899345 [56] -0.0230264555 0.0293931887 0.0346340547 0.0092324771 > (mypacf <- c(rpacf$acf)) [1] 0.287870694 0.151357959 0.170485166 0.190638750 -0.293236230 [6] -0.022095371 0.027942252 -0.113544591 -0.113999257 -0.159134032 [11] 0.064141869 -0.448296888 -0.030432598 0.114896544 0.119200428 [16] 0.120215417 -0.020633196 -0.138745620 -0.004422606 -0.224451485 [21] -0.158013389 0.021761418 0.025706668 -0.209566383 0.007567160 [26] -0.062429967 0.079351929 0.068162818 -0.005174339 -0.050852215 [31] -0.033253142 -0.013552510 -0.046260632 0.006863086 -0.006726605 [36] -0.085368653 -0.021348454 -0.019978560 0.032331165 -0.058173043 [41] -0.073568655 0.022978889 0.077230441 -0.064300691 0.022831823 [46] -0.002490390 0.005561893 0.012910180 -0.089752518 -0.046519537 [51] -0.104237942 0.031769703 0.021861871 -0.020438667 0.081774762 [56] -0.037729134 0.037795473 -0.002043670 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/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/yougetitorg/rcomp/tmp/4spds1293657803.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/yougetitorg/rcomp/tmp/5wqcg1293657803.tab") > > try(system("convert tmp/1xxyj1293657803.ps tmp/1xxyj1293657803.png",intern=TRUE)) character(0) > try(system("convert tmp/276x41293657803.ps tmp/276x41293657803.png",intern=TRUE)) character(0) > try(system("convert tmp/376x41293657803.ps tmp/376x41293657803.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.010 0.640 1.228