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(12008,9169,8788,8417,8247,8197,8236,8253,7733,8366,8626,8863,10102,8463,9114,8563,8872,8301,8301,8278,7736,7973,8268,9476,11100,8962,9173,8738,8459,8078,8411,8291,7810,8616,8312,9692,9911,8915,9452,9112,8472,8230,8384,8625,8221,8649,8625,10443,10357,8586,8892,8329,8101,7922,8120,7838,7735,8406,8209,9451,10041,9411,10405,8467,8464,8102,7627,7513,7510,8291,8064,9383) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > 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/rcomp/tmp/137m61293190707.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=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/237m61293190707.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') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.00000000 0.42070102 0.22705716 -0.02636525 -0.26914064 -0.33709862 [7] -0.42943826 -0.34829820 -0.32642871 -0.05789044 0.08101548 0.28219794 [13] 0.59120512 0.24879323 0.23725946 0.03182221 -0.16458030 -0.22626715 [19] -0.31235812 -0.26463224 -0.27992004 -0.07700530 0.04202977 0.32289553 [25] 0.52832945 0.16109502 0.12698821 -0.05180587 -0.19838796 -0.22807016 [31] -0.26282769 -0.21167071 -0.19647594 -0.01907414 0.03734683 0.25939431 [37] 0.35834844 0.15423185 0.18595005 -0.02902776 -0.15180871 -0.17948592 [43] -0.21037955 -0.15427000 -0.14404555 0.00629245 0.06796916 0.26935764 [49] 0.27603061 0.08584417 0.11172375 -0.02920112 -0.07817467 -0.10945934 [55] -0.14157256 -0.12877394 -0.13633099 -0.03560777 -0.02447016 0.12150110 [61] 0.15649398 > (mypacf <- c(rpacf$acf)) [1] 0.420701025 0.060834943 -0.172776457 -0.270365442 -0.146615804 [6] -0.235724134 -0.137321988 -0.258258508 0.016646420 -0.067661526 [11] 0.076723886 0.393170986 -0.295758748 0.049811428 0.004813456 [16] -0.096383784 0.033709554 -0.024883446 -0.009627731 -0.050476563 [21] -0.065582287 0.082336800 0.201178296 0.155190559 -0.263493508 [26] -0.156145310 0.035647197 -0.068623789 -0.013121590 0.020719701 [31] -0.017312798 -0.008375076 -0.065019073 -0.079664597 -0.053646665 [36] -0.048970355 0.062264918 0.020233029 -0.094185661 -0.027744790 [41] -0.007532648 -0.007874092 0.083902968 0.032478875 0.040706328 [46] -0.014116895 -0.062001873 0.004390051 0.013543663 0.041536863 [51] 0.129103783 0.090288017 0.013982515 -0.039636249 -0.052269005 [56] -0.032764329 -0.018304708 -0.041181437 -0.084263804 0.010978686 > 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/3zhkf1293190707.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/4a81i1293190707.tab") > > try(system("convert tmp/137m61293190707.ps tmp/137m61293190707.png",intern=TRUE)) character(0) > try(system("convert tmp/237m61293190707.ps tmp/237m61293190707.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.67 0.43 1.08