lisa_noise.inference.sampler ============================ .. py:module:: lisa_noise.inference.sampler Classes ------- .. autoapisummary:: lisa_noise.inference.sampler.SamplerResult Functions --------- .. autoapisummary:: lisa_noise.inference.sampler.run_sampler Module Contents --------------- .. py:class:: SamplerResult Holds the result of an eryn MCMC run. .. py:attribute:: samples :type: numpy.ndarray .. py:attribute:: mle :type: numpy.ndarray .. py:attribute:: log_likelihood :type: numpy.ndarray .. py:attribute:: acceptance_fraction :type: float .. py:attribute:: n_steps :type: int .. py:function:: 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. :param log_likelihood_fn: A function that takes a parameter vector and returns the log-likelihood. :type log_likelihood_fn: Callable :param bounds: Tuple of (lower_bounds, upper_bounds) for the parameters. :type bounds: Bounds :param nwalkers: Number of walkers per temperature. :type nwalkers: int :param nsteps: Number of MCMC steps to run. :type nsteps: int :param ntemps: Number of temperatures for parallel tempering. :type ntemps: int :param burn: Number of initial steps discarded from the returned chain. :type burn: int :param thin: Keep every ``thin``-th step in the returned chain. :type thin: int :param progress: If True, show the eryn progress bar. :type progress: bool :param rng: Optional random number generator for reproducible starting points. :type rng: np.random.Generator | None :rtype: SamplerResult