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(361.58,363.19,363.61,364.14,365.51,365.51,365.5,365.5,364.59,364.63,364.54,363.67,365.22,369.05,370.45,370.46,370.46,370.58,370.58,370.22,370.21,370.29,370.29,370.2,370.2,372.55,374.51,375.58,375.75,375.75,375.75,375.69,375.76,377.5,377.51,377.74,369.82,373.1,374.55,375.01,374.81,375.31,375.31,375.39,375.59,376.26,377.18,377.26,377.26,381.87,387.09,387.14,388.78,389.16,389.16,389.42,389.49,388.97,388.97,389.09,389.09,391.76,390.96,391.76,392.8,393.06,393.06,393.26,393.87,394.47,394.57,394.57,394.57,399.57,406.13,407.03,409.46,409.9,409.9,410.14,410.54,410.69,410.79,410.97) > 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/1yi2k1289774167.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/29a161289774167.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.95478844 0.90806784 0.86046144 0.81261954 0.76569925 [7] 0.71847147 0.67034551 0.62252329 0.57689420 0.53211085 0.49879064 [13] 0.47161676 0.44183855 0.41526105 0.39174797 0.36791822 0.34514933 [19] 0.32235194 0.29915340 0.27529375 0.25223833 0.22917947 0.20394643 [25] 0.18176061 0.15371792 0.12582474 0.09817374 0.06974275 0.04044274 [31] 0.01119241 -0.01861550 -0.04835862 -0.07504613 -0.09985816 -0.11598603 [37] -0.12458196 -0.14648231 -0.16521748 -0.17863363 -0.19081372 -0.20270799 [43] -0.21427716 -0.22599393 -0.23720123 -0.24839765 -0.25838607 -0.26577057 [49] -0.26881991 > (mypacf <- c(rpacf$acf)) [1] 0.954788442 -0.040203323 -0.034253101 -0.027952917 -0.015762807 [6] -0.030344459 -0.037771964 -0.025033182 -0.004286978 -0.020169959 [11] 0.100398453 0.043241007 -0.054069809 0.013175700 0.015528283 [16] -0.025182058 -0.012377800 -0.020429693 -0.018693411 -0.025505966 [21] 0.002933819 -0.003283491 -0.048980379 0.017815706 -0.074171118 [26] -0.021124755 -0.021107016 -0.030689657 -0.037436608 -0.027942906 [31] -0.030549588 -0.023788646 -0.003948411 -0.002337259 0.064919985 [36] 0.050600027 -0.174682793 0.008344041 0.032229751 -0.015195786 [41] -0.030925971 -0.019886248 -0.013445598 -0.007373336 -0.007515746 [46] 0.018696249 -0.018555025 0.015758860 > 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/3ca0b1289774167.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/4xtgh1289774167.tab") > > try(system("convert tmp/1yi2k1289774167.ps tmp/1yi2k1289774167.png",intern=TRUE)) character(0) > try(system("convert tmp/29a161289774167.ps tmp/29a161289774167.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.730 0.520 1.229