Kernels for GPs

class radvel.gp.CeleriteKernel(hparams)[source]

Class that computes and stores a matrix approximating the quasi-periodic kernel.

See radvel/example_planets/k2-131_celerite.py for an example of a setup file that uses this Kernel object.

See celerite.readthedocs.io and Foreman-Mackey et al. 2017. AJ, 154, 220 (equation 56) for more details.

An arbitrary element, \(C_{ij}\), of the matrix is:

\[C_{ij} = B/(2+C) * exp( -|t_i - t_j| / L) * (\cos(\frac{ 2\pi|t_i-t_j| }{ P_{rot} }) + (1+C) )\]
Parameters:hparams (dict of radvel.Parameter) – dictionary containing radvel.Parameter objects that are GP hyperparameters of this kernel. Must contain exactly four objects, ‘gp_B*’, ‘gp_C*’, ‘gp_L*’, and ‘gp_Prot*’, where * is a suffix identifying these hyperparameters with a likelihood object.
compute_covmatrix(errors)[source]

Compute the Cholesky decomposition of a celerite kernel

Parameters:errors (array of float) – observation errors and jitter added in quadrature
Returns:the celerite solver object, with Cholesky decomposition computed.
Return type:celerite.solver.CholeskySolver
compute_distances(x1, x2)[source]

The celerite.solver.CholeskySolver object does not require distances to be precomputed, so this method has been co-opted to define some unchanging variables.

class radvel.gp.Kernel[source]

Abstract base class to store kernel info and compute covariance matrix. All kernel objects inherit from this class.

Note

To implement your own kernel, create a class that inherits from this class. It should have hyperparameters that follow the name scheme ‘gp_NAME_SUFFIX’.

class radvel.gp.PerKernel(hparams)[source]

Class that computes and stores a periodic kernel matrix. An arbitrary element, \(C_{ij}\), of the matrix is:

\[C_{ij} = \eta_1^2 * exp( \frac{ -\sin^2(\frac{ \pi|t_i-t_j| }{ \eta_3^2 } ) }{ 2\eta_2^2 } )\]
Parameters:hparams (dict of radvel.Parameter) – dictionary containing radvel.Parameter objects that are GP hyperparameters of this kernel. Must contain exactly three objects, ‘gp_length*’, ‘gp_amp*’, and ‘gp_per*’, where * is a suffix identifying these hyperparameters with a likelihood object.
compute_covmatrix(errors)[source]

Compute the covariance matrix, and optionally add errors along the diagonal.

Parameters:errors (float or numpy array) – If covariance matrix is non-square, this arg must be set to 0. If covariance matrix is square, this can be a numpy array of observational errors and jitter added in quadrature.
class radvel.gp.QuasiPerKernel(hparams)[source]

Class that computes and stores a quasi periodic kernel matrix. An arbitrary element, \(C_{ij}\), of the matrix is:

\[C_{ij} = \eta_1^2 * exp( \frac{ -|t_i - t_j|^2 }{ \eta_2^2 } - \frac{ \sin^2(\frac{ \pi|t_i-t_j| }{ \eta_3 } ) }{ 2\eta_4^2 } )\]
Parameters:hparams (dict of radvel.Parameter) – dictionary containing radvel.Parameter objects that are GP hyperparameters of this kernel. Must contain exactly four objects, ‘gp_explength*’, ‘gp_amp*’, ‘gp_per*’, and ‘gp_perlength*’, where * is a suffix identifying these hyperparameters with a likelihood object.
compute_covmatrix(errors)[source]

Compute the covariance matrix, and optionally add errors along the diagonal.

Parameters:errors (float or numpy array) – If covariance matrix is non-square, this arg must be set to 0. If covariance matrix is square, this can be a numpy array of observational errors and jitter added in quadrature.
class radvel.gp.SqExpKernel(hparams)[source]

Class that computes and stores a squared exponential kernel matrix. An arbitrary element, \(C_{ij}\), of the matrix is:

\[C_{ij} = \eta_1^2 * exp( \frac{ -|t_i - t_j|^2 }{ \eta_2^2 } )\]
Parameters:hparams (dict of radvel.Parameter) – dictionary containing radvel.Parameter objects that are GP hyperparameters of this kernel. Must contain exactly two objects, ‘gp_length*’ and ‘gp_amp*’, where * is a suffix identifying these hyperparameters with a likelihood object.
compute_covmatrix(errors)[source]

Compute the covariance matrix, and optionally add errors along the diagonal.

Parameters:errors (float or numpy array) – If covariance matrix is non-square, this arg must be set to 0. If covariance matrix is square, this can be a numpy array of observational errors and jitter added in quadrature.