hopsy.MarkovChain#

class hopsy.MarkovChain(problem, proposal=None, starting_point=None)#

Given a hopsy.Problem a MarkovChain object can be constructed. The Markov chain keeps track of the internal state and the selected proposal mechanism, see proposal argument. Several Markov chain objects can be sampled in parallel by passing them as a list to hopsy.sample.

Parameters:
  • problem (hopsy.Problem) – Problem to sample

  • proposal (Proposal type or object (duck-typing). Default None) – If None is given, the proposal algorithm is heuristically selected. If the problem has no model, the hopsy.UniformCoordinateHitAndRunProposal (https://doi.org/10.1093/bioinformatics/btx052) is selected. If the problem has a hopsy.Gaussian Model, the hopsy.TruncatedGaussianProposal (https://doi.org/10.1093/bioinformatics/btz315) is selected. Otherwise the hopsy.GaussianHitAndRunProposal (https://deepblue.lib.umich.edu/bitstream/handle/2027.42/3513/bal7884.0001.001.pdf) is set as default. Please note, that these defaults are heuristic and work best for no model or hopsy.Gaussian. For the other case, it is worth experimenting with the available proposals to find the most efficient one for the problem at hand. Note, that Uniform/Gaussian in a proposal name only indicates a detail of the proposal mechanism. These proposals can still be used to sample non-uniform and non-gaussian distributions.

Return type:

MarkovChain