sample
- sample(log_likelihood_fn, model, frequency, solver=PolyChord(nlives={}), *, nlive_factor=25, key=None, **kwargs)[source]
Samples a given likelihood function for a model over a frequency range.
The likelihood function can have its own hyper-parameters, and is returned in
result.likelihood.- Parameters:
log_likelihood_fn (Callable[[Model, Frequency], jnp.ndarray] | list[Callable],) – The log likelihood function to sample. Must be a callable or PyTree with signature (model, freq) -> jnp.ndarray. If a list of costs is provided, they are automatically summed.
model (Model) – The RF model containing the parameters to be sample.
frequency (Frequency) – The frequency sweep over which the cost should be evaluated.
solver (infx.AbstractNestedSampler, default=infx.PolyChord()) – The backend to use. Defaults to
infx.PolyChord().transform (distreqx.bijectors.AbstractBijector, default=None) – An invertible transformation to apply to all model parameters before sampling.
nlive_factor (int, default=25) – The number of live points to use as a factor of the number of parameters. Only used for nested sampling.
key (jnp.ndarray) – The random JAX key.
**kwargs (dict) – Additional options passed to the underlying solver backend.
- Returns:
A structured result containing the sampled model and solver statistics.
- Return type: