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 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
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 of the model
thaw_parameter
(name)Thaw a parameter by name
get_gradient
- 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.
- 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
- property full_size
The total number of parameters (including frozen parameters)
- 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
)
- log_prior()
Compute the log prior probability of the current parameters
- property parameter_vector
An array of all parameters (including frozen 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 ifinclude_frozen
isTrue
.- 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 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, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
- 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.
- 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.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
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, ...[, ...])Calculate the log-likelihood for the PSPL + GP model and photometric data.
- 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.
- 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.
- log_likely_photometry(t_obs, mag_obs, mag_err_obs, filt_index=0)
Calculate the log-likelihood for the PSPL + GP model and photometric data.
Note
The GP will only be used for filters where use_gp_phot[filt_index] = True.