Sampling full posterior in cpp

50 views
Skip to first unread message

James Ferguson

unread,
Aug 2, 2025, 2:42:47 PMAug 2
to gtsam...@googlegroups.com
I have seen the python examples shown for sampling from the Laplace approximation at the MAP estimate, and I would like to do that in cpp. I have tried using the pipeline where I linearize the factor graph at the map estimate, eliminate the graph to a bayes tree, and then sample, essentially the same thing the python example does.

When I do this in cpp, I end up getting super noisy samples that do not match my marginal samples at all. I will say that my problem is not very well conditioned, and there are a few hundred variables, which might be the main issue, since the python examples only have a few variables with good conditioning. Does anyone have a working pipeline to sample from high dimensional, possibly ill conditioned laplace approximations? I have been getting the joint marginal full covariance, and it works decently, but it also feels very wrong.

James
Reply all
Reply to author
Forward
0 new messages