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(1.4,1.2,1,1.7,2.4,2,2.1,2,1.8,2.7,2.3,1.9,2,2.3,2.8,2.4,2.3,2.7,2.7,2.9,3,2.2,2.3,2.8,2.8,2.8,2.2,2.6,2.8,2.5,2.4,2.3,1.9,1.7,2,2.1,1.7,1.8,1.8,1.8,1.3,1.3,1.3,1.2,1.4,2.2,2.9,3.1,3.5,3.6,4.4,4.1,5.1,5.8,5.9,5.4,5.5,4.8,3.2,2.7,2.1,1.9,0.6,0.7,-0.2,-1,-1.7,-0.7,-1) > 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: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), 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: Office for Research, Development, and Education > #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 (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > 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/1ncad1259602927.ps",horizontal=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=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2xf4b1259602927.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.0000000000 0.1739815537 0.1349291899 0.1824364316 0.2760221700 [6] 0.0372630028 0.0622807396 0.0604776594 -0.0254528279 -0.1801845413 [11] -0.0878315610 0.0525989832 -0.4435733912 -0.2229802563 -0.0797510182 [16] 0.0063049009 -0.1728154312 -0.1196108483 -0.0392189527 0.0051564172 [21] -0.1023639948 0.0065479247 0.0863067823 -0.0520992164 -0.0339449433 [26] 0.1060524696 0.0513074291 -0.0622768198 0.0363732219 0.0554603930 [31] 0.0493593186 -0.0434013147 0.0534162489 0.0930604933 -0.0001332711 [36] -0.0667061254 0.0975466351 -0.0038766223 -0.0201729389 0.0281006119 [41] 0.0318949196 -0.0104892227 -0.0317498893 0.0545392542 0.0540688855 [46] -0.0574829785 -0.0605188167 0.0537905840 -0.0378039268 -0.0122197876 [51] 0.0570772855 -0.0636036516 -0.0602424751 -0.0201650994 -0.0247335557 [56] -0.0791787362 -0.0709864808 -0.0251118106 0.0099678973 -0.0494749509 [61] -0.0076650504 > (mypacf <- c(rpacf$acf)) [1] 0.1739815537 0.1079264988 0.1489069529 0.2275841338 -0.0665662657 [6] -0.0053116922 -0.0187296124 -0.1040739219 -0.1903746838 -0.0665369450 [11] 0.1242836808 -0.4395211961 -0.0350664199 0.0612743092 0.1354276506 [16] 0.0780885545 -0.0937509426 0.0079190596 0.0305594520 -0.0662320631 [21] -0.1163946975 0.0106173088 0.0557767408 -0.2162881862 0.0309827534 [26] -0.0149285294 0.0453437058 0.1219249454 -0.1126143399 0.0371183716 [31] 0.0177053501 0.0045506253 0.0002110332 -0.0029016495 -0.0530317581 [36] -0.0449990510 -0.0080303698 -0.0220961864 0.0739120359 0.0561160428 [41] -0.0692357509 0.0471212481 0.0635509849 0.0198061032 -0.0250820806 [46] -0.0499248122 -0.0626377533 -0.0383642856 0.0340233867 0.0978054675 [51] -0.0987088074 -0.0030097687 -0.0103550711 -0.0524093503 -0.0307808976 [56] 0.0144308420 0.0422192338 -0.0381095580 -0.0242125616 0.0021988677 > 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/34b431259602927.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/487e81259602927.tab") > > system("convert tmp/1ncad1259602927.ps tmp/1ncad1259602927.png") > system("convert tmp/2xf4b1259602927.ps tmp/2xf4b1259602927.png") > > > proc.time() user system elapsed 0.603 0.335 0.726