HECATE.nested_sampling

Classes

run_nestedsampler

Class to compare between linear models with constant slope (m=0) or unconstrained slope (m!=0) regarding CCF parameters in function of orbital phases or mu.

class run_nestedsampler[source]

Bases: object

Class to compare between linear models with constant slope (m=0) or unconstrained slope (m!=0) regarding CCF parameters in function of orbital phases or mu. Includes jittering via ln f parameter, that has a predefined prior of [-7,1] in log-scale. Returns a tuple with the results.

Parameters:
  • x (numpy array) – orbital phases or mu arrays.

  • y (numpy array) – CCF parameter (central RV, line-width measure or line-center intensity).

  • yerr (numpy array) – uncertainty of CCF parameter.

  • m_span (int) – half of the range of prior on the slope.

  • b_span (int) – half of the range of prior on the intercept.

  • verbose (bool) – print output.

  • plot (bool) – whether to plot the trace and corner plots from the dynesty packages.

  • save – path to save plots.

compare_models(x, y, yerr, m_span, b_span, verbose)[source]

compares between an unconstrained and a constant model. If the unconstrained model is preferred, it compares a model with a positive slope with one with a negative slope.

run_dynesty(loglike, ptform, ndim)[source]

performs the dynamic nested sampling.

loglike_linear(theta, x, y, yerr)[source]

computes likelihood for linear model (m,b, ln f).

loglike_constant()[source]

computes likelihood for constant model (b, ln f)

ptform_linear(utheta, m_span, b_span)[source]

establishes the priors intervals.

ptform_constant(utheta, b_span)[source]

establishes the priors intervals.

ptform_positive_slope(utheta, m_span, b_span)[source]

establishes the priors intervals.

ptform_negative_slope(utheta, m_span, b_span)[source]

establishes the priors intervals.

__init__(x: numpy.array, y: numpy.array, yerr: numpy.array, m_span: int = 100, b_span: int = 100, verbose: bool = True, plot: bool = True, save=None)[source]
compare_models(x: numpy.array, y: numpy.array, yerr: numpy.array, m_span: int = 100, b_span: int = 100, verbose: bool = True)[source]

First compares between an unconstrained and a constant model. If the unconstrained model is preferred, it compares a model with a positive slope with one with a negative slope.

Parameters:
  • x (numpy array) – orbital phases or mu arrays.

  • y (numpy array) – CCF parameter (central RV, line-width measure or line-center intensity).

  • yerr (numpy array) – uncertainty of CCF parameter.

  • m_span (int) – half of the range of prior on the slope.

  • b_span (int) – half of the range of prior on the intercept.

  • verbose (bool) – print output.

Returns:

  • resA – dynesty results for initial linear model (m!=0).

  • resB – dynesty results for constant model (m=0).

  • resPos – dynesty results for linear model with positive slope (m>0).

  • resNeg – dynesty results for linear model with negative slope (m<0).

  • model (str) – type of model obtained.

  • logK_linear_vs_const (float) – evidence difference between constant and unconstrained models.

  • logK_sign (float) – evidence difference between positive and negative models.

  • logZ (float) – evidence of final model.

run_dynesty(loglike, ptform, ndim)[source]
loglike_linear(theta, x, y, yerr)[source]
loglike_constant(theta, x, y, yerr)[source]
ptform_linear(utheta, m_span, b_span)[source]
ptform_constant(utheta, b_span)[source]
ptform_positive_slope(utheta, m_span, b_span)[source]
ptform_negative_slope(utheta, m_span, b_span)[source]