Code Monkey home page Code Monkey logo

Comments (4)

nchopin avatar nchopin commented on May 28, 2024

Hi,
The proposal distribution in mcmc.pmmh is a Gaussian random walk; i.e. the proposed parameter value is simulated from $\theta^p | \theta \sim N(\theta, \Sigma)$. The proposal covariance $\Sigma$ is either given by the user, or, if not, it is adapted (as in adaptive MCMC, i.e. it is estimated sequentially from past MCMC states).
First, can you ask you whether this point was clear to you? Otherwise, I think I should review the documentation. (This point is explained at least in the corresponding notebook tutorial, but maybe not in the docstrings.)

Anyway, I guess what happens here is that eventually the algorithm proposes a value of theta which gives you singular cov matrices (I'm talking about the cov matrix of the proposal of the states this time, inside each PF). Could you adapt the prior so that the prior probability of this happening is really zero?
In that case, pmmh will not even run the PF, and the problem should not arise.

from particles.

vwiela avatar vwiela commented on May 28, 2024

Thanks for your response.
It isn't clear to me how I could give the proposal covariance for the simulation of the new $\theta^p$. But unless this it is well explaind in the notebook tutorials.

My covariance matrix gets singular if it appears that $\gamma=0$ is chosen.
But since I gave as a prior a truncated normal distirbution which is truncated at $10^{-5}$ this should not be possible, because 0 is out of range.
But still it simulates $\gamma=0$ or at least so small that the values in the covariance matrix become numerically indistinguishable close I guess.

from particles.

nchopin avatar nchopin commented on May 28, 2024

First, to set the covariance matrix of the proposal, use argument rw_cov; see here:
https://particles-sequential-monte-carlo-in-python.readthedocs.io/en/latest/_autosummary/particles.mcmc.PMMH.html#particles.mcmc.PMMH

But now that you mention it, I can see that the docstring is not super-clear... I'll try to fix it shortly.

Second, yes, you're right, a value below $10^{-5}$ should not be proposed, since it's outside the prior range. I'll look into it, but, in the mean time, you could adapt your model to forbid values below $10^{-5}$ (e.g. by forcing $\gamma$ to be $=10^{-5}$ whenever the supplied value is smaller.

from particles.

nchopin avatar nchopin commented on May 28, 2024

More details are now given in the docstrings of PMMH and parent classes regarding parameter rw_cov, and more generally how to calibrate random walk proposals.

from particles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.