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(5.2100,5.2300,5.2300,5.2300,5.2200,5.2100,5.2300,5.2500,5.2300,5.2300,5.2500,5.2400,5.2600,5.2700,5.2600,5.2900,5.2900,5.2900,5.2900,5.3100,5.3300,5.3400,5.3400,5.3700,5.4100,5.4100,5.3800,5.4400,5.4400,5.4600,5.4600,5.4500,5.4600,5.4600,5.4800,5.4700,5.4800,5.5100,5.5500,5.5800,5.5900,5.6000,5.6000,5.6700,5.7100,5.7000,5.7300,5.7200,5.7500,5.7500,5.7700,5.8300,5.8500,5.8700,5.8600,5.8700,5.9300,5.9700,5.9800,5.9900,5.9900,6.0300,6.0600,6.0700,6.0800,6.0800,6.1000,6.1300,6.1400,6.1400,6.1600,6.2000,6.1900,6.3200,6.3200,6.3300,6.3200,6.3300,6.3800,6.4200,6.4600,6.4700,6.4200,6.4800,6.4700,6.4900,6.4800,6.5100,6.5100,6.5200,6.5700,6.5900,6.6200,6.6300,6.6100,6.6400,6.6900,6.6900,6.7500,6.7700,6.8100,6.8100,6.8100,6.8700,6.8600,6.8800,6.8800,6.9200,6.9200,6.9900,7.0200,7.0500,7.0600,7.0600,7.0900,7.1200,7.2300,7.3100,7.4500,7.4900,7.5400,7.5500,7.5800,7.6000,7.6300,7.6400,7.6300,7.6600,7.6400,7.6900,7.7000,7.6800) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1r8421260426250.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/2tpo61260426250.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.978000921 0.955198004 0.931707026 0.908618478 0.884381826 [7] 0.859779943 0.834531589 0.808948857 0.783127877 0.757064178 0.731243709 [13] 0.704852916 0.679088779 0.653611806 0.630264165 0.608399515 0.588240804 [19] 0.567990134 0.547714875 0.527109032 0.506269204 0.485800912 0.465243304 [25] 0.445959803 0.426683547 0.407765958 0.388020623 0.368853198 0.349019828 [31] 0.330086727 0.310650332 0.290708172 0.271260569 0.251819910 0.233377274 [37] 0.214423588 0.196149567 0.178282408 0.160179094 0.142128278 0.124376345 [43] 0.106746112 0.089721740 0.073388541 0.057059945 0.040745240 0.024094325 [49] 0.007276156 > (mypacf <- c(rpacf$acf)) [1] 0.9780009208 -0.0295948642 -0.0271588625 -0.0023485576 -0.0386198415 [6] -0.0206538090 -0.0269817765 -0.0212947045 -0.0184960563 -0.0196318478 [11] -0.0083181382 -0.0276798692 -0.0003370148 -0.0081758691 0.0328853592 [16] 0.0193075254 0.0230031707 -0.0162279581 -0.0166101978 -0.0227922389 [21] -0.0227629509 -0.0076010675 -0.0181254300 0.0136770361 -0.0139657008 [26] -0.0075896540 -0.0315959929 -0.0018303746 -0.0263546241 0.0079711691 [31] -0.0213308621 -0.0259767696 -0.0020761082 -0.0175049837 0.0052490346 [36] -0.0270850338 -0.0010264823 -0.0020601748 -0.0225882078 -0.0107577457 [41] -0.0125442914 -0.0138424784 -0.0047181067 -0.0002800180 -0.0169560490 [46] -0.0171677176 -0.0236771988 -0.0227103632 > 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/3rqdc1260426251.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/4ybvm1260426251.tab") > > system("convert tmp/1r8421260426250.ps tmp/1r8421260426250.png") > system("convert tmp/2tpo61260426250.ps tmp/2tpo61260426250.png") > > > proc.time() user system elapsed 0.561 0.306 1.193