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(3.68,3.72,3.77,3.92,4.12,4.03,3.93,4.03,4.24,4.13,3.87,4.26,4.46,4.56,4.58,4.85,4.84,4.51,4.37,4.23,4.23,4.25,4.41,4.28,4.42,4.39,4.44,4.62,4.64,4.34,4.22,4.01,4.11,4.06,3.82,3.76,3.83,3.79,3.92,4.04,4.02,4.03,3.96,3.7,3.54,3.37,3.39,3.49,3.3,3.14,3.31,3.3,3.26,3.43,3.6,3.76,3.57,3.59,3.66,3.85) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > 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/10q8p1259255630.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/2vsgj1259255630.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.927001136 0.829142643 0.753913878 0.681586172 [6] 0.597943603 0.524560525 0.470954748 0.428965370 0.383972799 [11] 0.340833210 0.308463776 0.271685606 0.218194121 0.152709318 [16] 0.071729499 -0.001099144 -0.062034171 -0.125174781 -0.175852749 [21] -0.223055767 -0.269641125 -0.302574721 -0.311815923 -0.321059556 [26] -0.329187022 -0.344261956 -0.360132068 -0.376656316 -0.392441316 [31] -0.401993780 -0.395457884 -0.391798730 -0.379239426 -0.362135209 [36] -0.345655948 -0.338278672 > (mypacf <- c(rpacf$acf)) [1] 0.927001136 -0.214606523 0.143737355 -0.088646575 -0.093978480 [6] 0.051273733 0.043406504 0.031653256 -0.044736267 -0.002522690 [11] 0.024155060 -0.079764119 -0.100347112 -0.102311702 -0.183730327 [16] 0.038369920 -0.021395960 -0.086653887 0.051381202 -0.139505941 [21] -0.045023550 0.039152211 0.080802746 -0.059427369 0.026374097 [26] -0.096801122 -0.005922478 -0.039462449 0.004537352 -0.008596828 [31] 0.043526790 -0.060262665 0.067494673 -0.054734599 -0.035596401 [36] -0.134314389 > 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/3ua4y1259255630.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/449kj1259255630.tab") > system("convert tmp/10q8p1259255630.ps tmp/10q8p1259255630.png") > system("convert tmp/2vsgj1259255630.ps tmp/2vsgj1259255630.png") > > > proc.time() user system elapsed 0.549 0.324 0.677