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(100.09,100.09,100.06,100.11,100.08,100.08,100.08,100.08,99.94,99.79,99.98,99.98,99.98,99.98,99.93,99.93,99.93,99.93,99.93,99.93,99.76,99.48,99.55,99.56,99.57,99.56,99.65,99.5,99.5,99.49,99.49,99.46,99.52,99.49,99.55,99.57,99.57,99.57,99.57,99.57,99.57,99.57,99.57,99.53,100.38,100.32,100.46,100.47,100.47,100.47,100.51,100.5,100.51,100.51,100.51,100.51,101.65,102.13,102.2,102.13,102.13,102.12,102.13,102.05,102,102.01,102.01,102.02,102.78,103.39,103.41,103.5,103.5,103.49,103.38,103.24,103.25,103.25,103.25,103.25,103.83,104.33,104.36,104.48,104.5,104.48,104.35,104.48,104.48,104.47,104.47,104.86,105.22,105.96,106.03,106.03) > 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/1eb7v1260296741.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/2sc0v1260296741.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.962063965 0.919425093 0.875957446 0.841711885 [6] 0.811764419 0.787715980 0.764273766 0.741385902 0.718138002 [11] 0.695760154 0.670905357 0.642599875 0.604846317 0.563429272 [16] 0.521571110 0.485603122 0.456933934 0.429665764 0.403146189 [21] 0.377181510 0.350766586 0.321510805 0.289516103 0.255664083 [26] 0.215999429 0.172943322 0.130185695 0.093991611 0.067458112 [31] 0.041940132 0.017048909 -0.008026806 -0.033482420 -0.060092428 [36] -0.087875202 -0.116510058 -0.147484176 -0.182578447 -0.216911386 [41] -0.245537056 -0.259822865 -0.273944691 -0.287498923 -0.301722304 [46] -0.312774012 -0.324396527 -0.335976144 -0.348047446 > (mypacf <- c(rpacf$acf)) [1] 0.9620639646 -0.0825169624 -0.0296476665 0.1027726111 0.0247092809 [6] 0.0541122606 -0.0015420417 0.0019441942 -0.0003629004 0.0066254618 [11] -0.0402635894 -0.0555799816 -0.1353605134 -0.0645520591 -0.0356291374 [16] 0.0198610146 0.0435328927 -0.0351880405 -0.0075008456 0.0063611976 [21] -0.0124071479 -0.0457024630 -0.0440163818 -0.0324975326 -0.0922847524 [26] -0.0725116227 -0.0413855526 0.0163660505 0.0565374578 -0.0466957642 [31] -0.0140103649 0.0043374326 -0.0084990796 -0.0176589844 -0.0248107195 [36] -0.0224943862 -0.0462045721 -0.0876902612 -0.0352350638 0.0068286841 [41] 0.1079104707 -0.0621219416 -0.0154581663 0.0232303868 0.0510082062 [46] -0.0057593819 -0.0072013024 -0.0008376226 > 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/39gp21260296741.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/48o611260296741.tab") > > system("convert tmp/1eb7v1260296741.ps tmp/1eb7v1260296741.png") > system("convert tmp/2sc0v1260296741.ps tmp/2sc0v1260296741.png") > > > proc.time() user system elapsed 0.575 0.335 0.744