Closed nchopin closed 1 year ago
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
Hi, to fix your problem (proposed values often fall outside the support of the prior distribution), you may :
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.
Closing this, as the initial issue has been addressed (experimental branch, module mcmc now better explains what to do).
By default, PMMH runs the bootstrap filter associated to the considered state-space model. It is possible to use a different algorithm, by setting argument
fk_cls
to anotherFeynman-Kac
class; however, this works only for FK classes that have the same structure asstate_space_models.Bootstrap
orstate_space_models.GuidedPF
(taking as argumentsdata
andssm
, for the state-space model). What if the user wants to specify a FK class with a different structure?