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(593530,610763,612613,611324,594167,595454,590865,589379,584428,573100,567456,569028,620735,628884,628232,612117,595404,597141,593408,590072,579799,574205,572775,572942,619567,625809,619916,587625,565742,557274,560576,548854,531673,525919,511038,498662,555362,564591,541657,527070,509846,514258,516922,507561,492622,490243,469357,477580,528379,533590,517945,506174,501866,516141,528222,532638,536322,536535,523597,536214,586570) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > 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/html/rcomp/tmp/11v0p1260624959.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/23z3p1260624959.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.000000e+00 2.201732e-01 -2.226164e-01 -2.628384e-01 -1.817640e-01 [6] 8.154692e-02 2.184717e-01 8.046992e-02 -2.266691e-01 -2.631163e-01 [11] -2.094170e-01 2.876798e-01 7.301402e-01 9.578397e-02 -2.263753e-01 [16] -2.338973e-01 -1.778365e-01 4.460201e-02 1.341407e-01 2.335125e-02 [21] -2.327157e-01 -2.400869e-01 -1.638825e-01 2.360421e-01 4.977530e-01 [26] 1.658793e-02 -1.996792e-01 -1.711302e-01 -1.195860e-01 4.316515e-02 [31] 7.493556e-02 1.084792e-03 -1.913744e-01 -1.779896e-01 -6.786478e-02 [36] 1.695391e-01 2.900601e-01 -4.493261e-03 -9.273502e-02 -1.009685e-01 [41] -2.752409e-02 3.439544e-02 4.479309e-02 4.284893e-03 -9.323100e-02 [46] -7.783720e-02 -1.131756e-02 9.874247e-02 1.369917e-01 -1.884058e-02 [51] -3.954419e-02 -3.640243e-02 -4.170671e-06 3.255664e-03 4.725115e-03 [56] -3.167183e-03 -4.388542e-02 -1.258970e-02 1.570565e-02 4.295865e-02 > (mypacf <- c(rpacf$acf)) [1] 0.220173155 -0.284903644 -0.156849642 -0.162016251 0.067569439 [6] 0.085423523 -0.013462584 -0.212630038 -0.119785401 -0.226946437 [11] 0.292747260 0.605601873 -0.146714093 0.006369440 0.023575766 [16] -0.113897327 -0.088853477 -0.209249787 -0.049230948 -0.021852241 [21] -0.011948975 -0.031729096 -0.162685475 -0.046897649 -0.030329496 [26] -0.079171782 0.039986778 0.025772086 0.053612888 -0.041092863 [31] -0.006142619 -0.007150986 -0.024299056 0.064510949 -0.127028277 [36] -0.148193188 0.056242001 0.052079544 -0.066966212 0.047776554 [41] -0.039771193 0.050254670 -0.008133439 0.069065620 0.020953517 [46] -0.008474550 0.039119446 -0.060340304 -0.112084776 -0.029321370 [51] -0.058938791 -0.084601756 -0.056502012 -0.007022886 -0.047233622 [56] -0.053147128 0.010893406 -0.002678183 0.047641158 > 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/3llsc1260624959.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/4vhdc1260624959.tab") > > system("convert tmp/11v0p1260624959.ps tmp/11v0p1260624959.png") > system("convert tmp/23z3p1260624959.ps tmp/23z3p1260624959.png") > > > proc.time() user system elapsed 0.577 0.321 0.692