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(2.05,2.11,2.09,2.05,2.08,2.06,2.06,2.08,2.07,2.06,2.07,2.06,2.09,2.07,2.09,2.28,2.33,2.35,2.52,2.63,2.58,2.70,2.81,2.97,3.04,3.28,3.33,3.50,3.56,3.57,3.69,3.82,3.79,3.96,4.06,4.05,4.03,3.94,4.02,3.88,4.02,4.03,4.09,3.99,4.01,4.01,4.19,4.30,4.27,3.82,3.15,2.49,1.81,1.26,1.06,0.84,0.78,0.70,0.36,0.35) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '2' > par2 = '-2.0' > par1 = '60' > #'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/1oc7h1259954917.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/2b6pu1259954917.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.4849964282 -0.0427596725 0.0530788184 -0.0311526310 [6] 0.0234110244 -0.0090876053 -0.0052292910 -0.0008693093 -0.0005728645 [11] -0.0008364354 -0.0001633657 -0.0006893782 0.0004556681 -0.0003577932 [16] 0.0007115951 -0.0005210343 0.0004392501 -0.0012100218 0.0014853962 [21] -0.0012130266 0.0007259681 -0.0002659319 0.0003431908 -0.0001254054 [26] -0.0009401860 0.0012264180 -0.0005504144 -0.0005722754 0.0007613140 [31] 0.0001530981 -0.0010091222 0.0015760496 -0.0020324407 0.0015679293 [36] -0.0009409152 0.0004225069 -0.0021256808 0.0035106605 -0.0007088595 [41] -0.0032621518 0.0025513854 0.0022047182 -0.0059356564 0.0022551789 [46] 0.0017899167 -0.0019498424 0.0012514838 -0.0009456220 0.0003555860 [51] 0.0007165171 -0.0012032759 0.0001068543 0.0014915334 -0.0026439864 [56] 0.0019666080 0.0012300805 -0.0009181263 > (mypacf <- c(rpacf$acf)) [1] -0.48499643 -0.36347939 -0.22822802 -0.19761864 -0.13293471 -0.10756098 [7] -0.09187612 -0.08510719 -0.07815367 -0.07399656 -0.06938859 -0.06590904 [13] -0.06128754 -0.05776580 -0.05304158 -0.04999325 -0.04629969 -0.04547220 [19] -0.04169997 -0.04087105 -0.03825477 -0.03677096 -0.03434347 -0.03270031 [25] -0.03268740 -0.03041048 -0.02941578 -0.02928571 -0.02783476 -0.02611188 [31] -0.02637458 -0.02364426 -0.02507542 -0.02304089 -0.02343792 -0.02233798 [37] -0.02569254 -0.02152580 -0.01974736 -0.02345190 -0.02241691 -0.01741836 [43] -0.02380948 -0.02497296 -0.02315137 -0.02427110 -0.02330861 -0.02409476 [49] -0.02390271 -0.02289620 -0.02402036 -0.02483575 -0.02291953 -0.02604043 [55] -0.02497548 -0.02215926 -0.02095984 > 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/3rwfe1259954917.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/48w9a1259954917.tab") > > system("convert tmp/1oc7h1259954917.ps tmp/1oc7h1259954917.png") > system("convert tmp/2b6pu1259954917.ps tmp/2b6pu1259954917.png") > > > proc.time() user system elapsed 0.590 0.305 1.113