R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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 = '1' > 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/rcomp/tmp/17hf91292947204.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/rcomp/tmp/27hf91292947204.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.103287739 0.032835343 -0.121791415 -0.003443619 [6] -0.103170828 -0.141673105 -0.007140622 0.010578860 -0.123190403 [11] -0.014130004 0.031253416 0.626746323 0.032338673 -0.023378529 [16] -0.146307072 -0.084924764 -0.134383665 -0.238483160 -0.039326858 [21] -0.054159223 -0.070203671 -0.006371565 0.041414215 0.493450581 [26] -0.048498573 -0.075893274 -0.195658778 -0.014665833 -0.125606779 [31] -0.197285298 -0.018990674 -0.054540527 -0.118543627 0.006211566 [36] 0.041776668 0.422183831 -0.066057538 -0.050264376 -0.197365830 [41] 0.001610542 -0.086981979 -0.121868990 0.007355060 -0.011928698 [46] -0.075043087 0.022167317 0.038255851 0.393777932 -0.006738649 [51] -0.014699870 -0.129050724 0.038793772 -0.050275722 -0.077554274 [56] 0.006428619 -0.006643239 0.015602583 0.030618207 0.052303903 [61] 0.306644072 > (mypacf <- c(rpacf$acf)) [1] 0.1032877386 0.0224060213 -0.1288599059 0.0219581318 -0.0993331967 [6] -0.1420764022 0.0320876880 -0.0090292107 -0.1686750366 0.0142902682 [11] 0.0167265319 0.6114684698 -0.1297775675 -0.1298171516 -0.0512984865 [16] -0.1115699653 0.0235255015 -0.2057913228 -0.1154601570 -0.0964397624 [21] 0.0568842736 0.0397914728 -0.0074627499 0.1357767235 -0.1745739726 [26] -0.0519063123 -0.1125172610 0.1304479388 -0.0642238248 -0.0418028625 [31] -0.0391430876 -0.0740947101 -0.0996404519 -0.0292852867 -0.0638719882 [36] -0.0337168904 -0.0335974169 -0.0355696836 -0.0211281048 -0.0106424258 [41] -0.0004653166 0.0063732332 -0.1133962106 0.0103354989 -0.0589823010 [46] -0.0005118437 -0.0822191894 0.0531401891 0.0281666990 -0.0395243799 [51] 0.0376649588 -0.0701110183 0.0103585894 0.0096788524 -0.0947872796 [56] -0.0486288357 0.1292584084 -0.0344944201 -0.0225857776 -0.0547554660 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3szve1292947204.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/rcomp/tmp/4e0uk1292947204.tab") > > try(system("convert tmp/17hf91292947204.ps tmp/17hf91292947204.png",intern=TRUE)) character(0) > try(system("convert tmp/27hf91292947204.ps tmp/27hf91292947204.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.67 0.41 1.08