Gaussian Processes

The determination of periodicities using Gaussian Processes has been getting somewhat trendy as of recent years. In the area of astrophysical time series analysis, it’s been used with varying degrees of success to study stellar magnetic cycles (timescale of years) and stellar rotation (timescale of days), none of which are strictly periodic processes.

class periodicity.gp.BrownianGP(signal, err, init_period=None, period_ppf=None)

Bases: periodicity.gp.CeleriteModeler

prior_transform(u)
class periodicity.gp.BrownianTheanoGP(signal, err, init_period=None, predict_at=None, psd_at=None)

Bases: periodicity.gp.TheanoModeler

class periodicity.gp.CeleriteModeler(signal, err, init_period=None, period_ppf=None)

Bases: object

get_kernel(tau, gp)
get_prediction(time, gp)
get_psd(frequency, gp)
log_prob(u, gp)
mcmc(n_walkers=50, n_steps=1000, burn=0, use_prior=False, random_seed=None)

Samples the posterior probability distribution with a Markov Chain Monte Carlo simulation.

Parameters
  • n_walkers (int, optional) – Number of walkers (the default is 50).

  • n_steps (int, optional) – Number of steps taken by each walker (the default is 1000).

  • burn (int, optional) – Number of burn-in samples to remove from the beginning of the simulation (the default is 0).

  • use_prior (bool, optional) – Whether to start walkers by sampling from the prior distribution. The default is False, in which case a ball centered at the MLE hyperparameter vector is used.

Returns

  • trace (dict) – Samples of the posterior hyperparameter distribution.

  • tau (ndarray) – Estimated autocorrelation time of MCMC chain for each parameter.

minimize(gp, **kwargs)

Gradient-based optimization of the objective function within the unit hypercube.

nll(u, gp)

Objective function based on the Negative Log-Likelihood.

prior_transform(u)
set_params(params, gp)
class periodicity.gp.GeorgeModeler(signal, err, init_period=None, period_prior=None, bounds=None, constraints=None)

Bases: object

get_kernel(tau, gp)
get_prediction(time, gp)
grad_nll(theta, gp)
log_prior(theta)
log_prob(theta, gp)

Posterior distribution over the hyperparameters.

mcmc(n_walkers=50, n_steps=1000, burn=0, random_seed=None)

Samples the posterior probability distribution with a Markov Chain Monte Carlo simulation.

Parameters
  • n_walkers (int, optional) – Number of walkers (the default is 50).

  • n_steps (int, optional) – Number of steps taken by each walker (the default is 1000).

  • burn (int, optional) – Number of burn-in samples to remove from the beginning of the simulation (the default is 0).

  • use_prior (bool, optional) – Whether to start walkers by sampling from the prior distribution. The default is False, in which case a ball centered at the MLE hyperparameter vector is used.

Returns

samples – Samples of the posterior hyperparameter distribution.

Return type

ndarray[n_dim, n_walkers * (n_steps - burn)]

minimize(gp, grad=False, **kwargs)

Gradient-based optimization of the objective function within the unit hypercube.

nll(theta, gp)

Objective function based on the Negative Log-Likelihood.

set_params(theta, gp)
class periodicity.gp.HarmonicGP(signal, err, init_period=None, period_ppf=None)

Bases: periodicity.gp.CeleriteModeler

prior_transform(u)
class periodicity.gp.HarmonicTheanoGP(signal, err, init_period=None, predict_at=None, psd_at=None)

Bases: periodicity.gp.TheanoModeler

class periodicity.gp.QuasiPeriodicGP(signal, err, init_period=None, period_prior=None, bounds=None, constraints=None)

Bases: periodicity.gp.GeorgeModeler

log_prior(theta)
class periodicity.gp.TheanoModeler(signal, err, init_period=None)

Bases: object

mcmc(n_walkers=1, n_steps=2000, burn=1000, cores=1)

References and additional reading