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(104.08,103.86,107.47,111.1,117.33,119.04,123.68,125.9,124.54,119.39,118.8,114.81,117.9,120.53,125.15,126.49,131.85,127.4,131.08,122.37,124.34,119.61,119.97,116.46,117.03,120.96,124.71,127.08,131.91,137.69,142.46,144.32,138.06,124.45,126.71,121.83,122.51,125.48,127.77,128.03,132.84,133.41,139.99,138.53,136.12,124.75,122.88,121.46,118.4,122.45,128.94,133.25,137.94,140.04,130.74,131.55,129.47,125.45,127.87,124.68) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/14osc1259359870.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/22uwr1259359870.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.74981206 0.53052864 0.25185428 0.10028486 0.05329767 [7] 0.01003355 -0.05608074 -0.07741177 -0.15694150 -0.24193567 -0.21614649 [13] -0.22348190 -0.03415371 0.04279888 0.13375552 0.19207926 0.19392040 [19] 0.18705825 0.17411470 0.13319405 0.12379034 0.08675550 -0.06978487 [25] -0.12805051 -0.21064408 -0.15711827 -0.12636182 -0.11483756 -0.11008493 [31] -0.11481263 -0.13191651 -0.13314910 -0.12238694 -0.10463270 -0.02370792 [37] -0.03256696 > (mypacf <- c(rpacf$acf)) [1] 0.749812064 -0.072386486 -0.276612335 0.076148593 0.147498797 [6] -0.126029067 -0.170866127 0.123524912 -0.142329414 -0.253837199 [11] 0.268006038 -0.071268604 0.231509627 -0.095972620 0.077683900 [16] 0.157665854 -0.097549507 0.016060277 0.002447491 0.046585242 [21] -0.058473025 -0.100784261 -0.168909451 0.075825923 0.134705464 [26] -0.036117965 -0.090973248 0.062846547 -0.013606104 -0.132445489 [31] -0.041608864 -0.030552586 -0.029997477 -0.107661792 0.004918295 [36] 0.048369133 > 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/365ox1259359870.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/4ldsi1259359870.tab") > > system("convert tmp/14osc1259359870.ps tmp/14osc1259359870.png") > system("convert tmp/22uwr1259359870.ps tmp/22uwr1259359870.png") > > > proc.time() user system elapsed 0.547 0.313 1.229