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.8,1.1,1.3,1.2,1.3,1.1,1.3,1.2,1.6,1.7,1.5,0.9,1.5,1.4,1.6,1.7,1.4,1.8,1.7,1.4,1.2,1,1.7,2.4,2,2.1,2,1.8,2.7,2.3,1.9,2,2.3,2.8,2.4,2.3,2.7,2.7,2.9,3,2.2,2.3,2.8,2.8,2.8,2.2,2.6,2.8,2.5,2.4,2.3,1.9,1.7,2,2.1,1.7,1.8,1.8,1.8,1.3,1.3,1.3,1.2,1.4,2.2,2.9,3.1,3.5,3.6,4.4,4.1,5.1,5.8,5.9,5.4,5.5,4.8,3.2,2.7,2.1,1.9,0.6,0.7,-0.2,-1,-1.7,-0.7) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1w56d1261090528.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/2bgdx1261090528.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.1520976532 0.1160848876 0.1392778282 0.2227845385 [6] 0.0676822014 0.0493984507 0.0251808084 0.0003516119 -0.1883256526 [11] -0.0934961084 0.0800301595 -0.4850919774 -0.2033690676 -0.0516044390 [16] 0.0148271955 -0.0983019410 -0.1707899750 -0.0433421919 0.0370159228 [21] -0.0777420064 0.0394062363 0.0771735413 -0.0710503256 0.0238882085 [26] 0.0941708175 0.0416521452 -0.0357707068 -0.0241730747 0.0969835722 [31] 0.0765018597 -0.0601266986 0.0487807007 0.0700905390 0.0259035350 [36] -0.0509077629 0.0756136065 -0.0138768434 -0.0176286147 0.0064907396 [41] 0.0523232932 0.0159230081 -0.0532590006 0.0253552766 0.0503344397 [46] -0.0495705955 -0.0583722296 0.0213077261 -0.0186226190 -0.0114390757 [51] 0.0516441484 -0.0509553580 -0.0163305935 -0.0605175976 -0.0079640035 [56] -0.0401742345 -0.0549521451 0.0203803267 0.0144790335 0.0073304120 [61] -0.0268719112 > (mypacf <- c(rpacf$acf)) [1] 0.152097653 0.095152419 0.112424293 0.187026243 -0.003983725 [6] -0.006366040 -0.031800519 -0.053398903 -0.215653775 -0.066448875 [11] 0.146546159 -0.514686330 -0.002557525 0.123751412 0.077029022 [16] 0.124706759 -0.151546486 0.004605513 0.052843043 -0.035531185 [21] -0.091171589 -0.047809829 0.091863767 -0.247840316 0.049286890 [26] 0.008285040 -0.007263561 0.170206370 -0.134531843 0.052470822 [31] 0.001740226 0.050763777 0.026661390 -0.031479605 -0.050798310 [36] -0.070671454 0.026823104 -0.053439042 0.061659016 0.073987364 [41] -0.023992392 0.075633280 -0.023115470 0.054695882 -0.033776599 [46] 0.005959069 -0.131174162 -0.016337859 0.053894949 0.066931081 [51] -0.037152092 -0.038419207 0.052840503 -0.061956651 -0.052690849 [56] 0.039131797 0.055904997 0.010294933 -0.013688501 -0.062443621 > 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/34wpm1261090528.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/46wy01261090528.tab") > > try(system("convert tmp/1w56d1261090528.ps tmp/1w56d1261090528.png",intern=TRUE)) character(0) > try(system("convert tmp/2bgdx1261090528.ps tmp/2bgdx1261090528.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.586 0.322 0.740