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(1.2,1.21,1.21,1.21,1.21,1.21,1.21,1.2,1.21,1.22,1.22,1.23,1.22,1.23,1.23,1.23,1.23,1.23,1.22,1.22,1.23,1.24,1.24,1.25,1.25,1.25,1.26,1.26,1.26,1.26,1.27,1.27,1.29,1.31,1.32,1.32,1.33,1.33,1.32,1.32,1.31,1.3,1.31,1.29,1.3,1.3,1.32,1.31,1.35,1.35,1.36,1.37,1.37,1.37,1.32,1.32,1.31,1.31,1.34,1.31,1.27,1.28,1.27,1.26,1.27,1.27,1.28,1.27,1.26,1.3,1.31,1.28,1.29,1.31,1.29,1.29,1.32,1.3,1.29,1.31,1.29,1.33,1.35,1.32,1.33) > 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/11pi91260616648.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/28w841260616648.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.167769708 -0.155634889 0.280552383 -0.136886618 [6] -0.070860961 0.128597721 -0.071092387 -0.091280568 0.022711960 [11] -0.185145169 0.002408066 0.172131888 -0.053554654 -0.065575813 [16] 0.041342464 -0.004094466 0.033691702 0.104548554 -0.092898498 [21] 0.023682171 0.034724219 -0.178711791 0.082057065 0.102013820 [26] -0.017041331 -0.062133176 -0.127642574 -0.016640785 -0.031997771 [31] -0.079677756 0.071066369 -0.086983433 0.059332095 -0.021418575 [36] -0.020786603 0.052313305 0.079344310 -0.062371449 -0.036835813 [41] 0.068587094 -0.110282860 0.038620809 0.018432628 -0.025163847 [46] -0.006702462 -0.024647588 0.041378068 0.015265921 > (mypacf <- c(rpacf$acf)) [1] -0.167769708 -0.189104218 0.232395757 -0.086265933 -0.029890242 [6] 0.021930046 -0.012726883 -0.079510367 -0.062166846 -0.209400008 [11] -0.027019035 0.122422959 0.074245922 -0.064948956 -0.072272296 [16] 0.010576976 0.075179926 0.083934266 -0.104915414 -0.013298338 [21] 0.014465516 -0.080441932 0.019765147 0.026916017 0.116993137 [26] -0.039323548 -0.197135257 -0.095340836 -0.102178312 -0.092887298 [31] 0.046888699 -0.127732426 0.135107594 -0.025157971 0.007820810 [36] -0.134974016 0.011770518 -0.039091156 -0.003202124 -0.018852725 [41] -0.147245597 0.016258589 0.011585024 0.070450759 -0.020519543 [46] -0.056995929 0.090298758 -0.012473500 > 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/3nc911260616648.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/4mhz71260616648.tab") > > system("convert tmp/11pi91260616648.ps tmp/11pi91260616648.png") > system("convert tmp/28w841260616648.ps tmp/28w841260616648.png") > > > proc.time() user system elapsed 0.567 0.314 0.750