GP Class Family

class model.Celerite_GP_Model(pspl_model, filter_index)

Bases: Model

This is nedeed for the GP. Just a wrapper over our model so it is a celerite model.

Attributes:
full_size

The total number of parameters (including frozen parameters)

parameter_vector

An array of all parameters (including frozen parameters)

vector_size

The number of active (or unfrozen) parameters

Methods

compute_gradient(*args, **kwargs)

Compute the "gradient" of the model for the current parameters

freeze_all_parameters()

Freeze all parameters of the model

freeze_parameter(name)

Freeze a parameter by name

get_parameter(name)

Get a parameter value by name

get_parameter_bounds([include_frozen])

Get a list of the parameter bounds

get_parameter_dict([include_frozen])

Get an ordered dictionary of the parameters

get_parameter_names([include_frozen])

Get a list of the parameter names

get_parameter_vector([include_frozen])

Get an array of the parameter values in the correct order

get_value(t_obs)

Compute the "value" of the model for the current parameters

log_prior()

Compute the log prior probability of the current parameters

set_parameter(name, value)

Set a parameter value by name

set_parameter_vector(vector[, include_frozen])

Set the parameter values to the given vector

thaw_all_parameters()

Thaw all parameters of the model

thaw_parameter(name)

Thaw a parameter by name

get_gradient

compute_gradient(*args, **kwargs)

Compute the “gradient” of the model for the current parameters

This method should be overloaded by subclasses to implement the actual functionality of the model. The output of this function should be an array where the first dimension is full_size.

freeze_all_parameters()

Freeze all parameters of the model

freeze_parameter(name)

Freeze a parameter by name

Args:

name: The name of the parameter

get_parameter(name)

Get a parameter value by name

Args:

name: The name of the parameter

get_parameter_bounds(include_frozen=False)

Get a list of the parameter bounds

Args:
include_frozen (Optional[bool]): Should the frozen parameters be

included in the returned value? (default: False)

get_parameter_dict(include_frozen=False)

Get an ordered dictionary of the parameters

Args:
include_frozen (Optional[bool]): Should the frozen parameters be

included in the returned value? (default: False)

get_parameter_names(include_frozen=False)

Get a list of the parameter names

Args:
include_frozen (Optional[bool]): Should the frozen parameters be

included in the returned value? (default: False)

get_parameter_vector(include_frozen=False)

Get an array of the parameter values in the correct order

Args:
include_frozen (Optional[bool]): Should the frozen parameters be

included in the returned value? (default: False)

get_value(t_obs)

Compute the “value” of the model for the current parameters

This method should be overloaded by subclasses to implement the actual functionality of the model.

log_prior()

Compute the log prior probability of the current parameters

set_parameter(name, value)

Set a parameter value by name

Args:

name: The name of the parameter value (float): The new value for the parameter

set_parameter_vector(vector, include_frozen=False)

Set the parameter values to the given vector

Args:
vector (array[vector_size] or array[full_size]): The target

parameter vector. This must be in the same order as parameter_names and it should only include frozen parameters if include_frozen is True.

include_frozen (Optional[bool]): Should the frozen parameters be

included in the returned value? (default: False)

thaw_all_parameters()

Thaw all parameters of the model

thaw_parameter(name)

Thaw a parameter by name

Args:

name: The name of the parameter

property full_size

The total number of parameters (including frozen parameters)

property parameter_vector

An array of all parameters (including frozen parameters)

property vector_size

The number of active (or unfrozen) parameters

class model.PSPL_GP

Bases: ABC

PSPL object that has optional support for gaussian process on each photometric filter.

Methods

get_log_det_covariance(t_obs, mag_obs, ...)

Returns photometry with GP noise added in.

get_photometry_with_gp(t_obs, mag_obs, ...)

Returns photometry with GP noise added in.

log_likely_photometry(t_obs, mag_obs, ...[, ...])

For models that include a Gaussian Process, get the summed natural log of the likelihood for the input photometric data for the specified filter or data set.

get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)

Returns photometry with GP noise added in.

