Tips/techniques for dealing with a rough/noisy posterior (lower bound on stepsize?)

Hello,

I’m trying to perform Bayesian inference on a Social Force model, which is an ODE system of pedestrians. I’m currently only performing inference on the strength parameter of the force (shared between all pedestrians), which is proving to be moderately successful.

However, I am finding that if I try to perform inference over too long a timeframe (say >5s), my chains get stuck and don’t move from their original positions. I’m using NUTS, so what I think is happening is that the chains are initialised at some value, and then quickly finding local maxima which are just noise in the true posterior. My evidence for this claim is that when I reduced the target acceptance rate, the issue was partially solved, but instead appeared again when I increased the timeframe once more.

Now, one way to solve this that came to my mind was to limit how small the stepsize could become, however I’m not sure whether there’s a way to do this as I haven’t found it in the documentation. From my plots I can see that the posterior is nicely concave with some (evidently) nontrivial noise.

If anyone could suggest some ways to address this problem or some papers that might point me in the right direction I’d highly appreciate it.

Best,
Martin

1 Like

@Funko_Unko @wds15 @yizhang

1 Like

From the paper it’s not clear to me how Eq. 10 is modeled & solved. Does the dynamical system behave differently for >5s vs smaller time frame? A prior prediction check could of help here.

There’s no way to control stepsize of ODE solvers directly in Stan.

2 Likes

I agree with @yizhang that a prediction check could help here, I’d say both prior and posterior. ODEs can be tricky for arbitrary parameters and “break” solvers in certain parameter regions. If your prior check shows no obvious problems for longer vs. shorter priors you can check if the predictions from samples in a chain that is stuck make sense, again for shorter vs longer time ranges (if for some reason the solver returns garbage the likelihoods will not make sense and neither will any trajectories along the surface).

If you can limit the parameter ranges or change the priors to avoid this region you can check if this is actually true (maybe you don’t want to limit some parameters, but you can still try it as a test for your hypothesis – no pun intended). Alternatively it may tell you whether the posterior is littered with similar regions, if that is the case then there are probably deeper issues with the inference problem.

I’m not sure how you can be sure of this, and also what you mean by nontrivial noise, maybe showing an example can help others visualize what you say you are seeing.

But you can fix the step size (and mass matrix) by turning of adaptation in the warmup, right? If it’s really helpful to limit how small this is you could try that.

1 Like