LALInference 4.1.9.1-eeff03c
lalinference.nest2pos Namespace Reference

Functions

def logsubexp (x, y)
 
def log_integrate_log_trap (log_func, log_support)
 Trapezoidal integration of given log(func) Returns log of the integral. More...
 
def compute_weights (data, Nlive)
 Returns log_ev, log_wts for the log-likelihood samples in data, assumed to be a result of nested sampling with Nlive live points. More...
 
def draw_posterior (data, log_wts, verbose=False)
 Draw points from the given data (of shape (Nsamples, Ndim)) with associated log(weight) (of shape (Nsamples,)). More...
 
def draw_posterior_many (datas, Nlives, verbose=False)
 Draw samples from the posteriors represented by the (Nruns, Nsamples, Nparams)-shaped array datas, each sampled with the corresponding Nlive number of live points. More...
 
def draw_N_posterior (data, log_wts, N, verbose=False)
 Draw N samples from the input data, weighted by log_wt. More...
 
def draw_N_posterior_many (datas, Nlives, Npost, verbose=False)
 Draw Npost samples from the posteriors represented by the (Nruns, Nsamples, Nparams)-shaped array datas, each sampled with the corresponding number of live points Nlive. More...
 
def draw_posterior_many_ROQ_runs (datas, Nlives, verbose=False)
 Draw samples from the posteriors represented by the (Nruns, Nsamples, Nparams)-shaped array datas from ROQ runs, each sampled with the corresponding Nlive number of live points. More...
 

Function Documentation

◆ logsubexp()

def lalinference.nest2pos.logsubexp (   x,
  y 
)

Definition at line 6 of file nest2pos.py.

◆ log_integrate_log_trap()

def lalinference.nest2pos.log_integrate_log_trap (   log_func,
  log_support 
)

Trapezoidal integration of given log(func) Returns log of the integral.

Definition at line 15 of file nest2pos.py.

◆ compute_weights()

def lalinference.nest2pos.compute_weights (   data,
  Nlive 
)

Returns log_ev, log_wts for the log-likelihood samples in data, assumed to be a result of nested sampling with Nlive live points.

Definition at line 25 of file nest2pos.py.

◆ draw_posterior()

def lalinference.nest2pos.draw_posterior (   data,
  log_wts,
  verbose = False 
)

Draw points from the given data (of shape (Nsamples, Ndim)) with associated log(weight) (of shape (Nsamples,)).

Draws uniquely so there are no repeated samples

Definition at line 55 of file nest2pos.py.

◆ draw_posterior_many()

def lalinference.nest2pos.draw_posterior_many (   datas,
  Nlives,
  verbose = False 
)

Draw samples from the posteriors represented by the (Nruns, Nsamples, Nparams)-shaped array datas, each sampled with the corresponding Nlive number of live points.

Will draw without repetition, and weight according to the evidence in each input run

Definition at line 66 of file nest2pos.py.

◆ draw_N_posterior()

def lalinference.nest2pos.draw_N_posterior (   data,
  log_wts,
  N,
  verbose = False 
)

Draw N samples from the input data, weighted by log_wt.

For large N there may be repeated samples

Definition at line 97 of file nest2pos.py.

◆ draw_N_posterior_many()

def lalinference.nest2pos.draw_N_posterior_many (   datas,
  Nlives,
  Npost,
  verbose = False 
)

Draw Npost samples from the posteriors represented by the (Nruns, Nsamples, Nparams)-shaped array datas, each sampled with the corresponding number of live points Nlive.

The returned number of samples may not be exactly Npost due to rounding

Definition at line 115 of file nest2pos.py.

◆ draw_posterior_many_ROQ_runs()

def lalinference.nest2pos.draw_posterior_many_ROQ_runs (   datas,
  Nlives,
  verbose = False 
)

Draw samples from the posteriors represented by the (Nruns, Nsamples, Nparams)-shaped array datas from ROQ runs, each sampled with the corresponding Nlive number of live points.

First rescales evidence in each mass prior bin then will draw without repetition, and weight according to the evidence in each input run ala draw_posterior_many

Definition at line 130 of file nest2pos.py.