Skip to content

API documentation for kima

Data

Most analyses will start by using the RVData class to load data from a set of files or arrays

Example:

from kima import RVData

data = RVData('filename.txt', skip=1)
kima.RVData API

Load and store RV data

init(self, filenames: collections.abc.Sequence[str], units: str = 'ms', skip: int = 0, max_rows: int = 0, delimiter: str = ' ', indicators: collections.abc.Sequence[str] = [], double_lined: bool = False) -> None init(self, filename: str, units: str = 'ms', skip: int = 0, max_rows: int = 0, multi: bool = False, delimiter: str = ' ', indicators: collections.abc.Sequence[str] = [], double_lined: bool = False) -> None init(self, t: collections.abc.Sequence[float], y: collections.abc.Sequence[float], sig: collections.abc.Sequence[float], units: str = 'ms', instrument: str = '') -> None init(self, t: collections.abc.Sequence[collections.abc.Sequence[float]], y: collections.abc.Sequence[collections.abc.Sequence[float]], sig: collections.abc.Sequence[collections.abc.Sequence[float]], units: str = 'ms', instruments: collections.abc.Sequence[str] = []) -> None

Overloaded function.

  1. __init__(self, filenames: collections.abc.Sequence[str], units: str = 'ms', skip: int = 0, max_rows: int = 0, delimiter: str = ' ', indicators: collections.abc.Sequence[str] = [], double_lined: bool = False) -> None

Load RV data from a list of files

  1. __init__(self, filename: str, units: str = 'ms', skip: int = 0, max_rows: int = 0, multi: bool = False, delimiter: str = ' ', indicators: collections.abc.Sequence[str] = [], double_lined: bool = False) -> None

Load RV data from a file

  1. __init__(self, t: collections.abc.Sequence[float], y: collections.abc.Sequence[float], sig: collections.abc.Sequence[float], units: str = 'ms', instrument: str = '') -> None

Load RV data from arrays

  1. __init__(self, t: collections.abc.Sequence[collections.abc.Sequence[float]], y: collections.abc.Sequence[collections.abc.Sequence[float]], sig: collections.abc.Sequence[collections.abc.Sequence[float]], units: str = 'ms', instruments: collections.abc.Sequence[str] = []) -> None

Load RV data from arrays, for multiple instruments

M0_epoch property

reference epoch for the mean anomaly

N property

Total number of observations

actind property

Activity indicators

datafile property

The file name

datafiles property

The list of file names

double_lined property

if the data is for a double-lined binary

indicator_names property

names of activity indicators

instrument property

instrument name

instruments property

instrument names

multi property

Data comes from multiple instruments

normalized_actind property

Activity indicators normalized to [0,1]

obsi property

The instrument identifier

sig property

The observed RV uncertainties

skip property

Lines skipped when reading data

t property

The times of observations

units property

Units of the RVs and uncertainties

y property

The observed radial velocities

get_RV_max() method descriptor

get_RV_max(self) -> float

Get the maximum RV

get_RV_mean() method descriptor

get_RV_mean(self) -> float

Get the mean RV

get_RV_min() method descriptor

get_RV_min(self) -> float

Get the minimum RV

get_RV_span() method descriptor

get_RV_span(self) -> float

Get the RV span

get_RV_std() method descriptor

get_RV_std(self) -> float

Get the standard deviation of RVs

get_RV_var() method descriptor

get_RV_var(self) -> float

Get the variance of RVs

get_max_RV_span() method descriptor

get_max_RV_span(self) -> float

Get the maximum RV span of individual instruments

get_t_max() method descriptor

get_t_max(self) -> float

Get the maximum time

get_t_middle() method descriptor

get_t_middle(self) -> float

Get the middle time

get_t_min() method descriptor

get_t_min(self) -> float

Get the minimum time

get_timespan() method descriptor

get_timespan(self) -> float

Get the timespan

get_trend_magnitude() method descriptor

get_trend_magnitude(self, arg: int, /) -> int

Order of magnitude of trend coefficient (of degree) given the data

load() method descriptor

load(self, filename: str, units: str, skip: int, max_rows: int, delimiter: str, indicators: collections.abc.Sequence[str]) -> None

