R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(12008.00,9169.00,8788.00,8417.00,8247.00,8197.00,8236.00,8253.00,7733.00,8366.00,8626.00,8863.00,10102.00,8463.00,9114.00,8563.00,8872.00,8301.00,8301.00,8278.00,7736.00,7973.00,8268.00,9476.00,11100.00,8962.00,9173.00,8738.00,8459.00,8078.00,8411.00,8291.00,7810.00,8616.00,8312.00,9692.00,9911.00,8915.00,9452.00,9112.00,8472.00,8230.00,8384.00,8625.00,8221.00,8649.00,8625.00,10443.00,10357.00,8586.00,8892.00,8329.00,8101.00,7922.00,8120.00,7838.00,7735.00,8406.00,8209.00,9451.00,10041.00,9411.00,10405.00,8467.00,8464.00,8102.00,7627.00,7513.00,7510.00,8291.00,8064.00,9383.00,9706.00,8579.00,9474.00,8318.00,8213.00,8059.00,9111.00,7708.00,7680.00,8014.00,8007.00,8718.00,9486.00,9113.00,9025.00,8476.00,7952.00,7759.00,7835.00,7600.00,7651.00,8319.00,8812.00,8630.00) > par8 = '' > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > 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/1xde11323521769.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/20wjg1323521769.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.200332852 -0.067334547 -0.110482442 -0.005098171 [6] -0.150416843 -0.019135974 0.147314721 -0.088188972 0.196833390 [11] 0.086703222 -0.092255818 -0.387896846 0.033429053 0.171765911 [16] -0.011595847 0.129246712 0.047782636 -0.029536454 -0.028214399 [21] -0.062358716 -0.031693508 -0.118948162 0.175072359 0.159150713 [26] -0.037959862 -0.209822957 0.071528875 -0.106702530 -0.002381804 [31] 0.060588127 0.095333646 0.063538736 -0.040902650 -0.008402385 [36] -0.081979821 -0.160018660 > (mypacf <- c(rpacf$acf)) [1] -0.200332852 -0.111961164 -0.156052073 -0.078704025 -0.214072928 [6] -0.154576377 0.048571731 -0.130300596 0.152577477 0.175854873 [11] -0.009099700 -0.358681856 -0.189175088 0.106470374 0.035263652 [16] 0.087950057 0.028487866 -0.048858649 0.057314021 -0.062169817 [21] 0.118060915 0.028583414 0.004222974 0.038278876 -0.045372173 [26] -0.178879082 0.050079816 -0.045274788 0.041588479 0.001351417 [31] 0.073089800 0.102367290 -0.068270598 -0.112276718 0.081538487 [36] -0.073927428 > 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/3105r1323521769.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/46gen1323521769.tab") > > try(system("convert tmp/1xde11323521769.ps tmp/1xde11323521769.png",intern=TRUE)) character(0) > try(system("convert tmp/20wjg1323521769.ps tmp/20wjg1323521769.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.727 0.125 0.850