Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing decomposition update period in AFSS algorithm #21

Open
pglpm opened this issue Mar 4, 2020 · 1 comment
Open

Changing decomposition update period in AFSS algorithm #21

pglpm opened this issue Mar 4, 2020 · 1 comment

Comments

@pglpm
Copy link

pglpm commented Mar 4, 2020

Hi all, this refers to LaplacesDemon.R

The Automated Factor Slice Sampler has an initial adaptive stage, of A iterations, during which the proposal covariance matrix is periodically updated from the scatter matrix of the observed samples. The period of these updates is given by decomp.freq. Such updates are no longer made after A iterations.

In the present version, this update period is chosen as (line 1794)
decomp.freq <- max(LIV * floor(Iterations / Thinning / 100), 10)

where LIV is the number of parameters (dimension of the sampled space), Iterations is the total number of requested MCMC iterations (before thinning), and Thinning is the thinning.

It seems strange to me that the update period is calculated based on the total number of iterations requested, rather than on the number of adaptive ones, A. Consider this case: the user wants a very large number of samples (Iterations/Thinning large), but chooses a much shorter adaptive time A, known to be sufficient. In such a case the update period, according to the formula above, would be very large, potentially becoming insufficient. In fact it may never happen if A < max(LIV * floor(Iterations / Thinning / 100), 10).

The update period should probably be calculated based on the number of parameters alone. But at least it should depend on the adaptive time A rather than the full sampling time, for the reason explained above. I propose to change line 1794 into either
decomp.freq <- max(LIV * floor(A/ Thinning / 10), 10)
or even just
decomp.freq <- max(LIV, 10) or decomp.freq <- max(2*LIV, 10)
to make sure that at least as many iterations as parameters have passed. Similar changes should be made for the blockwise computation on lines 1963–1964.

I checked Tibbits & al. 2014, mentioned in the manual, but they don't seem to give any specific recommendation.

Any take on this?

@singmann
Copy link
Contributor

singmann commented Mar 4, 2020

Sounds reasonable. Feel free to submit a pull request and if possible note the new behaviour in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants