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(395.3,395.1,403.5,403.3,405.7,406.7,407.2,412.4,415.9,414,411.8,409.9,412.4,415.9,416.3,417.2,421.8,421.4,415.1,412.4,411.8,408.8,404.5,402.5,409.4,410.7,413.4,415.2,417.7,417.8,417.9,418.4,418.2,416.6,418.9,421,423.5,432.3,432.3,428.6,426.7,427.3,428.5,437,442,444.9,441.4,440.3,447.1,455.3,478.6,486.5,487.8,485.9,483.8,488.4,494,493.6,487.3,482.1,484.2,496.8,501.1,499.8,495.5,498.1,503.8,516.2,526.1,527.1,525.1,528.9,540.1,549,556,568.9,589.1,590.3,603.3,638.8,643,656.7,656.1,654.1,659.9,662.1,669.2,673.1,678.3,677.4,678.5,672.4,665.3,667.9,672.1,662.5,682.3,692.1,702.7,721.4,733.2,747.7,737.6,729.3,706.1,674.3,659,645.7) > 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/134rm1259058335.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/2kb6o1259058335.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.5114546748 0.3240569485 0.1638557759 -0.0567207937 [6] -0.0171450851 -0.0921050702 -0.0569822817 -0.1471957506 -0.1434089889 [11] -0.0260759257 0.0729771786 0.1434898491 0.0919552654 0.0147255848 [16] 0.0096297097 -0.0972877319 0.0606118942 0.1062819401 -0.0006029898 [21] 0.0664162124 0.0111318996 0.0717170982 0.0147769912 0.0203527583 [26] -0.0426422395 -0.1722780223 -0.1681992369 -0.1245346645 -0.0482781643 [31] -0.0832018600 -0.0495278914 -0.0936673136 -0.0803610949 -0.0511373514 [36] 0.0020035351 0.0143106328 -0.0509257766 -0.0577730647 -0.0964287998 [41] -0.0849337265 -0.0441840017 -0.0325334042 -0.0368534502 -0.0337845281 [46] -0.0317279913 0.0277328486 0.0399197892 0.0787311034 0.0523262480 [51] 0.0197750736 0.0405185705 -0.0223817974 -0.0413135747 -0.1358779414 [56] -0.1477569927 -0.1364529470 -0.1379840013 -0.0792835877 -0.0155796824 [61] -0.0337721723 > (mypacf <- c(rpacf$acf)) [1] 0.511454675 0.084601666 -0.042465469 -0.199729793 0.105281944 [6] -0.081511360 0.038231498 -0.193196797 0.022015464 0.099979112 [11] 0.160087885 -0.013901393 -0.077515686 -0.092010894 0.095592768 [16] -0.130075657 0.222756944 0.009612092 -0.078402871 0.047384330 [21] 0.061205884 0.036866303 -0.130700148 0.003519742 -0.084580633 [26] -0.031176645 -0.056488231 0.081648010 -0.034596846 -0.115630175 [31] 0.019073808 -0.119298558 0.047348864 -0.046267698 -0.009163611 [36] -0.000826601 -0.024895854 -0.007247845 -0.098113684 -0.034149294 [41] 0.033156792 -0.050544755 0.023284470 0.034216564 0.023293145 [46] -0.032160802 0.066427034 0.045594744 -0.039156827 0.034010375 [51] 0.022681355 -0.013723037 -0.148893366 -0.063205149 -0.013996207 [56] -0.017757286 -0.030365716 -0.083731784 0.072198564 -0.115574872 > 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/38mk81259058335.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/47t7t1259058335.tab") > > system("convert tmp/134rm1259058335.ps tmp/134rm1259058335.png") > system("convert tmp/2kb6o1259058335.ps tmp/2kb6o1259058335.png") > > > proc.time() user system elapsed 0.601 0.324 0.837