Use these functions to run sampling/integration processes.

xpsi.Sample.nested(likelihood, prior, check_kwargs={}, **kwargs)[source]

Initialise MultiNest and integrate.

  • likelihood (dict) – Keyword arguments required for instantiation of Likelihood.
  • prior (dict) – Keyword arguments required for instantiation of Prior.
  • check_kwargs (dict) – Keywords for likelihood function checker. Passed to checker before commencement of sampling.
  • kwargs – Keyword arguments for PyMultiNest.
xpsi.Sample.ensemble(likelihood, prior, MPI=True, **kwargs)[source]

Initialise emcee and sample.

  • likelihood – An instance of Likelihood.
  • prior – An instance of Prior.
  • MPI (bool) – Parallelise with MPI? If calling script not lauched with an MPI directive, sampling will not commence because there is only one process. Default is True since only in testing is it justifiable to use a single process.
  • kwargs

    Passed to initialisers of appropriate classes:

    • boolean to resume, under keyword resume;
    • number of steps, under keyword nsteps;
    • number of walkers, under keyword nwalkers;
    • moments of initial walker multivariate Gaussian distribution, under keyword walker_dist_moments (can be None);
    • root directory for output, under keyword root_dir.

The above objects are used to instantiate Posterior.

Returns:An instance of emcee.backends.HDFBackend.