sample#
- scarlet2.sample(scene, observations, *args, seed=0, num_warmup=100, num_samples=200, progress_bar=True, **kwargs)[source]#
Sample parameters of every source in scene to get posteriors given observations.
This method runs the HMC NUTS sampler from numpyro to get parameter posteriors. It uses the likelihood of observations as well as the prior attribute set for every
Parameterin parameters.- Parameters:
scene (
Scene) – The model of the scene.observations (
Observationorlist) – The observations to fit the models to.*args (
list, optional) – Additional arguments passed. Only used for backwards (v0.3) compatibility.seed (
int, optional) – RNG seed for the samplernum_warmup (
int, optional) – Number of samples during HMC warm-upnum_samples (
int, optional) – Number of samples to create from tuned HMCprogress_bar (
bool, optional) – Whether to show a progress bar**kwargs (
dict, optional) – Additional keyword arguments passed to the numpyro.infer.NUTS sampler.
Notes
Requires numpyro
- Return type: