R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(7.08,7.08,7.09,7.07,7.06,6.99,6.99,6.99,6.98,6.96,6.95,6.91,6.91,6.87,6.91,6.89,6.88,6.9,6.91,6.85,6.86,6.82,6.8,6.83,6.84,6.89,7.14,7.21,7.25,7.31,7.3,7.48,7.49,7.4,7.44,7.42,7.14,7.24,7.33,7.61,7.66,7.69,7.7,7.68,7.71,7.71,7.72,7.68,7.72,7.74,7.76,7.9,7.97,7.96,7.95,7.97,7.93,7.99,7.96,7.92,7.97,7.98,8,8.04,8.17,8.29,8.26,8.3,8.32,8.28,8.27,8.32,8.31,8.34,8.32,8.36,8.33,8.35,8.34,8.37,8.31,8.33,8.34,8.25) > 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/rcomp/tmp/1jflb1290249412.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/rcomp/tmp/2jflb1290249412.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.129065272 0.042122824 0.010136737 -0.103930343 [6] -0.117689698 -0.027111176 -0.100703741 0.051025074 -0.052289872 [11] -0.135718075 0.140751269 0.158535147 0.247808725 0.168274111 [16] -0.130069301 -0.119131828 -0.013725498 -0.144908590 -0.148064514 [21] -0.006317005 -0.091198855 -0.016385880 0.063877513 0.017649325 [26] 0.188533507 0.101135846 -0.035048520 -0.120686024 -0.128421393 [31] -0.075980624 -0.018808674 -0.111681031 0.042487726 0.040087455 [36] -0.084088390 0.043662834 0.027912680 0.064967246 0.012696862 [41] 0.031913144 -0.060925831 -0.006812913 -0.096629273 -0.042904804 [46] -0.037997387 -0.075500658 0.079778820 -0.002037929 > (mypacf <- c(rpacf$acf)) [1] 0.1290652724 0.0258963573 0.0015250195 -0.1083607034 -0.0942718257 [6] 0.0058786098 -0.0913298668 0.0697430518 -0.0853728496 -0.1400167827 [11] 0.1683628078 0.1344019506 0.2306736656 0.0690455102 -0.2010521293 [16] -0.0882453885 0.0782213242 -0.0101174516 -0.1702893907 -0.0422531587 [21] -0.0714624157 0.0232842798 0.1448834590 -0.0780627334 -0.0060103413 [26] -0.0130226508 0.0041294092 -0.0867739580 -0.0639927880 0.0041260643 [31] -0.0074188779 0.0140550688 0.0893354719 -0.0411523798 -0.1049684760 [36] -0.0003801398 -0.0620119247 0.0202403215 -0.0618049516 0.0772220585 [41] 0.0438035304 0.0639015672 -0.0730046504 -0.0688350770 -0.0300678096 [46] -0.1063567683 0.0783836639 -0.0424570197 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3xpik1290249412.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/rcomp/tmp/48yzn1290249412.tab") > > try(system("convert tmp/1jflb1290249412.ps tmp/1jflb1290249412.png",intern=TRUE)) character(0) > try(system("convert tmp/2jflb1290249412.ps tmp/2jflb1290249412.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.860 0.450 1.282