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(143827,145191,146832,148577,149873,151847,153252,154292,155657,156523,156416,156693,160312,160438,160882,161668,164391,168556,169738,170387,171294,172202,172651,172770,178366,180014,181067,182586,184957,186417,188599,189490,190264,191221,191110,190674,195438,196393,197172,198760,200945,203845,204613,205487,206100,206315,206291,207801,211653,211325,211893,212056,214696,217455,218884,219816,219984,219062,218550,218179,222218,222196,223393,223292,226236,228831,228745,229140,229270,229359,230006,228810,232677,232961,234629,235660,240024,243554,244368,244356,245126,246321,246797,246735,251083,251786,252732,255051,259022,261698,263891,265247,262228,263429,264305,266371,273248,275472,278146,279506,283991,286794,288703,289285,288869,286942,285833,284095,289229,289389,290793,291454,294733,293853,294056,293982,293075,292391) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1nvf91292947384.ps",horizontal=F,onefile=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/2nvf91292947384.ps",horizontal=F,onefile=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.975387547 0.950078496 0.924185972 0.898199451 [6] 0.871901190 0.845317317 0.819584345 0.793617913 0.767735054 [11] 0.741567673 0.716174521 0.689533132 0.662171130 0.633442512 [16] 0.603974733 0.574342973 0.545527416 0.518370549 0.492552468 [21] 0.466697618 0.441320096 0.416315268 0.392886353 0.369413707 [26] 0.346790291 0.324521635 0.301154309 0.278328602 0.256361536 [31] 0.235257415 0.215766074 0.196739667 0.177773464 0.158940055 [36] 0.140840619 0.121979684 0.103767052 0.085799573 0.067871581 [41] 0.050207752 0.033005515 0.017465119 0.003199178 -0.010928738 [46] -0.024782031 -0.038832478 -0.052189539 -0.065900929 -0.079080163 [51] -0.092766014 -0.106642289 -0.120617985 -0.134230134 -0.146491514 [56] -0.157684585 -0.169005277 -0.180296849 -0.192329182 -0.203747282 [61] -0.215875647 > (mypacf <- c(rpacf$acf)) [1] 0.9753875474 -0.0267872219 -0.0247902731 -0.0150695231 -0.0199289340 [6] -0.0197286681 0.0034305805 -0.0192733974 -0.0129648470 -0.0204235008 [11] 0.0008997911 -0.0410048304 -0.0299627837 -0.0439546126 -0.0319073288 [16] -0.0210023048 -0.0004669192 0.0148006714 0.0090587656 -0.0203461470 [21] -0.0083185455 -0.0115884543 0.0149336063 -0.0181660435 0.0014639613 [26] -0.0093065068 -0.0388558074 -0.0059064511 0.0001132730 -0.0042302991 [31] 0.0135379031 -0.0110991532 -0.0176778813 -0.0159474303 -0.0011830104 [36] -0.0340877511 -0.0051469283 -0.0121007654 -0.0161257030 -0.0105267860 [41] -0.0061882143 0.0136236476 0.0076038961 -0.0182113868 -0.0114631858 [46] -0.0211502039 0.0009449843 -0.0217343435 -0.0048337498 -0.0270156717 [51] -0.0212734527 -0.0189182171 -0.0085415970 0.0067151744 0.0036854991 [56] -0.0240261760 -0.0174655867 -0.0342013394 0.0004100145 -0.0305759878 > 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/3j5d01292947384.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/4beu31292947384.tab") > > try(system("convert tmp/1nvf91292947384.ps tmp/1nvf91292947384.png",intern=TRUE)) character(0) > try(system("convert tmp/2nvf91292947384.ps tmp/2nvf91292947384.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.637 0.341 1.314