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(62,64,62,64,64,69,69,65,56,58,53,62,55,60,59,58,53,57,57,53,54,53,57,57,55,49,50,49,54,58,58,52,56,52,59,53,52,53,51,50,56,52,46,48,46,48,48,49,53,48,51,48,50,55,52,53,52,55,53,53,56,54,52,55,54,59,56,56,51,53,52,51,46,49,46,55,57,53,52,53,50,54,53,50,51,52,47,51,49,53,52,45,53,51,48,48,48,48,40,43,40,39,39,36,41,39,40,39,46,40,37,37,44,41,40,36,38,43,42,45,46) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1ws2m1259325632.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/20cbl1259325632.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.843505276 0.795729691 0.724456282 0.704261643 [6] 0.660743946 0.612380518 0.542584659 0.507169660 0.465717356 [11] 0.440962964 0.428013091 0.398826048 0.347078551 0.300017910 [16] 0.277249474 0.263362230 0.249077795 0.194057444 0.155687343 [21] 0.108690252 0.080774219 0.067220616 0.091606703 0.064914019 [26] 0.064928462 0.058206545 0.074744137 0.072264220 0.076711316 [31] 0.042122474 0.017606397 -0.001746196 -0.023545486 -0.046949428 [36] -0.048809727 -0.070084724 > (mypacf <- c(rpacf$acf)) [1] 0.8435052761 0.2919545084 0.0111759691 0.1421829835 0.0179362805 [6] -0.0548249328 -0.1074800580 0.0270979546 -0.0002775816 0.0249817304 [11] 0.0987233363 -0.0088290710 -0.1174760242 -0.0776751556 0.0309882986 [16] 0.0314853406 0.0294609583 -0.1018022566 -0.0416504609 -0.0769913734 [21] -0.0425363118 0.0570823262 0.2006076998 -0.0247703635 0.0309846729 [26] 0.0389143082 -0.0033921199 -0.0759059776 0.0178212373 -0.0636205186 [31] -0.0857779811 -0.0019152674 -0.0519703306 -0.0860173695 0.0657391793 [36] 0.0219331170 > 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/30i6v1259325632.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/4aeok1259325632.tab") > > system("convert tmp/1ws2m1259325632.ps tmp/1ws2m1259325632.png") > system("convert tmp/20cbl1259325632.ps tmp/20cbl1259325632.png") > > > proc.time() user system elapsed 0.554 0.313 0.648