bayesplain.core.grid.sample_from_grid¶
-
bayesplain.core.grid.sample_from_grid(density, grid, size=
100000, rng=None)[source]¶ Sample from a grid-approximated posterior by inverting its CDF.
Draws uniforms and reads them back through the interpolated cumulative distribution. The draws are independent, so the only error is the discretisation of the grid, which a fine grid makes negligible.