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 = '0' > 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/1e6wr1259857903.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/2sbl21259857903.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.570365589 0.561008229 0.458637072 0.452352553 [6] 0.271509100 0.260688983 0.168584749 0.136476530 0.211653681 [11] 0.135281900 0.218405726 0.078593120 0.124043644 0.138657451 [16] 0.134142521 -0.006753373 -0.026895869 -0.073381509 -0.100282366 [21] -0.144204581 -0.195782252 -0.236323666 -0.262242734 -0.326846375 [26] -0.226503334 -0.299319820 -0.292364046 -0.228569692 -0.105499441 [31] -0.148196262 -0.130690045 -0.135062326 -0.161631798 -0.091530184 [36] -0.150832945 -0.148841319 -0.191601447 -0.135054040 -0.184024424 [41] -0.105454819 -0.140897925 -0.090877745 -0.048658830 -0.019104969 [46] -0.011178355 0.002397577 -0.004191930 > (mypacf <- c(rpacf$acf)) [1] 0.570365589 0.349336342 0.086416198 0.116873606 -0.171467229 [6] -0.014062528 -0.043695993 -0.020685016 0.245104334 -0.045934218 [11] 0.155298488 -0.210522101 -0.061573439 0.162115895 -0.054669319 [16] -0.089662759 -0.141745341 -0.104044232 0.041196308 -0.100627178 [21] 0.016105361 -0.114060520 -0.107114209 -0.186522979 0.136124857 [26] -0.021421356 0.016795157 0.093287678 0.102225954 0.007618953 [31] -0.067620621 -0.058897601 -0.042663215 0.094465143 0.043265283 [36] -0.082852427 -0.006268246 -0.036346804 -0.110721042 -0.004262951 [41] 0.035754603 0.039508892 -0.042515951 -0.080964347 -0.030744062 [46] 0.040005574 -0.021538734 > 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/3jhip1259857903.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/4tn8z1259857903.tab") > > system("convert tmp/1e6wr1259857903.ps tmp/1e6wr1259857903.png") > system("convert tmp/2sbl21259857903.ps tmp/2sbl21259857903.png") > > > proc.time() user system elapsed 0.580 0.312 0.824