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 = '0' > par2 = '1' > 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/18e5q1259853530.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/2mq6t1259853530.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.936824448 0.848004686 0.748609142 0.636273955 [6] 0.516723487 0.398528781 0.280699737 0.176793193 0.091168260 [11] 0.025570691 -0.017439108 -0.044786771 -0.070718057 -0.102283417 [16] -0.140860482 -0.179390924 -0.217526804 -0.250662681 -0.281071073 [21] -0.308424080 -0.337199160 -0.357532938 -0.375580557 -0.385714060 [26] -0.389218326 -0.383708679 -0.375482236 -0.364562553 -0.345189544 [31] -0.325520068 -0.303843671 -0.276156077 -0.246673434 -0.216411652 [36] -0.181786891 -0.150377493 -0.117661065 -0.087783086 -0.058749716 [41] -0.033731734 -0.004028851 0.022410501 0.044140763 0.065239273 [46] 0.084964372 0.098086253 0.112367844 0.128071367 0.142475244 [51] 0.152680480 0.155636050 0.152556443 0.143046886 0.127150272 [56] 0.109440820 0.089973379 0.068820167 0.048491944 0.025326749 > (mypacf <- c(rpacf$acf)) [1] 0.9368244478 -0.2421981971 -0.0984097989 -0.1454655910 -0.0971641401 [6] -0.0458644169 -0.0803162782 0.0359998275 0.0347731974 0.0469333978 [11] 0.0617388366 -0.0065300350 -0.1073954337 -0.1449495926 -0.1334934202 [16] -0.0416804846 -0.0300638489 0.0353295235 0.0078855863 -0.0028852416 [21] -0.0813487607 -0.0223877653 -0.1192116832 -0.0541528762 -0.0563049447 [26] 0.0152287244 -0.0115929121 -0.0061745207 0.0450202616 -0.0721665730 [31] -0.0495543830 -0.0279992248 -0.0406924701 -0.0195342849 0.0287155816 [36] -0.0284961944 0.0304297479 -0.0542483977 -0.0084607139 -0.0659230676 [41] 0.0366709951 -0.0418710286 -0.0182908751 0.0125649378 -0.0005716559 [46] -0.0545158402 0.0132742910 0.0016223671 -0.0103668128 -0.0217638903 [51] -0.0615028461 -0.0259280546 -0.0676239108 -0.0482239490 -0.0213566184 [56] -0.0039317346 -0.0159593811 0.0151264481 -0.0683544452 > 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/3re1d1259853530.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/4tujo1259853530.tab") > > system("convert tmp/18e5q1259853530.ps tmp/18e5q1259853530.png") > system("convert tmp/2mq6t1259853530.ps tmp/2mq6t1259853530.png") > > > proc.time() user system elapsed 0.605 0.325 1.006