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(617,614,647,580,614,636,388,356,639,753,611,639,630,586,695,552,619,681,421,307,754,690,644,643,608,651,691,627,634,731,475,337,803,722,590,724,627,696,825,677,656,785,412,352,839,729,696,641,695,638,762,635,721,854,418,367,824,687,601,676,740,691,683,594,729,731,386,331,706,715,657,653,642,643,718,654,632,731,392,344,792,852,649,629,685,617,715,715,629,916,531,357,917,828,708,858,775,785,1006,789,734,906,532,387,991,841,892,782,811,792,978,773,796,946,594,438,1023,868,791,760,779,852,1001,734,996,869,599,426,1138,1091,830,909) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '48' > 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 (par8 != '') par8 <- as.numeric(par8) > ox <- x > if (par8 == '') { + if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } + } else { + x <- log(x,base=par8) + } > 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/12s0x1356031764.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > plot(ox,type='l',main='Original Time Series',xlab='time',ylab='value') > if (par8=='') { + mytitle <- paste('Working Time Series (lambda=',par2,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } else { + mytitle <- paste('Working Time Series (base=',par8,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(base=',par8,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } > plot(x,type='l', main=mytitle,xlab='time',ylab='value') > par(op) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2j92v1356031764.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=mysub) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3k35c1356031764.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',sub=mysub) > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.0000000000 -0.5464440999 0.0523447616 0.1377312242 -0.2523468709 [6] 0.1300413891 -0.0190672952 -0.1103641031 0.2202850885 -0.0398613461 [11] -0.1023410852 0.2031731077 -0.1985154165 -0.0590160939 0.0765687715 [16] 0.0202658827 -0.0002768266 -0.0058557156 0.0949069267 -0.1055839034 [21] 0.0173155612 0.0498911366 -0.1383876060 0.1337152394 -0.1027988972 [26] 0.0163484790 0.1619026125 -0.2002460569 0.0399645626 0.1417745895 [31] -0.2226945367 0.1149195724 0.0318103096 -0.1737653215 0.1712705976 [36] -0.0185976790 -0.0532704258 0.1191783599 -0.1592615089 0.1092537189 [41] -0.0219277808 -0.0888930271 0.0624895728 0.0333272542 0.0129113135 [46] -0.0367093584 0.0379431520 0.0115483303 -0.1316411133 > (mypacf <- c(rpacf$acf)) [1] -5.464441e-01 -3.510932e-01 -2.516608e-02 -2.340651e-01 -1.972533e-01 [6] -1.576840e-01 -2.652574e-01 -5.477232e-02 1.323141e-01 1.760173e-02 [11] 1.994904e-01 1.537126e-01 -9.231134e-02 -2.072836e-01 7.801052e-03 [16] -6.356826e-03 -1.573951e-01 6.652872e-02 -2.595936e-02 -1.003162e-01 [21] 1.882033e-01 8.969666e-02 4.977667e-02 -1.220603e-02 -1.088724e-01 [26] -8.817783e-02 -1.275039e-01 -1.792390e-01 -5.749514e-02 -7.833834e-02 [31] -7.536247e-02 1.836504e-02 -8.264238e-02 -1.403114e-01 3.329229e-02 [36] 2.833590e-02 -2.221739e-02 -5.938763e-02 1.046205e-01 3.989368e-05 [41] -4.150909e-02 8.515155e-03 -2.133240e-02 4.588562e-02 5.587788e-02 [46] -2.006221e-02 6.403343e-02 6.809452e-04 > 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/4q5w51356031765.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/513le1356031765.tab") > > try(system("convert tmp/12s0x1356031764.ps tmp/12s0x1356031764.png",intern=TRUE)) character(0) > try(system("convert tmp/2j92v1356031764.ps tmp/2j92v1356031764.png",intern=TRUE)) character(0) > try(system("convert tmp/3k35c1356031764.ps tmp/3k35c1356031764.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.817 0.443 2.240