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(96.96,93.11,95.62,98.30,96.38,100.82,99.06,94.03,102.07,99.31,98.64,101.82,99.14,97.63,100.06,101.32,101.49,105.43,105.09,99.48,108.53,104.34,106.10,107.35,103.00,104.50,105.17,104.84,106.18,108.86,107.77,102.74,112.63,106.26,108.86,111.38,106.85,107.86,107.94,111.38,111.29,113.72,111.88,109.87,113.72,111.71,114.81,112.05,111.54,110.87,110.87,115.48,111.63,116.24,113.56,106.01,110.45,107.77,108.61,108.19) > 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/1jufn1259076993.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/2ve5y1259076993.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.656847247 0.566059407 0.551059127 0.294665837 [6] 0.195941696 0.155667712 0.076741720 0.043749922 0.002647232 [11] -0.048731258 -0.007202195 -0.085983372 -0.146950139 -0.044369821 [16] -0.097752672 -0.160682270 -0.052580832 -0.041521551 -0.050931494 [21] 0.019500409 0.082791566 0.035740348 0.086842986 0.037654089 [26] 0.067041112 0.047156237 -0.036169363 -0.020414494 -0.058066870 [31] -0.144821217 -0.165812730 -0.162385903 -0.249908546 -0.244521578 [36] -0.216172317 -0.272132242 > (mypacf <- c(rpacf$acf)) [1] 0.656847247 0.236761411 0.208242563 -0.323596157 -0.090893806 [6] 0.023155758 0.108048256 0.008402502 -0.097429657 -0.104413165 [11] 0.130109551 -0.091308052 -0.120334304 0.125935775 0.015243564 [16] -0.122050281 0.041696052 0.092948176 0.052042174 -0.016816747 [21] 0.084483087 -0.132951963 0.089353832 -0.127535297 0.128731501 [26] -0.093853106 -0.018490367 -0.133579524 -0.004912147 -0.048198866 [31] -0.044332620 -0.055579860 -0.062984210 -0.003594005 0.003676750 [36] -0.100260477 > 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/3zllx1259076993.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/4mryc1259076993.tab") > system("convert tmp/1jufn1259076993.ps tmp/1jufn1259076993.png") > system("convert tmp/2ve5y1259076993.ps tmp/2ve5y1259076993.png") > > > proc.time() user system elapsed 0.554 0.322 1.447