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(0.51,0.51,0.51,0.51,0.52,0.52,0.52,0.53,0.53,0.52,0.52,0.52,0.52,0.52,0.52,0.52,0.52,0.52,0.52,0.53,0.53,0.53,0.54,0.54,0.54,0.54,0.54,0.54,0.54,0.54,0.54,0.54,0.53,0.53,0.53,0.53,0.53,0.54,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.56,0.56,0.56,0.56,0.56,0.55,0.56,0.55,0.55,0.56,0.55,0.55,0.55,0.55) > 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/html/rcomp/tmp/18f421259503327.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/228lf1259503327.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.000000e+00 -1.657669e-01 -9.326219e-02 2.706005e-01 -1.667713e-01 [6] -1.621678e-01 -1.682360e-02 -8.999791e-02 6.028458e-02 1.229127e-01 [11] -2.416196e-01 -2.343587e-02 4.906884e-02 -2.426240e-01 -9.234149e-02 [16] 1.986817e-01 -2.017158e-02 5.233312e-02 1.248378e-01 5.660180e-02 [21] -8.941201e-02 5.593220e-02 -7.365558e-03 -2.762084e-03 1.425821e-01 [26] -7.627119e-02 -3.766478e-03 6.873823e-02 -1.550534e-01 -1.553882e-01 [31] 1.356351e-01 -1.037874e-02 -8.849132e-02 2.025319e-01 -8.916091e-02 [36] -1.665620e-02 5.584850e-02 -1.580665e-01 -2.845784e-03 6.965892e-02 [41] -3.515380e-03 1.088094e-03 1.464323e-01 -7.242101e-02 8.369952e-05 [46] 7.258841e-02 -1.413266e-01 4.017577e-03 1.493618e-01 > (mypacf <- c(rpacf$acf)) [1] -0.165766897 -0.124152395 0.242959254 -0.101652402 -0.175232134 [6] -0.169955682 -0.087833856 0.102313435 0.165292057 -0.255521217 [11] -0.253743376 -0.127379029 -0.101825951 -0.129025614 0.071436909 [16] -0.015337584 -0.032984337 -0.059478707 0.091602847 -0.133179321 [21] 0.024029924 0.045506036 0.043011772 0.053119708 -0.038678533 [26] -0.079259933 -0.010663976 -0.006076878 -0.060545914 0.057933802 [31] 0.119296680 -0.019193231 0.085806662 -0.128733264 0.020455073 [36] 0.019086460 0.022550456 -0.074382279 -0.111882410 0.028009728 [41] -0.008595037 0.066586701 -0.029138106 0.042952580 0.049077541 [46] -0.041804028 -0.036381638 0.059790322 > 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/3wjbl1259503327.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/415ft1259503327.tab") > > system("convert tmp/18f421259503327.ps tmp/18f421259503327.png") > system("convert tmp/228lf1259503327.ps tmp/228lf1259503327.png") > > > proc.time() user system elapsed 0.569 0.325 0.723