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.4754,0.4531,0.469,0.4716,0.4824,0.527,0.5172,0.515,0.5245,0.53,0.4836,0.4663,0.4592,0.4553,0.4217,0.4366,0.4532,0.4743,0.4776,0.4949,0.5069,0.498,0.5213,0.5394,0.6075,0.5919,0.5758,0.5916,0.6474,0.6704,0.7553,0.7891,0.784,0.7007,0.668,0.6102,0.5238,0.4237,0.3983,0.3879,0.3733,0.394,0.3945,0.4324,0.4233,0.455,0.4344,0.4388,0.4561,0.4512,0.4756,0.4704,0.5107,0.5472,0.5537,0.5539,0.5313,0.5371,0.5459,0.5461) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1ad4d1292232248.ps",horizontal=F,onefile=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/2ad4d1292232248.ps",horizontal=F,onefile=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.935580654 0.812916020 0.649729670 0.471043888 [6] 0.278473465 0.110208248 -0.028836223 -0.147519422 -0.239054979 [11] -0.303860882 -0.353656141 -0.405196168 -0.445371333 -0.471981331 [16] -0.483704800 -0.482754042 -0.450774834 -0.390267615 -0.307152688 [21] -0.221613699 -0.123972923 -0.029399218 0.049128362 0.094096108 [26] 0.122922476 0.126656082 0.105994270 0.075584835 0.046995739 [31] 0.025237119 0.013544246 0.016765252 0.033012974 0.048823158 [36] 0.061385829 0.067752195 0.064262915 0.052257763 0.039399367 [41] 0.027552814 0.016496480 0.009609665 0.007668542 0.010162180 [46] 0.015188553 0.019184603 0.018303230 0.016707549 > (mypacf <- c(rpacf$acf)) [1] 0.935580654 -0.500406783 -0.248556527 -0.051369290 -0.205520897 [6] 0.186824319 0.001924554 -0.212770547 0.051643409 -0.087566367 [11] -0.163438708 -0.160513381 -0.019162942 -0.021718963 -0.008970242 [16] -0.057317845 0.079286672 0.032538451 0.005078390 -0.180849663 [21] 0.086805905 -0.007314949 -0.102146589 -0.183305535 0.047589883 [26] -0.110375918 -0.090209773 0.011079927 -0.089957576 0.049176618 [31] 0.102359028 -0.159307523 0.066268095 -0.050098135 -0.034590574 [36] -0.065397568 -0.051064487 0.026845826 0.069496455 -0.148347376 [41] -0.054088647 -0.029596041 -0.003657518 -0.108112660 0.017148292 [46] -0.031379574 -0.005285565 0.031284601 > 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/3dw3j1292232248.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/4he1p1292232248.tab") > > try(system("convert tmp/1ad4d1292232248.ps tmp/1ad4d1292232248.png",intern=TRUE)) character(0) > try(system("convert tmp/2ad4d1292232248.ps tmp/2ad4d1292232248.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.583 0.320 1.241