Dear Stan and Bayesian modeling experts,
I have a question regarding models that require numerical integration. In cognitive neuroscience, Bayesian perception models are commonly used to understand perceptual and decision-making processes. These models posit that people have a noisy observation distribution p(x \mid s) in the brain and make inferences about the true stimulus s based on this noisy observation, resulting in a posterior p(s \mid x). Here, s is the true stimulus, and x is the internal (and noisy) observation.
And experimenters/modelers not have access to the participant’s internal observation x, making it a latent variable. To compute the model likelihood, we typically need to marginalize over x. In some cases, this can be done analytically, but in many others, numerical integration is required.
In my (humble) understanding, likelihood functions involving numerical integration are often non-smooth and potentially unstable. In the literature, when maximum likelihood estimation is used in such settings, researchers often rely on Bayesian optimization methods such as BADS, which do not require gradients and are better suited for optimizing non-smooth likelihoods.
Given that Stan performs gradient-based inference (e.g., using Hamiltonian Monte Carlo with leapfrog integration), and that its numerical integration functions also require gradients, I wonder: Is Stan suitable for Bayesian perception models that require numerical marginalization over latent variables via numerical integration?
Thank you very much for your time and insights!
Best regards,