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(121.67,121.65,121.61,121.5,121.41,121.41,121.4,121.38,121.34,121.19,120.96,120.96,120.96,120.9,120.86,120.73,120.53,120.53,120.53,120.52,120.51,120.43,120.29,120.27,120.27,120.24,120.21,120.06,119.86,119.85,119.85,119.83,119.71,119.57,119.2,119.13,119.13,119.09,118.9,118.54,118.12,118.11,118.1,118.08,117.91,117.63,117.28,117.2,117.17,117.14,116.96,116.34,115.99,115.99,115.97,115.92,115.63,115.31,115.13,115.09,115.07,115.01,114.64,113.86,113.34,113.33,113.32,113.26,113.2,112.61,112.28,112.16) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/html/rcomp/tmp/138yw1272899765.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/238yw1272899765.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.44184162 -0.17610222 -0.36776738 -0.19683059 0.32185551 [7] 0.68416076 0.33947469 -0.13545124 -0.31965802 -0.14207957 0.30571030 [13] 0.58381063 0.24401578 -0.18965367 -0.29780733 -0.10738741 0.27964312 [19] 0.45757814 0.11985717 -0.20386452 -0.27920382 -0.10703101 0.23812220 [25] 0.35753878 0.07219915 -0.19619703 -0.26481434 -0.13056767 0.17777211 [31] 0.23275723 -0.00580964 -0.18648312 -0.24855814 -0.14365596 0.10855496 [37] 0.11999197 -0.05667679 -0.17366931 -0.20147198 -0.12522792 0.05097568 [43] 0.06163190 -0.09117905 -0.17007137 -0.18095103 -0.10717408 0.03366422 [49] 0.04230856 > (mypacf <- c(rpacf$acf)) [1] 0.441841622 -0.461403235 -0.079232590 -0.015951795 0.449751419 [6] 0.406395206 -0.117953592 0.051406145 0.003428227 0.090939319 [11] 0.106878380 0.135548930 -0.162205918 -0.024138438 0.049652782 [16] -0.007166640 0.005799448 -0.068885870 -0.123202095 0.071511328 [21] -0.062887916 -0.052779150 -0.025655200 -0.025295148 0.021760135 [26] 0.025101525 -0.058227288 -0.103820657 0.039299811 -0.123463209 [31] 0.022330011 -0.017554583 -0.095257058 -0.047337754 -0.021216863 [36] -0.101516889 0.012478081 -0.031490410 0.019331238 -0.033630651 [41] -0.029282474 0.027908610 -0.031340313 -0.011156346 -0.019825234 [46] 0.037627721 -0.039405764 0.094178878 > 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/3orx11272899765.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/4r9d71272899765.tab") > > try(system("convert tmp/138yw1272899765.ps tmp/138yw1272899765.png",intern=TRUE)) character(0) > try(system("convert tmp/238yw1272899765.ps tmp/238yw1272899765.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.575 0.310 0.875