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 = '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/1xxy71356220113.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/21aj31356220113.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.314147916 -0.323580285 0.182926892 0.070393683 [6] -0.145932984 0.222223030 -0.261373172 0.208489739 0.019770222 [11] -0.313521998 -0.083361441 0.556139388 -0.208599071 -0.185103233 [16] 0.032668591 0.129106178 -0.106636265 0.082501538 -0.085733857 [21] 0.147934293 -0.042398229 -0.187684892 -0.027290882 0.320326654 [26] -0.038160005 -0.236243360 0.008729425 0.208599928 -0.134743853 [31] -0.008700938 0.113514430 -0.053660716 -0.009729575 -0.029231195 [36] -0.121736567 0.236529548 0.025118091 -0.262984554 0.087457760 [41] 0.134275577 -0.132078922 0.015692424 0.121835461 -0.099509420 [46] 0.017122373 -0.030071941 -0.066952271 0.183416639 -0.031689980 [51] -0.173859868 0.115215047 0.036465236 -0.085130452 0.055149636 [56] 0.002493938 -0.039896966 0.032680142 -0.053084040 -0.003375163 [61] 0.050584395 > (mypacf <- c(rpacf$acf)) [1] -3.141479e-01 -4.685055e-01 -1.613841e-01 -8.432345e-02 -1.364770e-01 [6] 2.121887e-01 -2.286470e-01 2.795602e-01 -2.696856e-03 -2.477932e-01 [11] -4.314792e-01 1.491153e-01 1.602568e-01 6.084042e-02 -4.655357e-02 [16] 2.741367e-02 -7.381690e-02 -9.980300e-02 1.931595e-02 -2.694884e-02 [21] 1.758535e-02 -2.342837e-02 3.413663e-02 -8.521764e-02 1.426912e-01 [26] -1.187230e-01 -4.516166e-02 3.471514e-02 1.015734e-02 1.738425e-02 [31] 1.310786e-01 -7.366190e-02 -4.359575e-02 4.621127e-02 -4.338856e-02 [36] -2.732488e-02 -1.149141e-01 6.802293e-02 -1.669711e-02 5.284368e-02 [41] 3.148459e-02 -2.160002e-02 4.871163e-02 -3.088302e-02 -1.021060e-02 [46] -8.559379e-02 -1.261722e-02 5.539865e-02 -8.617507e-02 6.852091e-02 [51] 3.517323e-02 -3.530347e-03 -2.897987e-06 2.062641e-02 -1.081611e-01 [56] -1.090610e-01 1.504727e-02 3.492793e-03 -3.504438e-02 -8.697097e-02 > 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/3470c1356220113.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/4n5ly1356220113.tab") > > try(system("convert tmp/1xxy71356220113.ps tmp/1xxy71356220113.png",intern=TRUE)) character(0) > try(system("convert tmp/21aj31356220113.ps tmp/21aj31356220113.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.311 0.288 1.612