dfm / dfm/emcee

Issue on class emcee.moves.GaussianMove(cov, mode='vector', factor=None)

Open
#445 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.6k
Forks
440
PR merge metrics
No merged PRs in 30d

Description

For class emcee.moves.GaussianMove(cov, mode='vector', factor=None), the emcee docs (and the comments in the source code) all say the parameter factor (Optional[float]) is invalid for the "vector" mode. However, I do not find factor option is forbidden in actual calculation of proposal samples when mode="vector" in the following code.
Also, I don't quite understand mathematically why factor (Optional[float])` is invalid for the "vector" mode.

As far as I understand, factor (Optional[float]) makes the Gaussian with flexible scale (i.e., add a factor to the fixed input scale parameter), which somewhat introduce more randomness to benefit the proposal.
Then the proposal distribution turn out to be
Screen Shot 2022-10-18 at 1 40 09 PM
Here, x is the proposal sample, G represent Gaussian distribution, cov and factor are the input parameters, f is the proposal factor value in actual calculation, which follows LogUniform(-self.log_factor, self.log_factor) in this line.

From my understanding, the proposal distribution keeps a symmetric distribution, which means we do not need to introduce additional factor to account for difference in proposal distribution q(x|x') and q(x'|x) when calculating the acceptance rate in MCMC, i.e., the same as a regular Gaussian proposal.
And it's nothing related to mode if I understand correctly.

Also, another question comes to me when thinking of the mode. If one provides the full, square covariance matrix and choose "random", or "sequential" mode, that means, sampler selects one dimension in each iteration, proposal distribution becomes marginalized Gaussian in this situation. Only the variance element will affect the proposal but the covariance (non-diagonal elements) won't be considered. That's probably a loss of information. Maybe "random", or "sequential" mode should be disabled in this case?

I may make some mistakes when thinking of all these. Please correct me if there're some problems.
Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stable moves documentation and src/emcee/moves/gaussian.py, especially the GaussianMove parameter comments and factor calculation. Reproduce the vector, random, and sequential modes described in the issue, then determine whether the implementation or documentation is inconsistent; done means the behavior and its mathematical explanation are aligned.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.