Log posterior functions

Log posterior functions for transit modelling and parameter estimation.

A log posterior function (LPF) class creates a basis for Bayesian parameter estimation from transit light curves. In PyTransit, LPFs are a bit more than what the name implies. An LPF stores the observations, model priors, etc. It also contains methods for posterior optimisation and MCMC sampling.

class pytransit.lpf.BaseLPF(name: str, passbands: Union[Sequence[str], str], times: Optional[Sequence[numpy.ndarray]] = None, fluxes: Optional[Sequence[numpy.ndarray]] = None, errors: Optional[Sequence[numpy.ndarray]] = None, pbids: Optional[Sequence[int]] = None, covariates: Optional[Sequence[numpy.ndarray]] = None, wnids: Optional[Sequence[int]] = None, tm: Optional[pytransit.models.transitmodel.TransitModel] = None, nsamples: Union[Sequence[int], int] = 1, exptimes: Union[Sequence[float], float] = 0.0, init_data: bool = True, result_dir: Optional[pathlib.Path] = None, tref: float = 0.0, lnlikelihood: str = 'wn')[source]
add_as_prior(mean: float, std: float) → None[source]

Add a normal prior on the scaled semi-major axis (a / R_\star).

  • mean (float) – Mean of the normal distribution.
  • std (float) – Standard deviation of the normal distribution
add_ldtk_prior(teff: tuple, logg: tuple, z: tuple, passbands: tuple, uncertainty_multiplier: float = 3, **kwargs) → None[source]

Add a LDTk-based prior on the limb darkening.

  • teff
  • logg
  • z
  • passbands
  • uncertainty_multiplier
add_t14_prior(mean: float, std: float) → None[source]

Add a normal prior on the transit duration.

  • mean (float) – Mean of the normal distribution
  • std (float) – Standard deviation of the normal distribution.

Log likelihood for a 1D or 2D array of model parameters.

Parameters:pvp (ndarray) – Either a 1D parameter vector or a 2D parameter array.
Return type:Log likelihood for the given parameter vector(s)
plot_light_curves(method='de', ncol: int = 3, width: Optional[float] = None, planet: int = 1, max_samples: int = 1000, figsize=None, data_alpha=0.5, ylim=None)[source]
posterior_samples(burn: int = 0, thin: int = 1, derived_parameters: bool = True, arviz: bool = False)[source]
set_radius_ratio_prior(kmin, kmax)[source]

Set a uniform prior on all radius ratios.

transit_model(pv, copy=True)[source]

Additive trends