nessai.proposal.analytic

Proposal method for initial sampling when priors can be sampled analytically.

Module Contents

Classes

AnalyticProposal

Class for drawing samples from analytic priors.

class nessai.proposal.analytic.AnalyticProposal(*args, poolsize=1000, **kwargs)

Bases: nessai.proposal.base.Proposal

Class for drawing samples from analytic priors.

Will be used when nessai is called with analytic_priors=True and assumes the nessai.model.Model.new_point() samples directly from the prior. This method must be implemented by the user.

Parameters:
args

Arguments passed to the parent class.

poolsizeint, optional

Number of points drawn at once.

kwargs

Keyword arguments passed to the parent class.

property poolsize

Poolsize used for drawing new samples in batches.

populate(N=None)

Populate the pool by drawing from the priors.

Will also evaluate the likelihoods if the proposal contains a multiprocessing pool.

Parameters:
Nint, optional

Number of samples to draw. If not specified poolsize will be used.

draw(old_sample, **kwargs)

Propose a new sample. Draws from the pool if it is populated, else it populates the pool.

Parameters:
old_samplestructured_array

Old sample, this is not used in the proposal method

kwargs

Keyword arguments passed to populate()