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(282965,276610,277838,277051,277026,274960,270073,267063,264916,287182,291109,292223,288109,281400,282579,280113,280331,276759,275139,274275,271234,289725,290649,292223,278429,269749,265784,268957,264099,255121,253276,245980,235295,258479,260916,254586,250566,243345,247028,248464,244962,237003,237008,225477,226762,247857,248256,246892,245021,246186,255688,264242,268270,272969,273886,267353,271916,292633,295804,293222) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/11thd1259357923.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/2wvrz1259357923.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.000000000 0.102081354 0.317994322 0.324885551 0.230165423 [6] 0.081735769 0.176771287 0.065462249 0.151207363 0.094200037 [11] -0.100779113 0.346576818 -0.189050292 0.009629933 0.056000707 [16] 0.062149445 -0.087583292 0.100729193 -0.158204254 -0.038922198 [21] -0.140162532 -0.235847035 -0.072899407 -0.234965571 -0.156216690 [26] -0.151777448 -0.069699010 -0.228373067 -0.106260465 -0.174911799 [31] -0.076484282 -0.078992975 -0.096489740 -0.011926170 -0.045954733 [36] -0.004224117 -0.051857457 > (mypacf <- c(rpacf$acf)) [1] 0.102081354 0.310812573 0.302898252 0.141526991 -0.120024591 [6] -0.030900451 -0.042042922 0.115045677 0.081019610 -0.237319285 [11] 0.311659849 -0.263377878 -0.072909636 0.048380134 0.112475423 [16] 0.044008713 -0.044781252 -0.224734569 -0.147007558 -0.110157708 [21] -0.002984019 -0.083922274 0.050637925 0.008337651 -0.107137408 [26] 0.035261206 -0.030692858 -0.127079821 0.102411037 -0.005659874 [31] 0.109096298 -0.025446369 0.001319255 -0.019187819 0.069821122 [36] 0.053090795 > 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/3z4x21259357923.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/4raor1259357923.tab") > system("convert tmp/11thd1259357923.ps tmp/11thd1259357923.png") > system("convert tmp/2wvrz1259357923.ps tmp/2wvrz1259357923.png") > > > proc.time() user system elapsed 0.547 0.316 0.665