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 = '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/15dsy1259103375.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/23g581259103375.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.416319769 0.076697074 -0.112082673 -0.007390045 [6] 0.172540658 0.314848895 0.170664197 -0.151972683 -0.115939771 [11] -0.011391120 0.384209726 0.374896855 0.271303284 -0.019703301 [16] -0.095951595 -0.078995587 0.115966962 0.034785754 -0.117149686 [21] -0.106703478 -0.123287169 -0.051184681 -0.001977907 0.043653448 [26] -0.124832448 -0.103557141 -0.088949323 0.014742324 -0.081337037 [31] -0.136832128 -0.165965783 -0.142770787 -0.053127146 -0.019918918 [36] -0.061794504 -0.210325925 > (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 > 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/3jvov1259103375.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/4r8df1259103375.tab") > > system("convert tmp/15dsy1259103375.ps tmp/15dsy1259103375.png") > system("convert tmp/23g581259103375.ps tmp/23g581259103375.png") > > > proc.time() user system elapsed 0.563 0.327 0.669