lisa_noise.inference.sampler

Classes

SamplerResult

Holds the result of an eryn MCMC run.

Functions

run_sampler(log_likelihood_fn, bounds, *[, nwalkers, ...]) → SamplerResult

Sample the posterior with eryn's parallel-tempered EnsembleSampler.

Module Contents

class lisa_noise.inference.sampler.SamplerResult

Holds the result of an eryn MCMC run.

samples: numpy.ndarray
mle: numpy.ndarray
log_likelihood: numpy.ndarray
acceptance_fraction: float
n_steps: int
lisa_noise.inference.sampler.run_sampler(log_likelihood_fn: Callable, bounds: lisa_noise.types.Bounds, *, nwalkers: int = 40, nsteps: int = 6000, ntemps: int = 3, burn: int = 0, thin: int = 1, progress: bool = True, rng: numpy.random.Generator | None = None) → SamplerResult

Sample the posterior with eryn’s parallel-tempered EnsembleSampler.

Uniform priors are built directly from bounds (one per dimension), so this needs only the box constraints the rest of the pipeline already builds.

Parameters:
  • log_likelihood_fn (Callable) – A function that takes a parameter vector and returns the log-likelihood.

  • bounds (Bounds) – Tuple of (lower_bounds, upper_bounds) for the parameters.

  • nwalkers (int) – Number of walkers per temperature.

  • nsteps (int) – Number of MCMC steps to run.

  • ntemps (int) – Number of temperatures for parallel tempering.

  • burn (int) – Number of initial steps discarded from the returned chain.

  • thin (int) – Keep every thin-th step in the returned chain.

  • progress (bool) – If True, show the eryn progress bar.

  • rng (np.random.Generator | None) – Optional random number generator for reproducible starting points.

Return type:

SamplerResult