On 7/30/12 2:03 PM, Jiqiang Guo wrote:
> I did not work on this. But I did try to understand a bit of the
> business behind
> the calculation of auto-correlation using FFT.
>
> My thinking is one options is that we use FFTW in RStan if possible,
We can just use R at that point.
> for which I do not think
> we have a license issue.
Correct.
> One reason is that part of the
> mcmc::chains's is in RStan; I am
> not using mcmc::chains directly any more.
Are you extending mcmc::chains or did you just
rewrite it? We should talk about the design, because
the whole point of writing mcmc::chains was so that
you could use it in RStan.
> If we use kissFFT and pad more zeros to make the size be good for it,
> we need to figure out
> how many zeroes we need to add.
Powers of 2 work well, so that's no problem. The issue
is whether that changes the output in some predictable
way we can rescale automatically.
An alternative is to do the direct calculations, which
can be expensive if the autocorrelation time is long.
> The transforming of output should be easy.
>
> I did not understand the index munging in I/O mentioned below.
The problem is that C++ is row-major (first-index major for
larger numbers of dimensions) and R is column-major (last-index
major), so you have to write logic to do this transformation.
Right now, that's taking about half the overall time of the
ESS calcs.
- Bob