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(595,591,612,595,597,589,584,573,567,569,621,629,628,593,588,566,557,590,580,574,573,573,620,626,620,561,527,510,514,549,532,526,511,499,555,565,542,517,506,502,516,508,493,490,469,478,528,534,518,528,533,536,537,524,536,587,597,581,564,558) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1ngeb1260388298.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/2dt4g1260388298.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.8501739437 0.6479675052 0.4964219992 0.4504181038 [6] 0.4792410094 0.4692160070 0.4017132480 0.3327244657 0.3166793627 [11] 0.3495353742 0.3718934530 0.3540856607 0.2029842051 0.0731037648 [16] -0.0063848081 -0.0307548851 -0.0144439317 -0.0559429703 -0.1166827858 [21] -0.1501779383 -0.1749398742 -0.1867630358 -0.2074472749 -0.2367944661 [26] -0.2980178557 -0.3328530979 -0.3511947979 -0.3586565029 -0.3547071764 [31] -0.3610034391 -0.3352753740 -0.2766820049 -0.2380225974 -0.2187965181 [36] -0.2179590915 -0.2252478381 -0.2315699431 -0.2253273978 -0.2254049279 [41] -0.2238075991 -0.2136037323 -0.1901479419 -0.1388980416 -0.0752295935 [46] -0.0288319870 -0.0232939431 -0.0402582254 -0.0490034370 -0.0359422097 [51] -0.0194721481 -0.0044017996 0.0111011138 0.0287401648 0.0412982250 [56] 0.0459983328 0.0311931590 0.0143861269 0.0041428997 0.0009230669 > (mypacf <- c(rpacf$acf)) [1] 0.8501739437 -0.2699389533 0.1024361719 0.2367452503 0.1574947779 [6] -0.1395458003 -0.0458656149 0.1048537432 0.1222911788 0.0335809332 [11] -0.0372354970 0.0211784408 -0.4455015316 0.1402030042 -0.1096924805 [16] -0.0788687703 0.0067980522 -0.1381469932 0.0700142504 -0.0059162259 [21] -0.1841638611 -0.0315962476 0.0639379204 -0.0540706633 -0.0007535812 [26] -0.0475740038 -0.0079594194 -0.0320412991 -0.1201645287 0.1609450835 [31] 0.0887521024 0.0077024073 0.0405720494 0.0048411003 0.0484744167 [36] -0.0959141127 -0.0747114166 0.0509528115 -0.0493146921 -0.0949455832 [41] 0.0045294263 0.0147775525 -0.0399548375 -0.0179684873 0.0643481132 [46] -0.0600126778 -0.0533987151 0.0253528075 0.0378056189 -0.0795404597 [51] 0.0567923931 0.0013331572 0.0448616535 -0.0908915240 -0.1236890549 [56] -0.0306696817 -0.0028822039 0.0461052748 -0.0636149767 > 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/3q3481260388298.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/4vbey1260388298.tab") > > system("convert tmp/1ngeb1260388298.ps tmp/1ngeb1260388298.png") > system("convert tmp/2dt4g1260388298.ps tmp/2dt4g1260388298.png") > > > proc.time() user system elapsed 0.601 0.322 0.884