Load RV data from a tab/space separated file with columns

time  vrad  error  quant  error
...   ...   ...    ...    ...
Args: filename (str): the name of the file untis (str): units of the RVs and errors, either "kms" or "ms" skip (int): number of lines to skip in the beginning of the file (default = 2) indicators (list[str]): nodoc

plot(data, **kwargs)

Simple plot of RV data

topslope() method descriptor

topslope(self) -> float

Get the maximum slope allowed by the data

Models

We can then create one of the several models currently implemented

Example:

from kima import RVmodel

model = RVmodel(fix=False, npmax=2, data=data)
kima.RVmodel API

RVmodel()

init(self, fix: bool, npmax: int, data: kima.Data.RVData) -> None

Implements a sum-of-Keplerians model where the number of Keplerians can be free.

Parameters:

Name Type Description Default
fix bool

whether the number of Keplerians should be fixed

required
npmax int

maximum number of Keplerians

required
data RVData

the RV data

required

Cprior property

Prior for the systemic velocity

Jprior property

Prior for the extra white noise (jitter)

KO_Kprior property

Prior for KO semi-amplitude

KO_Pprior property

Prior for KO orbital period

KO_eprior property

Prior for KO eccentricity

KO_phiprior property

Prior for KO mean anomaly(ies)

KO_wprior property

Prior for KO argument of periastron

TR_Kprior property

Prior for TR semi-amplitude

TR_Pprior property

Prior for TR orbital period

TR_Tcprior property

Prior for TR mean anomaly(ies)

TR_eprior property

Prior for TR eccentricity

TR_wprior property

Prior for TR argument of periastron

beta_prior property

(Common) prior for the activity indicator coefficients

conditional property

(self) -> kima.RVmodel.RVConditionalPrior

cubic_prior property

Prior for the cubic coefficient of the trend

data property

the data

degree property

degree of the polynomial trend

directory property

directory where the model ran

enforce_stability property

whether to enforce AMD-stability

fix property

whether the number of Keplerians is fixed

indicator_correlations property

include in the model linear correlations with indicators

individual_offset_prior property

Common prior for the between-instrument offsets

jitter_propto_indicator property

docs

jitter_propto_indicator_index property

docs

known_object property

whether the model includes (better) known extra Keplerian curve(s)

n_known_object property

how many known objects

n_transiting_planet property

how many transiting planets

npmax property

maximum number of Keplerians

nu_prior property

Prior for the degrees of freedom of the Student-t likelihood

offsets_prior property

Common prior for the between-instrument offsets

quadr_prior property

Prior for the quadratic coefficient of the trend

slope_prior property

Prior for the slope

star_mass property

stellar mass [Msun]

stellar_jitter_prior property

Prior for the stellar jitter (common to all instruments)

studentt property

use a Student-t distribution for the likelihood (instead of Gaussian)

transiting_planet property

whether the model includes transiting planet(s)

trend property

whether the model includes a polynomial trend

set_known_object() method descriptor

set_known_object(self, arg: int, /) -> None

set_loguniform_prior_Np() method descriptor

set_loguniform_prior_Np(self) -> None

set_transiting_planet() method descriptor

set_transiting_planet(self, arg: int, /) -> None

kima.GPmodel API

GPmodel()

init(self, fix: bool, npmax: int, data: kima.Data.RVData) -> None

Cprior property

Prior for the systemic velocity

Jprior property

Prior for the extra white noise (jitter)

KO_Kprior property

Prior for KO semi-amplitude

KO_Pprior property

Prior for KO orbital period

KO_eprior property

Prior for KO eccentricity

KO_phiprior property

Prior for KO mean anomaly(ies)

KO_wprior property

Prior for KO argument of periastron

Q_prior property

Prior for Q, the quality factor in SHO kernels

TR_Kprior property

Prior for TR semi-amplitude

TR_Pprior property

Prior for TR orbital period

TR_Tcprior property

Prior for TR mean anomaly(ies)

TR_eprior property

Prior for TR eccentricity

TR_wprior property

Prior for TR argument of periastron

beta_prior property

(Common) prior for the activity indicator coefficients

