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(12.610,10.862,52.929,56.902,81.776,87.876,82.103,72.846,60.632,33.521,15.342,7.758,8.668,13.082,38.157,58.263,81.153,88.476,72.329,75.845,61.108,37.665,12.755,2.793,12.935,19.533,33.404,52.074,70.735,69.702,61.656,82.993,53.990,32.283,15.686,2.713,12.842,19.244,48.488,54.464,84.192,84.458,85.793,75.163,68.212,49.233,24.302,5.402,15.058,33.559,70.358,85.934,94.452,129.305,113.882,107.256,94.274,57.842,26.611,14.521) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/1zlx71259858253.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/22esn1259858253.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.4846364345 0.0818930210 -0.1011096877 0.1990408043 [6] -0.1983628394 0.0705331632 -0.0354090917 -0.1427458900 0.1884467588 [11] -0.1948351959 0.2660720240 -0.2063808446 0.0361898638 0.0015366222 [16] 0.1596149563 -0.1374749719 0.0008557338 -0.0081667751 0.0452828248 [21] -0.0057890943 -0.0182941312 0.0022393559 0.0411478302 -0.1952760246 [26] 0.2024292948 -0.0678979642 -0.0839810426 -0.0620506733 0.2077497360 [31] -0.0523966682 -0.0235054908 0.0553950249 -0.1106857647 0.1351645071 [36] -0.0800810524 0.0569253226 -0.1014089446 0.1321011852 -0.1345825674 [41] 0.1035934173 -0.0441676609 -0.0190011271 0.0220640680 0.0165952714 [46] -0.0222837222 0.0056528738 > (mypacf <- c(rpacf$acf)) [1] -0.4846364345 -0.1999398105 -0.2047322278 0.0895290210 -0.0743281568 [6] -0.0646692691 -0.0514403695 -0.3070265637 -0.0070492328 -0.2162008427 [11] 0.1418775482 0.0136486568 -0.1983446951 -0.0189972770 0.0156866773 [16] 0.0550448379 0.0057515584 -0.1390228193 0.0691251838 -0.0557383363 [21] 0.0479959659 0.0250423501 0.0746889220 -0.2270953050 -0.0356912606 [26] -0.0539065601 -0.1359145774 -0.1719627699 -0.0306940622 0.0298590936 [31] 0.0039043495 0.0027470725 -0.1250894805 -0.1079303009 0.0131778973 [36] -0.0589698854 0.0085496208 0.1044115518 0.0187131993 -0.0689201861 [41] -0.0603569386 0.0141185165 0.0530013673 0.0001788848 -0.0842086026 [46] 0.0091087142 > 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/3pnej1259858253.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/4gokt1259858253.tab") > > system("convert tmp/1zlx71259858253.ps tmp/1zlx71259858253.png") > system("convert tmp/22esn1259858253.ps tmp/22esn1259858253.png") > > > proc.time() user system elapsed 0.565 0.308 0.667