R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) 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(103.34,102.60,100.69,105.67,123.61,113.08,106.46,123.38,109.87,95.74,123.06,123.39,120.28,115.33,110.40,114.49,132.03,123.16,118.82,128.32,112.24,104.53,132.57,122.52,131.80,124.55,120.96,122.60,145.52,118.57,134.25,136.70,121.37,111.63,134.42,137.65,137.86,119.77,130.69,128.28,147.45,128.42,136.90,143.95,135.64,122.48,136.83,153.04,142.71,123.46,144.37,146.15,147.61,158.51,147.40,165.05,154.64,126.20,157.36,154.15,123.21,113.07,110.45,113.57,122.44,114.93,111.85,126.04,121.34,124.36) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '0.0' > par1 = '60' > 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/fisher/rcomp/tmp/1rbt21356219760.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/26as41356219760.ps",horizontal=F,onefile=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.0000000000 0.5826820556 0.4129950575 0.4967589599 0.4429351385 [6] 0.3644812237 0.3850747175 0.2159653891 0.2836143337 0.1628164090 [11] -0.0004772401 0.1369674674 0.3407466146 0.0943806677 0.0072139206 [16] 0.0582574943 0.0883205010 0.0440442631 0.0694072232 0.0213065869 [21] 0.0559091901 -0.0557615807 -0.1469385624 -0.0418181489 0.0676711686 [26] -0.0645138953 -0.1766511753 -0.1066177195 -0.0419763041 -0.1101358713 [31] -0.1105517527 -0.0814046674 -0.1388384238 -0.1782580673 -0.2254870780 [36] -0.2132517437 -0.1000211366 -0.1765256716 -0.2999581724 -0.1960548570 [41] -0.1659781719 -0.2164902658 -0.1872973872 -0.1600954032 -0.2199015254 [46] -0.2120102512 -0.2376414063 -0.2184885320 -0.1230664166 -0.1896425377 [51] -0.2587550677 -0.1572549476 -0.1457076680 -0.1606531447 -0.0929357143 [56] -0.0848131596 -0.0561866747 -0.0077373838 -0.0250234598 0.0438560720 [61] 0.1115114180 > (mypacf <- c(rpacf$acf)) [1] 0.5826820556 0.1112471220 0.3342955184 0.0602717911 0.0487878813 [6] 0.0929338368 -0.2334492002 0.2137735365 -0.3202619936 -0.0893501062 [11] 0.2051574084 0.3479506206 -0.2025391158 -0.1713778616 0.0276308879 [16] 0.0478326523 -0.0883548905 0.0635769316 0.0270675779 -0.1154454899 [21] -0.0659927981 0.0347885199 0.0333304070 -0.1087729148 0.0887535103 [26] -0.1573203532 0.1089843500 0.0214991173 -0.0318027205 -0.0875978985 [31] -0.0327427179 -0.1326467291 0.0398634608 -0.0049786370 -0.1179344399 [36] 0.0224529566 -0.0001574329 0.0627287332 -0.0874584160 0.0193878810 [41] -0.0271090796 -0.0735849288 -0.0104608344 -0.0500887532 -0.0429406868 [46] -0.0054643486 -0.0175188356 0.0310446613 -0.0943277199 0.1000018459 [51] -0.0332172505 -0.0361877049 0.0551784594 0.0211386726 -0.0134219532 [56] 0.0905529281 0.0958172298 -0.0497716211 0.0355893268 0.0240715970 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/3dpdi1356219761.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/fisher/rcomp/tmp/4mjn51356219761.tab") > > try(system("convert tmp/1rbt21356219760.ps tmp/1rbt21356219760.png",intern=TRUE)) character(0) > try(system("convert tmp/26as41356219760.ps tmp/26as41356219760.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.362 0.447 1.793