conditional property

(self) -> kima.RVmodel.RVConditionalPrior

cubic_prior property

Prior for the cubic coefficient of the trend

data property

the data

degree property

degree of the polynomial trend

directory property

directory where the model ran

enforce_stability property

whether to enforce AMD-stability

eta1_prior property

Prior for η1, the GP 'amplitude'

eta2_prior property

Prior for η2, the GP correlation timescale

eta3_prior property

Prior for η3, the GP period

eta4_prior property

Prior for η4, the recurrence timescale or (inverse) harmonic complexity

eta5_prior property

Prior for η5

eta6_prior property

Prior for η6

eta7_prior property

Prior for η7

fix property

whether the number of Keplerians is fixed

indicator_correlations property

include in the model linear correlations with indicators

individual_offset_prior property

Common prior for the between-instrument offsets

kernel property

GP kernel to use

known_object property

whether the model includes (better) known extra Keplerian curve(s)

magnetic_cycle_kernel property

whether to consider a (periodic) GP kernel for a magnetic cycle

n_known_object property

how many known objects

n_transiting_planet property

how many transiting planets

npmax property

maximum number of Keplerians

offsets_prior property

Common prior for the between-instrument offsets

quadr_prior property

Prior for the quadratic coefficient of the trend

slope_prior property

Prior for the slope

star_mass property

stellar mass [Msun]

transiting_planet property

whether the model includes transiting planet(s)

trend property

whether the model includes a polynomial trend

eta2_larger_eta3() method descriptor

eta2_larger_eta3(self, factor: float = 1.0) -> None

Constrain η2 to be larger than factor * η3

set_known_object() method descriptor

set_known_object(self, arg: int, /) -> None

set_transiting_planet() method descriptor

set_transiting_planet(self, arg: int, /) -> None

kima.RVFWHMmodel API

RVFWHMmodel()

init(self, fix: bool, npmax: int, data: kima.Data.RVData) -> None

Cprior property

Prior for the systemic velocity

Jprior property

Prior for the extra white noise (jitter)

KO_Kprior property

Prior for KO semi-amplitude

KO_Pprior property

Prior for KO orbital period

KO_eprior property

Prior for KO eccentricity

KO_phiprior property

Prior for KO mean anomaly(ies)

KO_wprior property

Prior for KO argument of periastron

TR_Kprior property

Prior for TR semi-amplitude

TR_Pprior property

Prior for TR orbital period

TR_Tcprior property

Prior for TR mean anomaly(ies)

TR_eprior property

Prior for TR eccentricity

TR_wprior property

Prior for TR argument of periastron

conditional property

(self) -> kima.RVmodel.RVConditionalPrior

cubic_prior property

Prior for the cubic coefficient of the trend

data property

the data

degree property

degree of the polynomial trend

directory property

directory where the model ran

enforce_stability property

whether to enforce AMD-stability

eta1_fwhm_prior property

Prior for the GP 'amplitude' on the FWHM

eta1_prior property

Prior for the GP 'amplitude' on the RVs

eta2_fwhm_prior property

Prior for η2, the GP correlation timescale, on the FWHM

eta2_prior property

Prior for η2, the GP correlation timescale, on the RVs

eta3_fwhm_prior property

Prior for η3, the GP period, on the FWHM

eta3_prior property

Prior for η3, the GP period, on the RVs

eta4_fwhm_prior property

Prior for η4, the recurrence timescale or (inverse) harmonic complexity, on the FWHM

eta4_prior property

Prior for η4, the recurrence timescale or (inverse) harmonic complexity, on the RVs

fix property

whether the number of Keplerians is fixed

known_object property

whether the model includes (better) known extra Keplerian curve(s)

n_known_object property

how many known objects

n_transiting_planet property

how many transiting planets

npmax property

maximum number of Keplerians

quadr_prior property

Prior for the quadratic coefficient of the trend

share_eta2 property

whether the η2 parameter is shared between RVs and FWHM

share_eta3 property

whether the η3 parameter is shared between RVs and FWHM

share_eta4 property

whether the η4 parameter is shared between RVs and FWHM

slope_prior property

Prior for the slope

star_mass property

