x3cflux.run_non_uniform_sampling

class x3cflux.run_non_uniform_sampling(simulator, num_samples: int, starting_point: ~numpy.ndarray | None = None, bounds: ~typing.Dict[str, ~typing.Tuple[float, float]] | None = None, num_chains: int | None = 1, proposal: ~hopsy.core.PyProposal | None = <class 'hopsy.core.GaussianCoordinateHitAndRunProposal'>, random_seed: int | None = 42, **kwargs)

Bases:

Estimate the posterior distribution induced by the labeling data.

Markov chain Monte Carlo (MCMC), as implemented in the polytope sampling toolbox hopsy, is used and can be configured by passing appropriate keyword arguments. See Paul, R. et al. (2024), https://doi.org/10.1093/bioinformatics/btae430.

Parameters:
  • simulator (Simulator) – Labeling simulator.

  • num_samples (int) – Number of samples to generate.

  • starting_point (numpy.ndarray, optional) – Point from which to start sampling.

  • bounds (dict[str, tuple[float, float]], optional) – Parameter boundary constraints.

  • num_chains (int, default=1) – Number of Markov chains to run.

  • proposal (hopsy.PyProposal, default=hopsy.GaussianCoordinateHitAndRunProposal) – Proposal to use for Metropolis-Hastings sampling.

  • random_seed (int, default=42) – Random seed used to initialize the Markov chain.

  • **kwargs – hopsy options. See https://modsim.github.io/hopsy/generated/hopsy.sample.html.

Returns:

Generated samples as a (C, N, M) tensor, where C, N, and M are the numbers of chains, parameters, and samples, respectively.

Return type:

numpy.ndarray