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(101.02,101.15,101.51,101.75,101.8,101.8,101.8,101.82,101.99,102.25,102.34,102.35,102.35,102.39,102.49,102.67,102.68,102.7,102.71,102.72,102.83,102.92,103.04,103.08,103.09,103.11,103.18,103.18,103.22,103.25,103.25,103.25,103.47,103.57,103.66,103.7,103.7,103.75,103.85,104.02,104.13,104.17,104.18,104.2,104.5,104.78,104.88,104.89,104.9,104.95,105.24,105.35,105.44,105.46,105.47,105.48,105.75,106.1,106.19,106.23,106.24,106.25,106.35,106.48,106.52,106.55,106.55,106.56,106.89,107.09,107.24,107.28,107.3,107.31,107.47,107.35,107.31,107.32,107.32,107.34,107.53,107.72,107.75,107.79,107.81,107.9,107.8,107.86,107.8,107.74,107.75,107.83,107.8,107.81,107.86,107.83) > 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/1i31l1289837823.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/2tvio1289837823.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.361263714 -0.094539493 -0.275777001 -0.168043687 [6] 0.096115049 0.419645242 0.176662511 -0.190679030 -0.272159016 [11] -0.138787596 0.281833338 0.467215282 0.279344039 -0.152647950 [16] -0.263559797 -0.174981513 0.113105885 0.182953833 -0.003791621 [21] -0.167789959 -0.293435532 -0.129310723 0.128367310 0.313993630 [26] 0.021162982 -0.206112080 -0.276324680 -0.119354388 0.045554558 [31] 0.173873567 0.003262848 -0.226753730 -0.247885943 -0.117515838 [36] 0.137457453 0.203473683 0.080197131 -0.190523439 -0.226432083 [41] -0.114409144 0.079932851 0.195780390 0.023498188 -0.148908575 [46] -0.197460702 -0.063893545 0.101504154 0.249695898 > (mypacf <- c(rpacf$acf)) [1] 0.361263714 -0.258831436 -0.171684282 -0.012635763 0.130907623 [6] 0.336447268 -0.152784584 -0.173462101 0.014663956 0.013038514 [11] 0.339490742 0.103906994 0.059532859 -0.108884594 0.015840688 [16] 0.006286082 -0.047383830 -0.170665092 -0.178549972 0.117455339 [21] -0.104787482 -0.029347910 -0.084651264 0.092452623 -0.115348382 [26] -0.131428304 0.006718244 -0.017883662 -0.014612798 0.044120948 [31] 0.002511359 -0.025861668 -0.043477144 0.002146922 0.042685532 [36] -0.013341154 0.011626362 0.004707835 -0.008086187 -0.039723057 [41] -0.043618016 0.113809939 -0.111572551 -0.029628470 0.014596135 [46] 0.003662527 -0.011698145 -0.018621226 > 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/3wvhc1289837823.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/4zvx01289837823.tab") > > try(system("convert tmp/1i31l1289837823.ps tmp/1i31l1289837823.png",intern=TRUE)) character(0) > try(system("convert tmp/2tvio1289837823.ps tmp/2tvio1289837823.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.560 0.306 0.745