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(103.63,103.64,103.66,103.77,103.88,103.91,103.91,103.92,104.05,104.23,104.30,104.31,104.31,104.34,104.55,104.65,104.73,104.75,104.75,104.76,104.94,105.29,105.38,105.43,105.43,105.42,105.52,105.69,105.72,105.74,105.74,105.74,105.95,106.17,106.34,106.37,106.37,106.36,106.44,106.29,106.23,106.23,106.23,106.23,106.34,106.44,106.44,106.48,106.50,106.57,106.40,106.37,106.25,106.21,106.21,106.24,106.19,106.08,106.13,106.09) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '1' > 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/10nmq1258801267.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/2nyjt1258801267.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.4163197690 0.0766970737 -0.1120826726 -0.0073900453 [6] 0.1725406577 0.3148488948 0.1706641971 -0.1519726833 -0.1159397706 [11] -0.0113911199 0.3842097257 0.3748968545 0.2713032837 -0.0197033012 [16] -0.0959515955 -0.0789955869 0.1159669623 0.0347857543 -0.1171496856 [21] -0.1067034777 -0.1232871690 -0.0511846814 -0.0019779066 0.0436534484 [26] -0.1248324485 -0.1035571409 -0.0889493227 0.0147423242 -0.0813370374 [31] -0.1368321282 -0.1659657828 -0.1427707868 -0.0531271458 -0.0199189176 [36] -0.0617945043 -0.2103259252 -0.0974094897 -0.0932639735 -0.0285420024 [41] 0.0110286218 -0.0355330616 -0.1009385441 -0.1151054847 -0.0322150335 [46] -0.0111796869 -0.0087173262 -0.0556800874 -0.0716673040 -0.0385036400 [51] -0.0089908121 0.0064123056 0.0009079592 -0.0237452797 -0.0131036749 [56] 0.0023954272 -0.0019262540 0.0030522698 0.0052369613 > (mypacf <- c(rpacf$acf)) [1] 0.416319769 -0.116883592 -0.121518680 0.122433133 0.167603184 [6] 0.189683908 -0.047035719 -0.242216444 0.127860326 0.030621856 [11] 0.379101375 0.016369034 0.104564885 -0.044164016 -0.020599110 [16] -0.148269182 0.016910799 -0.305089680 -0.004058595 0.065684926 [21] 0.060226097 -0.194640522 -0.092736377 -0.135252196 -0.074269306 [26] -0.096897918 0.071258789 0.066254012 -0.004293330 -0.003116965 [31] 0.016704502 -0.061761164 0.015071283 -0.011424446 0.022594104 [36] -0.006888106 0.145555837 -0.057774637 -0.059697310 0.023437217 [41] -0.055599763 0.083018735 -0.052756999 -0.004185191 -0.037470913 [46] -0.016179149 0.023170106 -0.094054681 0.036326466 0.004745229 [51] -0.064161416 0.007384844 -0.029827817 -0.046247335 -0.032082992 [56] 0.002946829 0.014735457 0.011970630 > 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/33r2c1258801267.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/43vdg1258801267.tab") > > system("convert tmp/10nmq1258801267.ps tmp/10nmq1258801267.png") > system("convert tmp/2nyjt1258801267.ps tmp/2nyjt1258801267.png") > > > proc.time() user system elapsed 0.570 0.315 0.717