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(2.05,2.11,2.09,2.05,2.08,2.06,2.06,2.08,2.07,2.06,2.07,2.06,2.09,2.07,2.09,2.28,2.33,2.35,2.52,2.63,2.58,2.70,2.81,2.97,3.04,3.28,3.33,3.50,3.56,3.57,3.69,3.82,3.79,3.96,4.06,4.05,4.03,3.94,4.02,3.88,4.02,4.03,4.09,3.99,4.01,4.01,4.19,4.30,4.27,3.82,3.15,2.49,1.81,1.26,1.06,0.84,0.78,0.70,0.36,0.35) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1bl631259339838.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/2pceo1259339838.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.917353081 0.821380547 0.728702179 0.628793701 [6] 0.524155469 0.418597513 0.314501028 0.223085568 0.153821207 [11] 0.098616997 0.067691595 0.047965329 0.028343309 -0.000833939 [16] -0.035611612 -0.069865011 -0.108913557 -0.141568100 -0.171717705 [21] -0.203150792 -0.236472555 -0.259673268 -0.284330775 -0.298212695 [26] -0.307421478 -0.307971549 -0.306045953 -0.301225164 -0.293452489 [31] -0.283348827 -0.268549647 -0.250141425 -0.229670443 -0.204761470 [36] -0.177345636 -0.155154212 -0.131662969 -0.111298408 -0.092314377 [41] -0.076668793 -0.057769956 -0.041036433 -0.029831553 -0.018822811 [46] -0.008050273 -0.005744525 -0.004369124 > (mypacf <- c(rpacf$acf)) [1] 0.9173530807 -0.1271974290 -0.0253470538 -0.1037309570 -0.0842682329 [6] -0.0735073278 -0.0639940084 0.0045170412 0.0609027078 0.0147989836 [11] 0.0934807511 0.0004161752 -0.0512593516 -0.1209957121 -0.0936023546 [16] -0.0467596543 -0.0653675850 0.0308701035 0.0097689614 -0.0192035193 [21] -0.0483990277 -0.0027790438 -0.0971422366 -0.0117049707 -0.0557473773 [26] 0.0220352901 -0.0220218992 0.0021225800 -0.0084268284 -0.0164201689 [31] -0.0179014947 -0.0057537455 -0.0137909232 0.0245093558 0.0065886590 [36] -0.0265699669 0.0068226411 -0.0424739485 -0.0071640197 -0.0365647733 [41] 0.0327548054 -0.0087413373 -0.0153296628 -0.0045104572 -0.0017416645 [46] -0.0835128868 -0.0153448951 > 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/3tms61259339838.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/4onhm1259339838.tab") > > system("convert tmp/1bl631259339838.ps tmp/1bl631259339838.png") > system("convert tmp/2pceo1259339838.ps tmp/2pceo1259339838.png") > > > proc.time() user system elapsed 0.627 0.322 0.731