stellar mass [Msun]

transiting_planet property

whether the model includes transiting planet(s)

trend property

whether the model includes a polynomial trend

set_known_object() method descriptor

set_known_object(self, arg: int, /) -> None

set_transiting_planet() method descriptor

set_transiting_planet(self, arg: int, /) -> None

kima.BINARIESmodel API

BINARIESmodel()

init(self, fix: bool, npmax: int, data: kima.Data.RVData) -> None

Implements a sum-of-Keplerians model where the number of Keplerians can be free. This model assumes white, uncorrelated noise. This modules is tailored for the analysis of stellar binaries through the known object mode (without it this defaults to the RVmodel) The binary can have one set of RVs or two (one on each star). This model adds apsidal precession as a free parameter and accounts for GR and Tidal effects on the radial velocities.

Parameters:

Name Type Description Default
fix bool, default=True

whether the number of Keplerians should be fixed

required
npmax int, default=0

maximum number of Keplerians

required
data RVData

the RV data

required

Cprior property

Prior for the systemic velocity

Jprior property

Prior for the extra white noise (jitter)

KO_Kprior property

Prior for Semi-amplitude of Binary orbit (+other known objects)

KO_Pprior property

Prior for Period of Binary orbit (+other known objects)

KO_cosiprior property

Prior for cosine of the inclination of Binary orbit (+other known objects) to the line-of-sight

KO_eprior property

Prior for eccentricity of Binary orbit (+other known objects)

KO_phiprior property

Prior for phase of Binary orbit at the reference time (+other known objects)

KO_qprior property

Prior for mass ratio of Binary (+other known objects), used if double lined

KO_wdotprior property

Prior for apsidal precession rate of Binary orbit (+other known objects)

KO_wprior property

Prior for argument of periastron of Binary orbit (+other known objects)

binary_mass property

secondary mass [Msun]

binary_radius property

secondary radius [Rsun]

conditional property

(self) -> kima.RVmodel.RVConditionalPrior

cubic_prior property

Prior for the cubic coefficient of the trend

degree property

degree of the polynomial trend

directory property

directory where the model ran

double_lined property

whether the data is for a double lined binary, and has two sets of RVs for each epoch

eclipsing property

whether binary is eclipsing and the inclination can be fixed to 90, defaults to true. If false, default prior is uniform in cosi

enforce_stability property

whether to enforce AMD-stability

fix property

whether the number of Keplerians is fixed

known_object property

whether to include (better) known extra Keplerian curve(s), should be true for BINARIESmodel

n_known_object property

how many known objects, should be >=1 for BINARIESmodel

nu_prior property

Prior for the degrees of freedom of the Student-t likelihood

offsets_prior property

Common prior for the between-instrument offsets

quadr_prior property

Prior for the quadratic coefficient of the trend

relativistic_correction property

whether to perform the GR correction

slope_prior property

Prior for the slope

star_mass property

primary mass [Msun]

star_radius property

primary radius [Rsun]

studentt property

use a Student-t distribution for the likelihood (instead of Gaussian)

tidal_correction property

whether to perform the tidal correction

trend property

whether the model includes a polynomial trend

Run

To run the sampler and estimate the posterior for the model parameters just call kima.run

Example:

import kima

kima.run(model, steps=1000, num_threads=4)
kima.run API

