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(-15,-15,-10,-12,-11,-11,-17,-18,-19,-22,-24,-24,-20,-25,-22,-17,-9,-11,-13,-11,-9,-7,-3,-3,-6,-4,-8,-1,-2,-2,-1,1,2,2,-1,1,-1,-8,1,2,-2,-2,-2,-2,-6,-4,-5,-2,-1,-5,-9,-8,-14,-10,-11,-11,-11,-5,-2,-3,-6,-6,-7,-6,-2,-2,-4,0,-6,-4,-3,-1,-3) > 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/1tmd01272723230.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/2tmd01272723230.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.0000000000 -0.1789515894 -0.0645960922 0.0191382327 0.0145086031 [6] -0.0787037037 0.0297462817 0.0093686206 0.0104257801 -0.1048775153 [11] -0.0185185185 0.0534047827 -0.0244969379 0.0183362496 -0.1229950423 [16] -0.0162948381 0.1310877807 -0.0859215515 0.0382764654 0.0423957422 [21] 0.0489209682 -0.2787620297 -0.0336103820 0.0625911344 -0.0019685039 [26] -0.1220836979 0.2109944590 -0.0659448819 -0.0001458151 -0.0378025663 [31] -0.1229221347 0.1819407991 -0.0475357247 -0.0523840770 -0.0213619131 [36] -0.0518008166 0.0603674541 0.0531131525 -0.0468795567 0.0130139983 [41] -0.0364537766 -0.0021507728 0.1412948381 0.0824219889 -0.0064158647 [46] -0.0114829396 0.0265383494 -0.0668926801 -0.0137795276 > (mypacf <- c(rpacf$acf)) [1] -0.178951589 -0.099816246 -0.011934745 0.009980070 -0.075935950 [6] 0.002238930 0.003233151 0.016988615 -0.102165464 -0.065598205 [11] 0.024487239 -0.015067449 0.020133104 -0.143813876 -0.072646776 [16] 0.111623715 -0.051998206 0.022317658 0.012527183 0.078902165 [21] -0.254961155 -0.163745618 -0.033632002 -0.021861232 -0.103900327 [26] 0.133680167 -0.025768311 0.015605058 -0.072787213 -0.228151156 [31] 0.105848091 -0.018244363 -0.042679092 -0.105716948 -0.176766874 [36] 0.002619571 0.085213923 -0.066062057 -0.087480259 0.018710689 [41] 0.063722693 -0.022180368 0.057248293 -0.047156910 0.050145462 [46] 0.028890121 -0.093252500 -0.022642355 > 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/3pwbr1272723230.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/4z5sb1272723230.tab") > > try(system("convert tmp/1tmd01272723230.ps tmp/1tmd01272723230.png",intern=TRUE)) character(0) > try(system("convert tmp/2tmd01272723230.ps tmp/2tmd01272723230.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.580 0.308 14.373