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(8.55,8.56,8.57,8.59,8.61,8.62,8.62,8.63,8.71,8.72,8.74,8.75,8.79,8.82,8.82,8.84,8.86,8.86,8.85,8.86,8.86,8.87,8.88,8.9,8.91,8.96,8.98,8.99,9,9,9,9.01,9.01,8.99,8.99,8.99,9,9,9.02,9.05,9.05,9.05,9.06,9.06,9.08,9.07,9.06,9.08,9.07,9.11,9.15,9.15,9.17,9.2,9.23,9.26,9.27,9.28,9.29,9.29,9.11,9.06,9.11,9.13,9.13,9.19,9.2,9.23,9.24,9.28,9.32,9.32,9.32,9.36,9.37,9.38,9.41,9.44,9.44,9.44,9.47,9.48,9.56,9.58,9.56,9.58,9.7,9.74,9.76,9.78,9.84,9.88,9.96,9.97,9.96,9.96) > 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/1b3nl1260301589.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/2386i1260301589.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.00000000 0.95055143 0.89799107 0.84411038 0.78970964 0.73911223 [7] 0.69051280 0.64449088 0.59969826 0.55952545 0.52167460 0.49233409 [13] 0.46383762 0.43413831 0.40587149 0.38187025 0.35752407 0.33523022 [19] 0.31138659 0.28544501 0.26074494 0.23703593 0.21387853 0.19250734 [25] 0.17345463 0.15297125 0.13465951 0.12085522 0.10905767 0.09730390 [31] 0.08728544 0.07774325 0.07265763 0.06799230 0.06274542 0.06016015 [37] 0.05393262 0.03440910 0.01358096 -0.00660272 -0.02570760 -0.04508920 [43] -0.06334841 -0.08062878 -0.09702317 -0.11156131 -0.12706789 -0.14111241 [49] -0.15176148 > (mypacf <- c(rpacf$acf)) [1] 0.9505514343 -0.0576137956 -0.0404632559 -0.0338653515 0.0097191292 [6] -0.0104809413 -0.0040817290 -0.0178680260 0.0197663872 -0.0042507366 [11] 0.0625111579 -0.0176634210 -0.0326748891 -0.0047387507 0.0313056440 [16] -0.0215779345 0.0055312297 -0.0337198665 -0.0305400616 -0.0019185157 [21] -0.0004325765 -0.0144323958 -0.0013220027 0.0066455274 -0.0254253796 [26] 0.0031138143 0.0302143066 0.0035176933 -0.0171956260 0.0078525484 [31] -0.0012360176 0.0364899986 -0.0059748441 -0.0102033375 0.0198152221 [36] -0.0373589219 -0.1373839251 -0.0169138305 -0.0058252626 0.0024074945 [41] -0.0269842174 -0.0043230981 -0.0102240484 -0.0128348433 -0.0073022047 [46] -0.0321837842 -0.0242551110 0.0205229391 > 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/357371260301589.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/4opxj1260301589.tab") > > system("convert tmp/1b3nl1260301589.ps tmp/1b3nl1260301589.png") > system("convert tmp/2386i1260301589.ps tmp/2386i1260301589.png") > > > proc.time() user system elapsed 0.587 0.331 1.317