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 = '1' > 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/1hcut1260426355.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/2k8rk1260426355.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.0000000000 0.0358917004 0.1945286452 -0.0235222131 -0.0012522956 [6] 0.1484775249 0.0588936565 0.1215365692 -0.0423180937 0.0067552554 [11] -0.0099826600 0.0099970673 0.0037850751 0.0192963204 -0.0569716210 [16] -0.0538587345 -0.0517230952 0.1145080308 0.0667219990 0.0473880374 [21] 0.1237124122 -0.1245212137 0.1228214378 -0.0009959255 0.0156044657 [26] -0.0401114430 -0.0412954606 0.0823545390 -0.0138462634 0.0501916512 [31] 0.0193545191 -0.0797780252 -0.0398355974 -0.0660102901 -0.0136993431 [36] -0.0639695226 -0.0172982623 0.0919168249 -0.0652090054 0.0667065667 [41] -0.0114860298 -0.0240911589 -0.0349655905 -0.0002450948 0.0788991233 [46] 0.0312249901 0.0900708121 0.0180773951 -0.1165717475 > (mypacf <- c(rpacf$acf)) [1] 0.0358917004 0.1934896872 -0.0375502923 -0.0384424801 0.1686796300 [6] 0.0579224902 0.0566278087 -0.0623002277 -0.0137465527 -0.0001290618 [11] -0.0047359804 -0.0302963931 0.0242875352 -0.0580030919 -0.0516865724 [16] -0.0282249362 0.1499091020 0.0685824351 0.0005812046 0.1341224167 [21] -0.1087028477 0.0674795742 0.0217722689 -0.0814009070 -0.0888918992 [26] -0.0064497725 0.0846593624 0.0016171798 -0.0098830503 0.0542677537 [31] -0.0682359045 -0.0366809214 -0.0275279810 -0.0110835644 -0.0776603440 [36] -0.0197807836 0.1263650236 -0.0193004555 0.0110439921 0.0077587154 [41] -0.0043208553 -0.0735975421 0.0526729298 0.0883479338 0.0154655031 [46] 0.0247030249 0.0038295299 -0.1292854899 > 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/3tigg1260426355.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/4hona1260426355.tab") > > system("convert tmp/1hcut1260426355.ps tmp/1hcut1260426355.png") > system("convert tmp/2k8rk1260426355.ps tmp/2k8rk1260426355.png") > > > proc.time() user system elapsed 0.583 0.302 1.195