Likelihood Functions
- class radvel.likelihood.CeleriteLikelihood(model, t, vel, errvel, hnames, suffix='', **kwargs)[source]
Celerite GP Likelihood The Likelihood object for a radial velocity dataset modeled with a GP whose kernel is an approximation to the quasi-periodic kernel. See celerite.readthedocs.io and Foreman-Mackey et al. 2017. AJ, 154, 220 (equation 56) for more details. See radvel/example_planets/k2-131_celerite.py for an example of a setup file that uses this Likelihood object. :param model: RVModel object :type model: radvel.model.RVModel :param t: time array :type t: array :param vel: array of velocities :type vel: array :param errvel: array of velocity uncertainties :type errvel: array :param hnames: keys corresponding to radvel.Parameter
objects in model.params that are GP hyperparameters
- Parameters
suffix (string) – suffix to identify this Likelihood object; useful when constructing a CompositeLikelihood object
- logprob()[source]
Return GP log-likelihood given the data and model. log-likelihood is computed using Cholesky decomposition as: .. math:
lnL = -0.5r^TK^{-1}r - 0.5ln[det(K)] - 0.5N*ln(2pi)
where r = vector of residuals (GPLikelihood._resids), K = covariance matrix, and N = number of datapoints. Priors are not applied here. Constant has been omitted. :returns: Natural log of likelihood :rtype: float
- predict(xpred)[source]
Realize the GP using the current values of the hyperparameters at values x=xpred. Used for making GP plots. Wrapper for celerite.GP.predict(). :param xpred: numpy array of x values for realizing the GP :type xpred: np.array
- Returns
- tuple containing:
np.array: numpy array of predictive means
np.array: numpy array of predictive standard deviations
- Return type
tuple
- class radvel.likelihood.CompositeLikelihood(like_list)[source]
Composite Likelihood A thin wrapper to combine multiple Likelihood objects. One Likelihood applies to a dataset from a particular instrument. :param like_list: list of radvel.likelihood.RVLikelihood objects :type like_list: list
- class radvel.likelihood.GPLikelihood(model, t, vel, errvel, hnames=['gp_per', 'gp_perlength', 'gp_explength', 'gp_amp'], suffix='', kernel_name='QuasiPer', **kwargs)[source]
GP Likelihood The Likelihood object for a radial velocity dataset modeled with a GP :param model: GP model object :type model: radvel.model.GPModel :param t: time array :type t: array :param vel: array of velocities :type vel: array :param errvel: array of velocity uncertainties :type errvel: array :param hnames: keys corresponding to radvel.Parameter
objects in model.params that are GP hyperparameters
- Parameters
suffix (string) – suffix to identify this Likelihood object; useful when constructing a CompositeLikelihood object
- logprob()[source]
Return GP log-likelihood given the data and model. log-likelihood is computed using Cholesky decomposition as: .. math:
lnL = -0.5r^TK^{-1}r - 0.5ln[det(K)] - 0.5N*ln(2pi)
where r = vector of residuals (GPLikelihood._resids), K = covariance matrix, and N = number of datapoints. Priors are not applied here. Constant has been omitted. :returns: Natural log of likelihood :rtype: float
- predict(xpred)[source]
Realize the GP using the current values of the hyperparameters at values x=xpred. Used for making GP plots. :param xpred: numpy array of x values for realizing the GP :type xpred: np.array
- Returns
- tuple containing:
np.array: the numpy array of predictive means
np.array: the numpy array of predictive standard deviations
- Return type
tuple
- class radvel.likelihood.Likelihood(model, x, y, yerr, extra_params=[], decorr_params=[], decorr_vectors=[])[source]
Generic Likelihood
- class radvel.likelihood.RVLikelihood(model, t, vel, errvel, suffix='', decorr_vars=[], decorr_vectors=[], **kwargs)[source]
RV Likelihood The Likelihood object for a radial velocity dataset :param model: RV model object :type model: radvel.model.RVModel :param t: time array :type t: array :param vel: array of velocities :type vel: array :param errvel: array of velocity uncertainties :type errvel: array :param suffix: suffix to identify this Likelihood object
useful when constructing a CompositeLikelihood object.
- errorbars()[source]
Return uncertainties with jitter added in quadrature. :returns: uncertainties :rtype: array
- radvel.likelihood.loglike_jitter(residuals, sigma, sigma_jit)[source]
Log-likelihood incorporating jitter See equation (1) in Howard et al. 2014. Returns loglikelihood, where sigma**2 is replaced by sigma**2 + sigma_jit**2. It penalizes excessively large values of jitter :param residuals: array of residuals :type residuals: array :param sigma: array of measurement errors :type sigma: array :param sigma_jit: jitter :type sigma_jit: float
- Returns
log-likelihood
- Return type
float