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(10.1200,10.1200,10.0500,10.1400,10.1700,10.2000,10.2000,10.3500,10.4300,10.5200,10.5700,10.5700,10.5700,10.6500,10.5700,10.6100,10.6300,10.7100,10.7200,10.7700,10.7900,10.8200,10.9000,10.8300,10.9200,10.9100,10.8800,10.8700,11.0000,10.9900,11.0300,11.0400,10.9900,10.9000,11.0000,10.9900,10.9200,10.9800,11.1500,11.1900,11.3300,11.3800,11.4000,11.4500,11.5600,11.6100,11.8200,11.7700,11.8500,11.8200,11.9200,11.8600,11.8700,11.9400,11.8600,11.9200,11.8300,11.9100,11.9300,11.9900,11.9600,12.1200,11.8500,12.0100,12.1000,12.2100,12.3100,12.3100,12.3900,12.3500,12.4100,12.5100) > 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/16k341260304260.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/249ew1260304260.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.950196437 0.905793916 0.856324236 0.807176592 [6] 0.758700499 0.710784717 0.662962074 0.622485847 0.586849364 [11] 0.559078799 0.521704774 0.488634863 0.453921536 0.421658111 [16] 0.388596263 0.356697823 0.322621162 0.292155506 0.256727021 [21] 0.223679654 0.189776434 0.151458353 0.118074635 0.079770377 [26] 0.046454291 0.008358196 -0.024377667 -0.058308204 -0.083962585 [31] -0.110370300 -0.136060883 -0.162919152 -0.185153904 -0.212319563 [36] -0.229359297 -0.246210615 -0.269299904 -0.293566917 -0.308040408 [41] -0.326303119 -0.342418216 -0.357244184 -0.371116718 -0.384461029 [46] -0.389829004 -0.393658714 -0.392857831 -0.393879236 > (mypacf <- c(rpacf$acf)) [1] 0.9501964372 0.0300704728 -0.0726476900 -0.0285635031 -0.0177802793 [6] -0.0209600382 -0.0272030583 0.0470318512 0.0328220328 0.0571209110 [11] -0.1163496328 0.0030068681 -0.0267004747 -0.0011134386 -0.0250675447 [16] -0.0066158489 -0.0313024393 0.0047085133 -0.0729131844 -0.0223569123 [21] -0.0148761508 -0.0814673224 0.0221499586 -0.0794188859 0.0182530106 [26] -0.0854417337 0.0197931044 -0.0542031501 0.0590259153 -0.0421058030 [31] -0.0337465268 -0.0346109372 -0.0018601992 -0.0639114557 0.0511857522 [36] 0.0124138494 -0.1132536453 -0.0331801312 0.0442909858 -0.0355104575 [41] -0.0454906051 0.0171791254 -0.0337540112 -0.0035666514 0.0189186669 [46] 0.0004957597 0.0353429019 -0.0394187646 > 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/3o8rq1260304260.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/4eo691260304260.tab") > > system("convert tmp/16k341260304260.ps tmp/16k341260304260.png") > system("convert tmp/249ew1260304260.ps tmp/249ew1260304260.png") > > > proc.time() user system elapsed 0.580 0.305 1.409