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(100.09,100.09,100.06,100.11,100.08,100.08,100.08,100.08,99.94,99.79,99.98,99.98,99.98,99.98,99.93,99.93,99.93,99.93,99.93,99.93,99.76,99.48,99.55,99.56,99.57,99.56,99.65,99.5,99.5,99.49,99.49,99.46,99.52,99.49,99.55,99.57,99.57,99.57,99.57,99.57,99.57,99.57,99.57,99.53,100.38,100.32,100.46,100.47,100.47,100.47,100.51,100.5,100.51,100.51,100.51,100.51,101.65,102.13,102.2,102.13,102.13,102.12,102.13,102.05,102,102.01,102.01,102.02,102.78,103.39,103.41,103.5,103.5,103.49,103.38,103.24,103.25,103.25,103.25,103.25,103.83,104.33,104.36,104.48,104.5,104.48,104.35,104.48,104.48,104.47,104.47,104.86,105.22,105.96,106.03,106.03) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1y3gd1260296977.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/2yx5b1260296977.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.0000000000 0.2952274515 0.0462414487 -0.0562004776 -0.0609301944 [6] -0.1460994443 -0.1129353283 -0.1197533787 -0.0792714468 -0.0518261240 [11] 0.0533028872 0.1857816493 0.7051417345 0.3428636340 -0.0203125227 [16] -0.0373380545 -0.0631627627 -0.1713765099 -0.1200077509 -0.1053509679 [21] -0.0664366518 -0.0628628756 0.0574324991 0.0688029332 0.3946305257 [26] 0.2852929564 -0.0507646774 -0.0259111096 -0.0717015250 -0.1327172487 [31] -0.1095851451 -0.0443468104 -0.0636723312 -0.0596697821 0.0574858094 [36] -0.0002813448 0.1221763291 0.1929871189 -0.0577337757 -0.0383609456 [41] -0.0553828360 -0.0604873877 -0.0936340083 -0.0074561238 -0.0401113851 [46] -0.0220335221 0.0374548400 0.0024759206 -0.0897601174 > (mypacf <- c(rpacf$acf)) [1] 0.295227451 -0.044824685 -0.062821366 -0.026481391 -0.130900259 [6] -0.040725703 -0.086208971 -0.043192720 -0.037294042 0.052159772 [11] 0.146335190 0.676368724 0.043857738 -0.194320053 0.104258237 [16] -0.038876555 -0.087552699 0.052348460 -0.035348530 0.020820542 [21] -0.011152222 -0.006335185 -0.130355455 -0.163492839 -0.036061614 [26] -0.031420094 0.069733716 -0.079019139 0.086564859 0.039224337 [31] 0.031695509 -0.042295684 -0.007857273 0.041921140 -0.064556416 [36] -0.107484026 0.032794008 -0.031730606 -0.008992707 -0.007002173 [41] 0.074626224 -0.087490193 -0.013272996 0.017585679 0.054209746 [46] -0.036132683 0.035104862 -0.088504552 > 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/3yniv1260296977.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/4a43z1260296977.tab") > > system("convert tmp/1y3gd1260296977.ps tmp/1y3gd1260296977.png") > system("convert tmp/2yx5b1260296977.ps tmp/2yx5b1260296977.png") > > > proc.time() user system elapsed 0.589 0.311 0.692