get_scene_samples#
- scarlet2.infer.get_scene_samples(scene, uncertainties, samples=100, key=None)[source]#
Draw posterior sample scenes from a Laplace approximation.
Treats every parameter named in
uncertaintiesas normally distributed, with mean taken from scene and standard deviation fromuncertainties(e.g. as returned byuncertainty()), and draws independent joint samples. Each sample is inserted back into scene to produce one self-consistent variant of the model.Parameters that are not included in scene (e.g. observational parameters) will be ignored.
- Parameters:
scene (
Scene) – The (fitted) model of the scene whose parameter means are sampled around.uncertainties (
dict) – Maps parameter name to its standard deviation, of the same shape as the parameter (e.g. the output ofuncertainty()).samples (
int, optional) – Number of scene samples to draw.key (
jax.random.PRNGKey, optional) – A random key for sampling. If None, a new key will be generated.
- Returns:
samplesscene variants, each with one joint draw of the parameters inuncertaintiessubstituted in.- Return type:
listofScene