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(128.6,128.9,129.06,129.23,129.27,129.33,129.35,129.31,129.4,129.49,129.47,129.46,129.45,129.28,129.2,129.25,129.14,129.11,129.02,129.08,128.99,129.11,129.08,129.19,129.23,129.25,129.31,129.33,129.39,129.55,129.43,129.45,129.57,129.76,129.92,130.08,130.41,130.84,131.24,131.49,131.74,132.34,133.5,134.43,136.5,137.41,138.02,138.15,138.24,138.2,138.31,138.65,139.3,139.8,140.52,141.57,141.77,141.66,141.36,141.17) > 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/1pxm91260540671.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/2iur71260540671.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.000000000 0.956646380 0.905267087 0.845884313 0.781972918 [6] 0.716638487 0.656902444 0.599921745 0.543316020 0.487908711 [11] 0.431233225 0.371018986 0.306459186 0.239969514 0.172127448 [16] 0.107782031 0.049697685 0.005875158 -0.031998009 -0.062531433 [21] -0.089152330 -0.114649828 -0.138269459 -0.159151630 -0.176745431 [26] -0.191586732 -0.205070139 -0.217061058 -0.227567429 -0.236829188 [31] -0.245364036 -0.255009824 -0.263291095 -0.270796394 -0.277710741 [36] -0.283897625 -0.289681884 -0.294469650 -0.297233964 -0.299103113 [41] -0.299559730 -0.300368351 -0.299471165 -0.296129719 -0.290846864 [46] -0.280262098 -0.266739675 -0.252099361 -0.238466195 -0.224713477 [51] -0.211362787 -0.198103959 -0.183480707 -0.166517731 -0.148602067 [56] -0.128524049 -0.104678518 -0.079811954 -0.053935794 -0.027776143 > (mypacf <- c(rpacf$acf)) [1] 0.956646380 -0.116768562 -0.114184153 -0.071972345 -0.038771855 [6] 0.038822585 -0.009505742 -0.046356251 -0.033213882 -0.058479191 [11] -0.077920407 -0.086007434 -0.059086955 -0.055719837 -0.006660727 [16] 0.012680322 0.100042229 -0.011396568 0.005948460 -0.020356319 [21] -0.036937619 -0.003087509 0.004618873 0.007390191 -0.005096854 [26] -0.039131541 -0.040221187 -0.038861009 -0.034265088 -0.035679506 [31] -0.045951274 -0.006339772 -0.002576887 -0.018914602 -0.017810805 [36] -0.031094486 -0.020202044 0.002625695 -0.010191486 -0.000388533 [41] -0.025870333 -0.006123398 0.003401966 -0.007726999 0.034327059 [46] 0.003132993 -0.019457161 -0.033172928 -0.016584780 -0.012806372 [51] -0.008203961 0.002853863 0.013719430 -0.001514966 0.010569739 [56] 0.035853740 0.001926422 0.013596145 0.014246865 > 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/3yptl1260540671.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/490rw1260540671.tab") > > system("convert tmp/1pxm91260540671.ps tmp/1pxm91260540671.png") > system("convert tmp/2iur71260540671.ps tmp/2iur71260540671.png") > > > proc.time() user system elapsed 0.607 0.312 0.718