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(103.63,103.64,103.66,103.77,103.88,103.91,103.91,103.92,104.05,104.23,104.30,104.31,104.31,104.34,104.55,104.65,104.73,104.75,104.75,104.76,104.94,105.29,105.38,105.43,105.43,105.42,105.52,105.69,105.72,105.74,105.74,105.74,105.95,106.17,106.34,106.37,106.37,106.36,106.44,106.29,106.23,106.23,106.23,106.23,106.34,106.44,106.44,106.48,106.50,106.57,106.40,106.37,106.25,106.21,106.21,106.24,106.19,106.08,106.13,106.09) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '2' > 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/1bo3g1258801368.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/2y9f61258801368.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.198390575 -0.149249473 -0.246445625 -0.058306384 [6] 0.026685574 0.243481883 0.149755462 -0.296048710 -0.086070755 [11] -0.221536886 0.343852305 0.086397589 0.166666353 -0.178258275 [16] -0.080577276 -0.173725409 0.238626254 0.061950259 -0.140521639 [21] 0.019236052 -0.058519314 0.004621818 0.001726043 0.189683622 [26] -0.138479725 0.016899929 -0.086336461 0.142700792 -0.036388271 [31] -0.020027949 -0.032624437 -0.037170302 0.036025783 0.041513677 [36] 0.092323036 -0.220341575 0.105154796 -0.027389616 0.002770909 [41] 0.053698347 0.014872996 -0.041643137 -0.069641475 0.055960866 [46] 0.026600068 0.019241481 -0.032403102 -0.038611168 -0.001281078 [51] 0.036076262 0.006282505 0.003871160 -0.029922173 0.001685587 [56] 0.024404054 -0.011154421 -0.001700256 > (mypacf <- c(rpacf$acf)) [1] -0.198390575 -0.196335840 -0.347354104 -0.300582091 -0.286621088 [6] -0.036674764 0.138075799 -0.213181152 -0.134343488 -0.432956246 [11] -0.078060366 -0.162079313 0.018843040 0.014241943 0.167858635 [16] -0.010934646 0.303203890 0.037087777 -0.080219981 -0.066233638 [21] 0.177464634 0.089247492 0.131483215 0.059504163 0.058772109 [26] -0.088032125 -0.139625472 -0.105120982 -0.085807749 -0.090836412 [31] 0.004096293 -0.057170374 -0.017213530 -0.064139523 -0.025292329 [36] -0.212339603 -0.003848083 0.002554734 -0.048355951 0.055456811 [41] -0.065706801 0.022043238 -0.021015982 -0.029187226 0.017489774 [46] -0.069119527 0.091715733 -0.035292118 0.002423249 0.073742918 [51] 0.028824930 -0.006480227 0.058495577 0.023616462 0.033185002 [56] -0.011133917 -0.015784484 > 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/3sh1e1258801368.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/4ug6w1258801368.tab") > > system("convert tmp/1bo3g1258801368.ps tmp/1bo3g1258801368.png") > system("convert tmp/2y9f61258801368.ps tmp/2y9f61258801368.png") > > > proc.time() user system elapsed 0.582 0.296 0.723