eztaox.models#

Light curve models.

A module of light curve models. which are the interface for modeling uni/multi-band light curves using Gaussian Processes (GPs).

Classes#

MultiVarModel

An interface for modeling multivariate/multi-band time series using GPs.

UniVarModel

Subclass MultiVarModel for modeling univariate/single-band time series data.

Module Contents#

class MultiVarModel(X: tuple[tinygp.helpers.JAXArray | numpy.typing.NDArray, tinygp.helpers.JAXArray | numpy.typing.NDArray], y: tinygp.helpers.JAXArray | numpy.typing.NDArray, yerr: tinygp.helpers.JAXArray | numpy.typing.NDArray, base_kernel: tinygp.kernels.Kernel | eztaox.kernels.quasisep.Quasisep, n_band: int, *, multiband_kernel: tinygp.kernels.Kernel | tinygp.kernels.quasisep.Wrapper | None = None, mean_func: collections.abc.Callable | None = None, amp_scale_func: collections.abc.Callable | None = None, lag_func: collections.abc.Callable | None = None, **kwargs)[source]#

Bases: equinox.Module

An interface for modeling multivariate/multi-band time series using GPs.

This interface only takes GP kernels that can be evaluated using the scalable method of DFM+17 <https://arxiv.org/abs/1703.09710>. This interface allows fitting for a parameterized mean function of the time series, additional variance to the measurement uncertainty, and time delays between each uni-variate/single-band time series.

Parameters:
  • X (JAXArray|NDArray) – Input data containing time and band indices as a tuple.

  • y (JAXArray|NDArray) – Observed data values.

  • yerr (JAXArray|NDArray) – Observational uncertainties.

  • base_kernel (Quasisep) – A GP kernel from the kernels.quasisep module.

  • n_band (int) – An integer number of bands in the input light curve.

  • multiband_kernel (Quasisep, optional) – A multiband kernel specifying the cross-band covariance, defaults to kernels.quasisep.MultibandLowRank.

  • mean_func (Callable, optional) – A callable mean function for the GP, defaults to None.

  • amp_scale_func (Callable, optional) – A callable amplitude scaling function, defaults to None.

  • lag_func (Callable, optional) – A callable function for time delays between bands, defaults to None.

  • **kwargs

    Additional keyword arguments.

    • zero_mean (bool): If True, assumes zero-mean GP. Defaults to True.

    • has_jitter (bool): If True, assumes the input observational erros are underestimated. Defaults to False.

    • has_lag (bool): If True, assumes time delays between time series in each band. Defaults to False.

get_mean(zero_mean: bool, params: dict[str, tinygp.helpers.JAXArray], X: tinygp.helpers.JAXArray) tinygp.helpers.JAXArray[source]#

Return the mean of the GP.

get_amp_scale(params: dict[str, tinygp.helpers.JAXArray]) tinygp.helpers.JAXArray[source]#

Return the ampltiude of GP in each individaul band.

lag_transform(has_lag: bool, params: dict[str, tinygp.helpers.JAXArray], X: tinygp.helpers.JAXArray) tuple[tuple[tinygp.helpers.JAXArray, tinygp.helpers.JAXArray], tinygp.helpers.JAXArray][source]#

Shift the time axis by the lag in each band.

Parameters:
  • has_lag (bool) – should we introduce lag?

  • params (dict) – argument to pass to the lag function (callable for time delays between bands).

  • X (JAXArray) – times and bands

Returns:

modified times and bands

and indexes of the new times.

Return type:

tuple(tuple(JAXArray, JAXArray), JAXArray)

log_prob(params: dict[str, tinygp.helpers.JAXArray]) tinygp.helpers.JAXArray[source]#

Calculate the log probability of the input parameters.

Parameters:

params (dict[str, JAXArray]) – Model parameters.

Returns:

Log probability of the input parameters.

Return type:

JAXArray

aic(params: dict[str, tinygp.helpers.JAXArray]) tinygp.helpers.JAXArray[source]#

Calculate the Akaike Information Criterion (AIC) for the model.

Parameters:

params (dict[str, JAXArray]) – Maximum likelihood model parameters.

Returns:

AIC value.

Return type:

JAXArray

bic(params: dict[str, tinygp.helpers.JAXArray]) tinygp.helpers.JAXArray[source]#

Calculate the Bayesian Information Criterion (BIC) for the model.

Parameters:

params (dict[str, JAXArray]) – Maximum likelihood model parameters.

Returns:

BIC value.

Return type:

JAXArray

sample(params: dict[str, tinygp.helpers.JAXArray]) None[source]#

Integrate with numpyro for MCMC sampling.

Parameters:

params (dict[str, JAXArray]) – Model parameters.

pred(params: dict[str, tinygp.helpers.JAXArray], X: tinygp.helpers.JAXArray) tuple[tinygp.helpers.JAXArray, tinygp.helpers.JAXArray][source]#

Make conditional GP prediction.

Parameters:
  • params (dict[str, JAXArray]) – A dictionary containing model parameters.

  • X (JAXArray) – The time and band information for creating the conditional GP prediction.

Returns:

A tuple of the mean GP prediction and its uncertainty (square root of the predicted variance).

Return type:

tuple[JAXArray, JAXArray]

class UniVarModel(t: tinygp.helpers.JAXArray | numpy.typing.NDArray, y: tinygp.helpers.JAXArray | numpy.typing.NDArray, yerr: tinygp.helpers.JAXArray | numpy.typing.NDArray, kernel: tinygp.kernels.Kernel | eztaox.kernels.quasisep.Quasisep, *, mean_func: collections.abc.Callable | None = None, amp_scale_func: collections.abc.Callable | None = None, **kwargs)[source]#

Bases: MultiVarModel

Subclass MultiVarModel for modeling univariate/single-band time series data.

Parameters:
  • t (JAXArray|NDArray) – Time stamps of the input light curve.

  • y (JAXArray|NDArray) – Observed data values at the corresponding time stamps.

  • yerr (JAXArray|NDArray) – Observational uncertainties.

  • kernel (Quasisep) – A GP kernel from the eztaox.kernels.quasisep module.

  • mean_func (Callable, optional) – A callable mean function for the GP, defaults to None.

  • amp_scale_func (Callable, optional) – A callable amplitude scaling function, defaults to None.

  • **kwargs

    Additional keyword arguments.

    • zero_mean (bool): If True, assumes zero-mean GP. Defaults to True.

    • has_jitter (bool): If True, assumes the input observational erros are underestimated. Defaults to False.

pred(params, t) tuple[tinygp.helpers.JAXArray, tinygp.helpers.JAXArray][source]#

Make conditional GP prediction.

Parameters:
  • params (dict[str, JAXArray]) – A dictionary containing model parameters.

  • t (JAXArray) – The time information for creating the conditional GP prediction.

Returns:

A tuple of the mean GP prediction and its uncertainty (square root of the predicted variance).

Return type:

tuple[JAXArray, JAXArray]