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(91.98,91.72,90.27,91.89,92.07,92.92,93.34,93.60,92.41,93.60,93.77,93.60,93.60,93.51,92.66,94.20,94.37,94.45,94.62,94.37,93.43,94.79,94.88,94.79,94.62,94.71,93.77,95.73,95.99,95.82,95.47,95.82,94.71,96.33,96.50,96.16,96.33,96.33,95.05,96.84,96.92,97.44,97.78,97.69,96.67,98.29,98.20,98.71,98.54,98.20,96.92,99.06,99.65,99.82,99.99,100.33,99.31,101.10,101.10,100.93,100.85,100.93,99.60,101.88,101.81,102.38,102.74,102.82,101.72,103.47,102.98,102.68,102.90,103.03,101.29,103.69,103.68,104.20,104.08,104.16,103.05,104.66,104.46,104.95,105.85,106.23,104.86,107.44,108.23,108.45,109.39,110.15,109.13,110.28,110.17,109.99,109.26,109.11,107.06,109.53,108.92,109.24,109.12,109.00,107.23,109.49,109.04,109.02) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > 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/1ccgf1259944570.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/2t0qe1259944570.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.96464532 0.94021826 0.90916431 0.88734094 0.85983713 [7] 0.84542150 0.80810321 0.78368395 0.75393753 0.73319346 0.70667619 [13] 0.68866913 0.64657683 0.61467571 0.57958765 0.55029045 0.51822113 [19] 0.49827168 0.46004815 0.43198716 0.40294426 0.38336495 0.35865885 [25] 0.34406550 0.31076011 0.28796341 0.26101574 0.24278149 0.22145447 [31] 0.20874665 0.17644137 0.15533888 0.13042091 0.11498090 0.09492174 [37] 0.08205098 > (mypacf <- c(rpacf$acf)) [1] 0.9646453186 0.1393284443 -0.0858546458 0.0952477013 -0.0554891610 [6] 0.1461966990 -0.2905615741 0.0867369479 -0.0036440288 0.0365407170 [11] -0.0145081407 -0.0015330428 -0.2437721337 -0.0007887061 0.0264778313 [16] -0.0389075045 0.0185185580 0.0612543820 -0.1120973857 0.0050136835 [21] 0.0417570924 0.0589756078 -0.0245817888 0.0270021872 -0.1029100691 [26] 0.0236163769 -0.0192787635 0.0249746101 0.0205241361 -0.0248852907 [31] -0.1193334991 0.0172594635 -0.0179589670 0.0217614962 -0.0047409578 [36] -0.0413035696 > 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/3unrw1259944570.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/446u51259944570.tab") > system("convert tmp/1ccgf1259944570.ps tmp/1ccgf1259944570.png") > system("convert tmp/2t0qe1259944570.ps tmp/2t0qe1259944570.png") > > > proc.time() user system elapsed 0.541 0.323 0.643