Code Monkey home page Code Monkey logo

Comments (3)

nchopin avatar nchopin commented on May 29, 2024 1

Hi,
to fix your problem (proposed values often fall outside the support of the prior distribution), you may :

  1. change the value of parameter `rw_cov' (default is Identity), which gives the covariance matrix of the random walk proposal. You could take something like tau * Identity, with tau=10^{-1} or 10^{-2}. This will make the steps of the random walk much smaller, so it's more likely you stay in the support of the prior.
  2. consider using an unconstrained prior, say a Gaussian with a small variance.

Regarding 1, I don't know whether you use the adaptive version (adaptive=True by default) or not. In the former case, the value of rw_cov is used only at the beginning, since the adaptive version is learning this covariance matrix sequentially from the chain.

Hope this helps. I guess your question shows the documentation is not so clear about these points, I will try to improve it.

from particles.

P3ngwings avatar P3ngwings commented on May 29, 2024

Hi,
I have a question regarding the PMMH algorithm. I'm mostly interested in filtering/smoothing, so I'm not up to date on every theoretical part of the parameter estimation. I only wanted to try it out to see if I get any useful results from the get-go.
My model is a bit more complex but to boil down my problem: When picking the new 'guess' for theta in the step method of the GenericRWHM class (starting in line 231 in mcmc) any parameter is changed by a value determined via a random Gaussian sample. Here it gets problematic in my case: How does this not 'overshoot' in many small scenarios, say your theta is just one parameter and your prior distribution is a uniform distribution on [0.4, 0.45]. In almost every step this value is missed and the step gets a weight of -inf, making it obsolete.

I changed the new choice to a random sample from the prior distribution in my case (as a quick fix), but I don't know if that is the right (theoretical) way to choose the next guess for theta.

When trying out the example of the documentation (Bayesian Inference, PMMH) this also happens with the parameter 'rho' as it is uniform distributed in [-1,1] (I simply printed out the value for 'rho' and the value self.prop.lpost[0] to see if it is outside / -inf).

Regards,
David

from particles.

nchopin avatar nchopin commented on May 29, 2024

Closing this, as the initial issue has been addressed (experimental branch, module mcmc now better explains what to do).

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.