Note

This will throw an error if this is a filter with use_gp_phot[filt_index] = False.

get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)

Returns photometry with GP noise added in.

Note

This will throw an error if this is a filter with use_gp_phot[filt_index] = False.

Parameters:
t_obsarray_like

List of times in MJD for the observations. These times are used as input to the GP. If t_pred is not specified, then t_pred = t_obs.

mag_obsarray_like

List of observed photometric measurements of the microlensing event in magnitudes. These values are used as input to the GP. Length must be the same as t_obs.

mag_obs_errarray_like

List of observed photometric uncertainties of the microlensing event in magnitudes. These values are used as input to the GP. Length must be the same as t_obs.

filt_idxint, optional

Index of the photometric filter or data set.

t_predarray_like, optional

List of times in MJD on which to evalute the model. If t_pred is not specified, then t_pred = t_obs.

Returns:
mag_modelarray_like

Magnitude of the unresolved microlensing event at t_obs.

log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)

For models that include a Gaussian Process, get the summed natural log of the likelihood for the input photometric data for the specified filter or data set. Note, this function returns the full ln(likelihood), including the normalization constant.

Parameters:
t_obsarray_like

List of times in MJD for the observations.

mag_obsarray_like

List of observed photometric measurements of the microlensing event in magnitudes. Length must be the same as t_obs.

mag_obs_errarray_like

List of observed photometric uncertainties of the microlensing event in magnitudes. Length must be the same as t_obs.

filt_idxint, optional

Index of the photometric filter or data set.

Returns:
ln_Lfloat

ln(likelihood) summed over the photometric measurement

Note

The GP will only be used for filters where use_gp_phot[filt_index] = True.

class model.PSPL_GP

Bases: ABC

PSPL object that has optional support for gaussian process on each photometric filter.

Methods

get_log_det_covariance(t_obs, mag_obs, ...)

Returns photometry with GP noise added in.

get_photometry_with_gp(t_obs, mag_obs, ...)

Returns photometry with GP noise added in.

log_likely_photometry(t_obs, mag_obs, ...[, ...])

For models that include a Gaussian Process, get the summed natural log of the likelihood for the input photometric data for the specified filter or data set.

get_log_det_covariance(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)

Returns photometry with GP noise added in.

Note

This will throw an error if this is a filter with use_gp_phot[filt_index] = False.

get_photometry_with_gp(t_obs, mag_obs, mag_err_obs, filt_index=0, t_pred=None)

Returns photometry with GP noise added in.

Note

This will throw an error if this is a filter with use_gp_phot[filt_index] = False.

Parameters:
t_obsarray_like

List of times in MJD for the observations. These times are used as input to the GP. If t_pred is not specified, then t_pred = t_obs.

mag_obsarray_like

List of observed photometric measurements of the microlensing event in magnitudes. These values are used as input to the GP. Length must be the same as t_obs.

mag_obs_errarray_like

List of observed photometric uncertainties of the microlensing event in magnitudes. These values are used as input to the GP. Length must be the same as t_obs.

filt_idxint, optional

Index of the photometric filter or data set.

t_predarray_like, optional

List of times in MJD on which to evalute the model. If t_pred is not specified, then t_pred = t_obs.

Returns:
mag_modelarray_like

Magnitude of the unresolved microlensing event at t_obs.

log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)

For models that include a Gaussian Process, get the summed natural log of the likelihood for the input photometric data for the specified filter or data set. Note, this function returns the full ln(likelihood), including the normalization constant.

Parameters:
t_obsarray_like

List of times in MJD for the observations.

mag_obsarray_like

List of observed photometric measurements of the microlensing event in magnitudes. Length must be the same as t_obs.

mag_obs_errarray_like

List of observed photometric uncertainties of the microlensing event in magnitudes. Length must be the same as t_obs.

filt_idxint, optional

Index of the photometric filter or data set.

Returns:
ln_Lfloat

ln(likelihood) summed over the photometric measurement

Note

The GP will only be used for filters where use_gp_phot[filt_index] = True.