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(252.5,251.1,255.1,258.3,255.3,261.1,253.8,252.9,253.9,255.5,262,262.8,263.3,262.5,269.2,270.8,274.1,273,267.3,267.1,268.2,270.2,271.5,281,280.1,281.5,285.9,289.8,292.9,291.2,291.8,289.8,292.5,290.3,297.5,307.5,304.7,304.6,310.7,310.7,315.7,314.7,312.2,312.8,314.3,319.7,319.9,329.5,326.9,329.7,335.7,337.2,339.7,338.3,339.2,342.5,342.2,338.3,339,345.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/1i6ax1259342929.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/2hn581259342929.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.00000000 -0.43325856 0.15626086 -0.24095441 0.14286628 0.10451492 [7] -0.19350196 0.24870166 -0.32243638 0.14991085 -0.09472780 0.37723210 [13] -0.37966713 0.07683680 -0.04873065 0.14203780 -0.06815156 -0.06657399 [19] 0.10351250 -0.11544723 0.20936292 -0.07099643 0.15376045 -0.32793073 [25] 0.18859832 -0.01727938 0.02419158 -0.06434999 -0.08972592 0.09121993 [31] -0.09496437 0.12877194 -0.08528652 0.01158200 -0.15947210 0.15329664 [37] -0.06054053 > (mypacf <- c(rpacf$acf)) [1] -0.433258561 -0.038720454 -0.231062404 -0.059311835 0.196431731 [6] -0.144359710 0.186178568 -0.144466297 -0.166218850 0.006032312 [11] 0.373564230 -0.253592676 -0.022098394 0.021324123 0.005575766 [16] -0.113549751 0.093009932 -0.103619464 0.142532076 0.171831260 [21] 0.040598660 0.051037825 -0.010081529 -0.099339736 0.038859661 [26] -0.074431708 -0.020546025 -0.039674681 -0.098578794 -0.063028159 [31] -0.019328099 -0.048968299 0.012794497 -0.088221921 -0.077105751 [36] -0.054246193 > 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/3p5mh1259342929.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/4n0td1259342929.tab") > > system("convert tmp/1i6ax1259342929.ps tmp/1i6ax1259342929.png") > system("convert tmp/2hn581259342929.ps tmp/2hn581259342929.png") > > > proc.time() user system elapsed 0.549 0.314 1.158