run(m: kima.RVmodel.RVmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None run(m: kima.GPmodel.GPmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None run(m: kima.RVFWHMmodel.RVFWHMmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None run(m: kima.TRANSITmodel.TRANSITmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None run(m: kima.OutlierRVmodel.OutlierRVmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None run(m: kima.BINARIESmodel.BINARIESmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None run(m: kima.GAIAmodel.GAIAmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None run(m: kima.RVGAIAmodel.RVGAIAmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None run(m: kima.RVFWHMRHKmodel.RVFWHMRHKmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None run(m: kima.ETVmodel.ETVmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None run(m: kima.SPLEAFmodel.SPLEAFmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None

Overloaded function.

  1. run(m: kima.RVmodel.RVmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None

Run the DNest4 sampler with the given model

Parameters:

Name Type Description Default
m (RVmodel, GPmodel, ...)

The model

required
steps int

How many steps to run. Default is 100.

required
num_threads int

How many threads to use for parallel processing. Default is 1.

required
num_particles int

Number of MCMC particles. Default is 1.

required
new_level_interval int

Number of steps required to create a new level. Default is 2000.

required
save_interval int

Number of steps between saves. Default is 100.

required
thread_steps int

Number of independent steps on each thread. Default is 10.

required
max_num_levels int

Maximum number of levels, or 0 if it should be determined automatically. Default is 0.

required
lambda_ int

DOC. Default is 10.0

required
beta int

DOC. Default is 100.0,

required
compression int

DOC. Default is exp(1.0)

required
seed int

Random number seed value, or 0 to use current time. Default is 0.

required
print_thin int

Thinning steps for terminal output. Default is 50.

required
  1. run(m: kima.GPmodel.GPmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None

  2. run(m: kima.RVFWHMmodel.RVFWHMmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None

  3. run(m: kima.TRANSITmodel.TRANSITmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None

  4. run(m: kima.OutlierRVmodel.OutlierRVmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None

  5. run(m: kima.BINARIESmodel.BINARIESmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None

  6. run(m: kima.GAIAmodel.GAIAmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None

  7. run(m: kima.RVGAIAmodel.RVGAIAmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None

  8. run(m: kima.RVFWHMRHKmodel.RVFWHMRHKmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None

  9. run(m: kima.ETVmodel.ETVmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None

  10. run(m: kima.SPLEAFmodel.SPLEAFmodel, steps: int = 100, num_threads: int = 1, num_particles: int = 1, new_level_interval: int = 2000, save_interval: int = 100, thread_steps: int = 10, max_num_levels: int = 0, lambda_: float = 10.0, beta: float = 100.0, compression: float = 2.718281828459045, seed: int = 0, print_thin: int = 50) -> None


Distributions

The distributions sub-package contains the implementation of several probability distributions that can be used as priors for a model parameter. All distributions have standard parameterizations, as you would find e.g. in Wikipedia. Some distributions have a corresponding Truncated version which truncates the support of the distribution to an interval $ [{\rm lower}, {\rm upper} ]$.

Example:

from kima import distributions

parameter_prior = distributions.Gaussian(10, 1)
kima.distributions API

Cauchy()

Cauchy distribution

init(self, loc: float, scale: float) -> None

loc property

Location parameter

scale property

Scale parameter

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Exponential()

Exponential distribution

init(self, scale: float) -> None

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

ExponentialRayleighMixture()

docs

init(self, weight: float, scale: float, sigma: float) -> None

docs

scale property

(self) -> float

sigma property

(self) -> float

weight property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Fixed()

'Fixed' distribution

init(self, value: float) -> None

val property

Fixed value of the parameter

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Gaussian()

Gaussian distribution

init(self, loc: float, scale: float) -> None

loc property

Location parameter

scale property

Scale parameter

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

GaussianMixture()

Mixture of Gaussian distributions

init(self, means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float]) -> None init(self, means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float], lower: float, upper: float) -> None init(self, means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float], weights: collections.abc.Sequence[float], lower: float, upper: float) -> None

Overloaded function.

  1. __init__(self, means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float]) -> None

Instantiates a mixture of Gaussian distributions from lists of means and sigmas, with equal weights

  1. __init__(self, means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float], lower: float, upper: float) -> None

Instantiates a mixture of Gaussian distributions from lists of means and sigmas, with equal weights, truncated to [lower, upper]

  1. __init__(self, means: collections.abc.Sequence[float], sigmas: collections.abc.Sequence[float], weights: collections.abc.Sequence[float], lower: float, upper: float) -> None

Instantiates a mixture of Gaussian distributions from lists of means, sigmas, and weights, truncated to [lower, upper]

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

HalfGaussian()

Half-Gaussian distribution

init(self, scale: float) -> None

scale property

Scale parameter

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

InverseGamma()

Inverse gamma distribution

init(self, alpha: float, beta: float) -> None

Inverse gamma distribution

alpha property

Shape parameter α

beta property

Scale parameter β

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

InverseMoment()

InverseMoment prior

init(self, tau: float, kmax: float) -> None

kmax property

(self) -> float

tau property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Kumaraswamy()

Kumaraswamy distribution (similar to a Beta distribution)

init(self, a: float, b: float) -> None

a property

(self) -> float

b property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Laplace()

Laplace distribution

init(self, loc: float, scale: float) -> None

loc property

Location parameter

scale property

Scale parameter

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

LogUniform()

LogUniform distribution (sometimes called reciprocal or Jeffrey's distribution)

init(self, lower: float, upper: float) -> None

lower property

(self) -> float

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

ModifiedLogUniform()

ModifiedLogUniform distribution

init(self, knee: float, upper: float) -> None

knee property

(self) -> float

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Pareto()

Pareto distribution

init(self, min: float, alpha: float) -> None

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

RNG()

init(self, seed: int) -> None

rand() method descriptor

rand(self) -> float

Uniform(0, 1)

rand_int() method descriptor

rand_int(self, arg: int, /) -> int

IntegerUniform(0, N)

Rayleigh()

Rayleigh distribution

init(self, scale: float) -> None

scale property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

SingleTransitPeriodPrior()

Prior for the orbital period when a single planet transit was observed

init(self, W: float, L: float, Pmax: float) -> None

L property

Mid-transit time minus the start of the observational window

Pmax property

Maximum orbital period

W property

Observational window

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Triangular()

Triangular distribution

init(self, lower: float, center: float, upper: float) -> None

center property

(self) -> float

lower property

(self) -> float

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

TruncatedCauchy()

docs

init(self, loc: float, scale: float, lower: float, upper: float) -> None

loc property

Location parameter

lower property

(self) -> float

scale property

Scale parameter

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

TruncatedExponential()

Exponential distribution truncated to [lower, upper]

init(self, scale: float, lower: float, upper: float) -> None

lower property

(self) -> float

scale property

(self) -> float

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

TruncatedGaussian()

Gaussian distribution truncated to [lower, upper] interval

init(self, loc: float, scale: float, lower: float, upper: float) -> None

loc property

Location parameter

lower property

Lower truncation boundary

scale property

Scale parameter

upper property

Upper truncation boundary

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

TruncatedPareto()

Pareto distribution truncated to [lower, upper] interval

init(self, min: float, alpha: float, lower: float, upper: float) -> None

alpha property

Scale parameter

lower property

(self) -> float

min property

Location parameter

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

TruncatedRayleigh()

Rayleigh distribution truncated to [lower, upper] interval

init(self, scale: float, lower: float, upper: float) -> None

lower property

(self) -> float

scale property

(self) -> float

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Uniform()

Uniform distribuion in [lower, upper]

init(self, lower: float, upper: float) -> None

lower property

(self) -> float

upper property

(self) -> float

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

UniformAngle()

Uniform distribuion in [0, 2*PI]

init(self) -> None

cdf() method descriptor

cdf(self, x: float) -> float

Cumulative distribution function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the CDF

required

logpdf() method descriptor

logpdf(self, x: float) -> float

Logarithm of the probability density function evaluated at x

Parameters:

Name Type Description Default
x float

point at which to evaluate the PDF

required

ppf() method descriptor

ppf(self, q: float) -> float

Percent point function (inverse of cdf) evaluated at q

Parameters:

Name Type Description Default
q float

point at which to evaluate the PPF

required

Keplerian

Finally, even though it sits at the core of what kima does, there is the keplerian function:

kima.keplerian API

keplerian(t: collections.abc.Sequence[float], P: float, K: float, ecc: float, w: float, M0: float, M0_epoch: float) -> list[float]

Calculate the Keplerian curve at times t

Parameters:

Name Type Description Default
t array

Times at which to calculate the Keplerian function

required
P float

Orbital period [days]

required
K float

Semi-amplitude

required
ecc float

Orbital eccentricity

required
w float

Argument of periastron [rad]

required
M0 float

Mean anomaly at the epoch [rad]

required
M0_epoch float

Reference epoch for the mean anomaly (M=0 at this time) [days]

required

Returns:

Name Type Description
v array

Keplerian function evaluated at input times t