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.12,2.12,2.13,2.14,2.15,2.15,2.16,2.17,2.17,2.18,2.17,2.17,2.18,2.17,2.18,2.18,2.18,2.17,2.17,2.18,2.17,2.18,2.17,2.17,2.17,2.17,2.17,2.17,2.17,2.17,2.17,2.18,2.18,2.18,2.18,2.18,2.18,2.18,2.18,2.18,2.18,2.18,2.18,2.18,2.19,2.19,2.19,2.2,2.2,2.21,2.21,2.21,2.2,2.21,2.2,2.21,2.21,2.22,2.22,2.23,2.24,2.24,2.25,2.25,2.32,2.36,2.37,2.37,2.37,2.38,2.38,2.41,2.42,2.43,2.44,2.44,2.44,2.43,2.43,2.43,2.42,2.42,2.42,2.42,2.42) > 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/1z36n1260297652.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/2sgrk1260297652.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 2.174848e-01 2.095658e-01 1.662471e-02 3.954269e-02 [6] 1.476295e-01 3.692050e-02 2.859765e-01 -6.817705e-03 1.188903e-01 [11] -2.999790e-02 -6.875393e-02 -6.272289e-02 -1.668240e-01 -7.121880e-02 [16] -4.169289e-02 -5.989092e-02 -2.375708e-02 -4.562618e-02 -9.099014e-02 [21] -4.017202e-02 -4.295154e-02 -1.709671e-02 -4.557374e-02 -1.604783e-02 [26] -1.368785e-02 -1.132788e-02 -4.347598e-02 1.048978e-15 -3.214810e-02 [31] -2.978813e-02 -8.249423e-02 -1.846025e-02 -3.372142e-02 -4.195511e-03 [36] -3.634361e-02 -6.482064e-02 -5.585274e-02 -3.293476e-02 -4.452486e-02 [41] -4.583596e-02 2.847703e-02 -1.270191e-01 5.296832e-03 -7.457520e-02 [46] -1.421229e-02 -1.552339e-02 -1.262324e-01 -6.586952e-02 > (mypacf <- c(rpacf$acf)) [1] 0.217484791 0.170322313 -0.062949590 0.013003174 0.160589757 [6] -0.031469167 0.252974791 -0.115506982 0.055472843 -0.047125827 [11] -0.103158852 -0.086261792 -0.112918801 -0.113092386 0.096145134 [16] -0.110869462 0.063222702 0.043664655 -0.066362809 0.098284231 [21] 0.020579667 -0.049165651 0.034355866 -0.069265078 -0.011335687 [26] 0.013898336 -0.139933453 0.086370258 -0.064677913 -0.049639328 [31] -0.019230648 -0.012965370 -0.019161655 0.092713798 -0.136281196 [36] 0.047707793 -0.058182559 0.018016539 -0.032168083 -0.038479451 [41] 0.045894638 -0.134978819 0.015473590 -0.008420279 -0.059297807 [46] 0.038153117 -0.143785867 -0.098902377 > 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/3q7p91260297652.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/4b1e21260297652.tab") > > system("convert tmp/1z36n1260297652.ps tmp/1z36n1260297652.png") > system("convert tmp/2sgrk1260297652.ps tmp/2sgrk1260297652.png") > > > proc.time() user system elapsed 0.581 0.326 1.516