aneeshnaik / lintsampler

Efficient random sampling via linear interpolation.
https://lintsampler.readthedocs.io
MIT License
8 stars 3 forks source link

Hi, if I have a bounch of posteror samples, can we use `lintsampler` to draw more samples? #15

Open WuShichao opened 2 days ago

WuShichao commented 2 days ago

Sometimes, KDE tends to oversmooth the PDF, which introduces bias in the estimated PDF. Inverse-transform sampling doesn't have this issue, but it is usually implemented in 1D. This package extends it to at least 6D. I know this package requires grid/tree-like data, but I can provide the marginalized 1D posterior distribution for each parameter. Besides, will lintsampler keep the covariance?

aneeshnaik commented 1 day ago

Hi @WuShichao, I'm afraid I don't think lintsampler doesn't quite do what you're looking for here. The key input for lintsampler is the PDF (i.e., position input, density output), not PDF samples.

You're finding that KDE oversmooths: I assume you've tried a smaller bandwidth? In that case, I suppose you're working on a distribution with a large dynamic range. What can work quite well here is a variable-bandwidth KDE, or something like the Delaunay tessellation field estimator.

WuShichao commented 21 hours ago

@aneeshnaik Thanks a lot! I will learn that Delaunay tessellation field estimator.