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 = '1' > par3 = '1' > 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/wessaorg/rcomp/tmp/16crq1356220291.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/wessaorg/rcomp/tmp/24h661356220291.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.000000000 -0.446025981 0.033374844 0.350733532 -0.353700635 [6] 0.127342973 0.183190415 -0.426036376 0.247585397 -0.156433537 [11] -0.139594235 0.151131633 -0.141061817 -0.021175737 0.124491410 [16] -0.054763062 -0.063423516 0.104720047 -0.044125663 -0.066136399 [21] 0.178649788 -0.114842590 -0.143073514 0.323933239 -0.297778376 [26] 0.117319295 0.123163903 -0.174962630 0.097608777 0.052883900 [31] -0.150985339 0.155590582 -0.102239611 -0.006580659 0.091595777 [36] -0.111791818 0.010187435 0.042902101 -0.063965644 0.062143512 [41] -0.019798838 -0.030284339 0.001467382 0.047050678 -0.029270856 [46] 0.043462936 0.003762591 -0.002342259 0.034277433 0.004721117 [51] -0.038479226 0.017192218 0.018914037 -0.011125624 -0.007263435 [56] -0.014466961 -0.017668278 > (mypacf <- c(rpacf$acf)) [1] -0.4460259809 -0.2066813488 0.3605841643 -0.0446983498 -0.0865429294 [6] 0.1389270006 -0.2362570952 -0.1155439250 -0.2237820520 -0.0752276268 [11] -0.0792372389 -0.0346322054 -0.0003761344 -0.0127151266 0.1325966643 [16] -0.1961879983 -0.1208799643 -0.0595677846 -0.1528252647 0.0527746903 [21] 0.0004672515 -0.2122631753 0.1077372232 -0.0720994405 -0.0092044593 [26] -0.0891559822 0.1097736920 -0.0990195777 -0.1364361944 0.0547318717 [31] -0.1230772887 -0.0398226653 -0.0490241560 0.0315425233 -0.0232282477 [36] -0.0695154719 -0.0526247137 -0.1090031581 0.0636913719 -0.1289414757 [41] -0.0974976387 -0.0294821410 -0.0586108653 -0.0152411292 0.0673413512 [46] -0.0758320426 0.0300334543 0.0030537931 -0.0216848286 -0.1599101875 [51] -0.0357417139 0.0274016719 -0.0390094871 0.0637544318 -0.0016784375 [56] 0.0013899921 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/31dnt1356220291.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/wessaorg/rcomp/tmp/476491356220291.tab") > > try(system("convert tmp/16crq1356220291.ps tmp/16crq1356220291.png",intern=TRUE)) character(0) > try(system("convert tmp/24h661356220291.ps tmp/24h661356220291.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.288 0.287 1.581