R version 2.10.1 (2009-12-14) 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(25000,25284,12434.5,33955,14980.5,50831,4198.5,34566,35000,11055.5,20807,21887.29,16977.5,19613.5,14570,24416.5,16825.5,13980,21450.5,27239.5,19078.5,20459.1,20373.5,19306.5,16723.16,11638,20917,17903.5,28218.5,15268,21555,23143,16691,17932.5,30512,41931.5,10853.5,25939.5,14900,25127.76,22063.5,25306.5,31217.5,23201.5,38148,26264,16359,27945.5,16218.5,36003.5,20323.5,20100.5,18741,24426.75,19174.5,13766,18999,21745,34469,13248,16218.5,36003.5,20323.5,20100.5,18741,24426.75,19174.5,13766,18999,21745,34469,13248) > 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/rcomp/tmp/1izq21275661287.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/rcomp/tmp/2izq21275661287.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.319417458 0.109185810 0.007194751 0.068925547 [6] 0.092579996 -0.206958114 0.131618822 0.049719579 0.030356397 [11] -0.085884311 -0.077370831 0.090446071 -0.105917947 0.109663927 [16] -0.076876972 0.086720914 -0.100910059 -0.110125279 -0.009882319 [21] -0.151627629 0.039685422 -0.189069925 0.136217703 -0.127968758 [26] -0.122179293 0.044474732 0.060640758 -0.051557908 -0.099849277 [31] 0.178640506 -0.091764201 -0.002335793 -0.170605426 0.105277593 [36] 0.035539571 -0.006313959 0.067303489 -0.056744038 0.159956761 [41] -0.027403577 -0.019708788 0.172835855 -0.081854114 0.098189530 [46] -0.077798010 0.097469800 -0.080890900 -0.003332592 > (mypacf <- c(rpacf$acf)) [1] -0.319417458 0.007971622 0.049379777 0.094227622 0.153256175 [6] -0.165787029 -0.007762742 0.112258920 0.085643889 -0.058651891 [11] -0.148145873 -0.036820868 -0.061938394 0.137623212 0.041819277 [16] 0.022063777 -0.138197475 -0.193616395 -0.110101708 -0.133332797 [21] -0.035883386 -0.176051086 0.019400243 -0.071971118 -0.157418199 [26] -0.029074518 0.193545367 -0.027168315 -0.149545560 0.066155617 [31] -0.111019250 -0.052962989 -0.154084073 0.006457156 -0.069516341 [36] 0.090374116 0.092478024 -0.091499614 -0.009853332 0.028931766 [41] -0.037241814 0.075145743 -0.077854597 -0.208261065 -0.072187849 [46] 0.045687174 -0.034754163 0.007804848 > 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/3e9ot1275661287.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/4p0nw1275661287.tab") > > try(system("convert tmp/1izq21275661287.ps tmp/1izq21275661287.png",intern=TRUE)) character(0) > try(system("convert tmp/2izq21275661287.ps tmp/2izq21275661287.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.560 0.340 0.622