R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(591000,589000,584000,573000,567000,569000,621000,629000,628000,612000,595000,597000,593000,590000,580000,574000,573000,573000,620000,626000,620000,588000,566000,557000,561000,549000,532000,526000,511000,499000,555000,565000,542000,527000,510000,514000,517000,508000,493000,490000,469000,478000,528000,534000,518000,506000,502000,516000,528000,533000,536000,537000,524000,536000,587000,597000,581000,564000,558000,575000) > 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/12i821290550480.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/22i821290550480.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.88510746 0.72108812 0.61536215 0.57982495 0.58380233 [7] 0.56244730 0.48125729 0.38364194 0.32189690 0.32450397 0.38218015 [13] 0.38917665 0.24444739 0.07406623 -0.03838517 -0.08785838 -0.10057867 [19] -0.13156746 -0.20639462 -0.28925342 -0.33565674 -0.31641766 -0.25365303 [25] -0.22800802 -0.31149249 -0.40021411 -0.43660520 -0.42559776 -0.38872455 [31] -0.36431036 -0.36935389 -0.38441120 -0.36416232 -0.30358498 -0.22149898 [37] -0.17561358 -0.19373462 -0.21744565 -0.20945835 -0.17707867 -0.12574687 [43] -0.09135890 -0.07784314 -0.07331137 -0.05327379 -0.01586209 0.02857658 [49] 0.05320873 > (mypacf <- c(rpacf$acf)) [1] 0.8851074638 -0.2877723115 0.2424538269 0.1480246845 0.1218311359 [6] -0.0865281702 -0.1517167725 -0.0102270532 0.0395385777 0.1401570371 [11] 0.1923956579 -0.2025330917 -0.5657031257 0.0434802189 -0.0518851911 [16] -0.1111949227 -0.0382074295 0.0281541286 -0.0010493009 -0.0364353289 [21] 0.0139463028 0.0421681728 -0.0527008473 0.0776490522 -0.0817326684 [26] 0.0844526564 -0.0176354956 -0.0409178360 -0.0143624790 0.0438820392 [31] 0.0468161007 -0.0493624951 0.0787726851 -0.1079572156 -0.0547025709 [36] -0.0118545386 0.1272631932 -0.1254165414 -0.0369020724 0.0001954899 [41] 0.0512251363 -0.1321684198 0.0743237773 -0.0142378880 -0.0971661051 [46] -0.0660841803 0.0524530371 0.0217378300 > 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/3ys5t1290550480.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/4r1nw1290550480.tab") > > try(system("convert tmp/12i821290550480.ps tmp/12i821290550480.png",intern=TRUE)) character(0) > try(system("convert tmp/22i821290550480.ps tmp/22i821290550480.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.860 0.480 1.328