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(5789,6333,6901,5813,6504,5619,5867,6084,5258,5601,5081,4678,5463,5546,6810,6407,5985,5119,5904,5034,4922,6083,4365,4464,4557,5885,5286,6017,5376,5935,6276,5510,5998,5193,4602,5326,5307,5014,6153,6441,5584,6427,6062,5589,6216,5809,4989,6706,7174,6122,8075,6292,6337,8576,6077,5931,6288,7167,6054,6468,6403,6927,7914,7728,8701,8522,6481,7502,7778,7424,6941,8574,9171,7718,9083,7164,8213,8124,7075,7026,7390,7778,6203,6905,7087,6495,7664,6516,6322,7828,6708,6717,5707,8063,6315,5893,6914,7319,6615,7341,6210,7408,6168,5878,6834,6211,5982,6973) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/1yvoh1260300995.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/2yn1j1260300995.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.57641668 0.57168566 0.64129471 0.49552230 0.47813261 [7] 0.47272805 0.44592125 0.45204991 0.51787497 0.45139231 0.45441235 [13] 0.54676802 0.36417055 0.38225152 0.38092928 0.23658983 0.26729789 [19] 0.24147974 0.18123035 0.16995674 0.24251921 0.16135025 0.20048126 [25] 0.21205868 0.10110328 0.07773327 0.03419021 -0.04162714 -0.05038474 [31] -0.09373924 -0.14854615 -0.05821885 -0.05299173 -0.11394144 -0.12471697 [37] -0.06556562 -0.17992740 -0.22971018 -0.22781300 -0.25991194 -0.29540463 [43] -0.29030164 -0.25150507 -0.25723236 -0.27618622 -0.21664389 -0.25623200 [49] -0.24134382 > (mypacf <- c(rpacf$acf)) [1] 0.5764166792 0.3585648625 0.3836451612 0.0032187571 0.0088918503 [6] 0.0138187727 0.0784300430 0.1001508964 0.2234884283 0.0149685315 [11] 0.0052391990 0.1550329658 -0.1941398719 -0.0651884186 -0.0703334082 [16] -0.1576951609 -0.0346963250 -0.0517189369 -0.0620159920 -0.1038538950 [21] 0.0829303703 -0.0216018599 0.0913067198 -0.0037879612 -0.0376259457 [26] -0.1542691308 -0.1201522970 -0.0417331300 -0.0350928598 -0.0632562796 [31] -0.1024245830 0.1256448472 0.0606967548 0.0332280122 -0.1703012021 [36] 0.0750490126 -0.0490354648 -0.0869877158 -0.0272821088 0.0570535690 [41] -0.0265152574 -0.0032465628 0.1779458454 -0.0364503407 -0.1019283388 [46] 0.0626162752 -0.0093451526 0.0002386192 > 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/3y5b51260300995.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/4fnhf1260300995.tab") > > system("convert tmp/1yvoh1260300995.ps tmp/1yvoh1260300995.png") > system("convert tmp/2yn1j1260300995.ps tmp/2yn1j1260300995.png") > > > proc.time() user system elapsed 0.576 0.302 1.036