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(1.2,1.21,1.21,1.21,1.21,1.21,1.21,1.2,1.21,1.22,1.22,1.23,1.22,1.23,1.23,1.23,1.23,1.23,1.22,1.22,1.23,1.24,1.24,1.25,1.25,1.25,1.26,1.26,1.26,1.26,1.27,1.27,1.29,1.31,1.32,1.32,1.33,1.33,1.32,1.32,1.31,1.3,1.31,1.29,1.3,1.3,1.32,1.31,1.35,1.35,1.36,1.37,1.37,1.37,1.32,1.32,1.31,1.31,1.34,1.31,1.27,1.28,1.27,1.26,1.27,1.27,1.28,1.27,1.26,1.3,1.31,1.28,1.29,1.31,1.29,1.29,1.32,1.3,1.29,1.31,1.29,1.33,1.35,1.32,1.33) > 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/1g0le1260614473.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/21vs81260614473.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.915695622 0.857424241 0.807621907 0.729536153 [6] 0.678075963 0.628300261 0.568351050 0.508401840 0.456921675 [11] 0.415075718 0.394169345 0.370979259 0.328001432 0.298040103 [16] 0.266360997 0.231858874 0.208702079 0.178181474 0.127287218 [21] 0.089416120 0.052670233 0.018754019 0.002375124 -0.022506108 [26] -0.057001572 -0.101710494 -0.144182309 -0.163996760 -0.182679343 [31] -0.201368583 -0.207047983 -0.236529931 -0.247915284 -0.258182085 [36] -0.259393929 -0.256071638 -0.255019743 -0.252243412 -0.250033016 [41] -0.238188414 -0.239353652 -0.229752814 -0.226397232 -0.232076632 [46] -0.233807805 -0.238375309 -0.231637435 -0.237916060 > (mypacf <- c(rpacf$acf)) [1] 0.9156956219 0.1171863164 0.0450950563 -0.1861050746 0.0803018308 [6] 0.0029172678 -0.0515165662 -0.0904845378 0.0168813478 0.0597899477 [11] 0.1313179154 -0.0158951480 -0.1532649816 0.0007998782 0.0152563080 [16] -0.0036149984 -0.0233291204 -0.0613176783 -0.1355134523 0.0347018659 [21] 0.0121634079 0.0030438765 0.0104307450 -0.0375706994 -0.0672469413 [26] -0.1436983420 -0.0472330737 0.0972456055 0.0090937657 -0.0221727975 [31] 0.0566192582 -0.1370623758 0.0835150242 -0.0610732479 0.0395111917 [36] -0.0273233973 0.0505317544 0.0177212045 -0.0006722093 0.0025099997 [41] -0.0968930370 0.0487126854 -0.0241966785 0.0250498189 -0.0948344571 [46] -0.0429436891 0.0531524633 -0.0837121068 > 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/3ag1u1260614473.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/4mtz51260614473.tab") > > system("convert tmp/1g0le1260614473.ps tmp/1g0le1260614473.png") > system("convert tmp/21vs81260614473.ps tmp/21vs81260614473.png") > > > proc.time() user system elapsed 0.577 0.319 0.905