Sample¶
Use these functions to run sampling/integration processes.
-
xpsi.Sample.
nested
(likelihood, prior, check_kwargs={}, **kwargs)[source]¶ Initialise MultiNest and integrate.
Parameters: - 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.
- likelihood (dict) – Keyword arguments required for instantiation of
-
xpsi.Sample.
ensemble
(likelihood, prior, MPI=True, **kwargs)[source]¶ Initialise emcee and sample.
Parameters: - 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 beNone
); - root directory for output, under keyword
root_dir
.
- boolean to resume, under keyword
The above objects are used to instantiate
Posterior
.Returns: An instance of emcee.backends.HDFBackend
.- likelihood – An instance of