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(0.51,0.51,0.51,0.51,0.52,0.52,0.52,0.53,0.53,0.52,0.52,0.52,0.52,0.52,0.52,0.52,0.52,0.52,0.52,0.53,0.53,0.53,0.54,0.54,0.54,0.54,0.54,0.54,0.54,0.54,0.54,0.54,0.53,0.53,0.53,0.53,0.53,0.54,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.56,0.56,0.56,0.56,0.56,0.55,0.56,0.55,0.55,0.56,0.55,0.55,0.55,0.55) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1aj9h1259925085.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/22cjc1259925085.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.00000000 0.91504918 0.84491501 0.78218916 0.68983002 0.62241223 [7] 0.57956538 0.53671852 0.51140470 0.48843684 0.42101906 0.37582623 [13] 0.33063341 0.27803227 0.24765609 0.23444252 0.19900399 0.16356546 [19] 0.12071861 0.06305511 0.01786229 -0.01992221 -0.06511503 -0.08067457 [25] -0.08647981 -0.10710170 -0.12031527 -0.13352883 -0.15415072 -0.16971025 [31] -0.17045314 -0.18601268 -0.20157221 -0.22960242 -0.27985760 -0.32270445 [37] -0.36555130 -0.41580648 -0.43136601 -0.41729226 -0.41062683 -0.40396139 [43] -0.38754167 -0.38593859 -0.37692719 -0.36791579 -0.36631271 -0.33001399 [49] -0.29371527 -0.27223320 -0.23593448 -0.19963576 -0.20037865 -0.17383422 [55] -0.15741450 -0.14099477 -0.10469605 -0.07852204 -0.05234803 -0.02617401 > (mypacf <- c(rpacf$acf)) [1] 0.915049183 0.046716065 0.014913294 -0.209841921 0.077198109 [6] 0.122481280 0.034760665 0.051735140 -0.024467966 -0.277369633 [11] 0.063581456 0.010439614 0.049743531 0.025972684 0.055157962 [16] -0.163663121 -0.110396121 -0.089912143 0.024972012 0.022203258 [21] 0.046169053 -0.117083689 0.037201354 -0.016610544 0.009041070 [26] -0.016892830 0.033941285 -0.016393554 -0.028400977 0.034965054 [31] -0.067097777 -0.122782778 -0.131281355 -0.133456396 -0.005688120 [36] -0.022678853 -0.054340613 0.071481273 0.092295937 -0.019825148 [41] -0.118620451 0.051416475 0.024578273 0.083335580 -0.014327470 [46] -0.040585402 0.082091368 0.005815609 -0.002578783 0.090120168 [51] 0.043719178 -0.131440404 0.079873011 -0.102762308 0.038004755 [56] -0.036240703 0.006240955 0.017013133 -0.088674567 > 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/3w1k41259925085.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/4senf1259925085.tab") > > system("convert tmp/1aj9h1259925085.ps tmp/1aj9h1259925085.png") > system("convert tmp/22cjc1259925085.ps tmp/22cjc1259925085.png") > > > proc.time() user system elapsed 0.583 0.344 1.026