armstrtw / CppBugs

c++ version of BUGS
29 stars 5 forks source link

positive_jump and bounded_jump are incorrect #14

Closed jhjourdan closed 10 years ago

jhjourdan commented 10 years ago

positive_jump and bounded_jump are incorrect: they break the symmetry of the jumps. That is, the probability for jumping from a state q to a state q' is no longer equal to the symmetry for going from state q' to state q (conditioned to the fact that the jump is not rejected). Without this hypothesis, you have to take into accound this assymetry in the metropolis hasting algorithm.

So, either remove these functions, or correct them.

armstrtw commented 10 years ago

yeah, that's meant to prevent bad jumps when the initial stdev of the node is too high. As the chain progresses towards convergence it should no longer be hitting any boundaries.

However, your point is well taken. You may have noticed this version of cppbugs made the likelihood functions template parameters, and the next version will also make the jump functions template parameters, so at that point you can drop in whatever you want to use for jumping functions.

-Whit

jhjourdan commented 10 years ago

Problem is, for some distributions (exponential, high stddev beta, high stddev gamma), an important part of the density is located close to the bounds, so jumps will actually hit them.

I did the experiment of using such jump functions for measuring the mean of an exponential of parameter 1, and I found a 10% error.... Not negligible.

At least you should use such jumps only for fitting the mcmc parameters. Not for the actual simulation.

JH

armstrtw commented 10 years ago

Thanks for testing this. I like the idea of leaving them in for the adaptive phase, but that would make the code way too complicated. These jumpers were actually removed from the class definitions per the migration to alias templates. I'm fully removing the function definitions the code now.