coolest.template.classes.parameter#

Classes#

Parameter

Base class of a generic model parameter.

NonLinearParameter

Define a non-linear parameter of a lens model

LinearParameter

Define a hyper-parameter of a lens model

HyperParameter

Define a hyper-parameter of a model

LinearParameterSet

Typically for analytical basis sets.

NonLinearParameterSet

Typically for position of point sources.

PixelatedRegularGridParameter

Typically for pixelated profiles

IrregularGridParameter

Typically for pixelated profiles

Module Contents#

class Parameter(documentation: str, definition_range: DefinitionRange = None, units: str = None, fixed: bool = False, point_estimate: PointEstimate = None, posterior_stats: coolest.template.classes.probabilities.PosteriorStatistics = None, prior: coolest.template.classes.probabilities.Prior = None, latex_str: str = None)[source]#

Base class of a generic model parameter.

Parameters:
  • documentation (str) – Short description of the parameter.

  • definition_range (DefinitionRange, optional) – Interval over which the parameter is defined, by default None

  • units (str, optional) – Unit of the parameter, if any, by default None

  • fixed (bool, optional) – If True, the parameter is considered fixed (i.e. should not be, or has not be optimized), by default False

  • point_estimate (PointEstimate, optional) – Point-estimate value of the parameter, by default None

  • posterior_stats (PosteriorStatistics, optional) – Summary statistics of the marginalized posterior distribution of the parameter, by default None

  • prior (Prior, optional) – Prior assigned the parameter, if any, by default None

  • latex_str (str, optional) – LaTeX representation of the parameter, by default None

  • #TODO (for parameters like orientation / axis ratio, add a class method to compute) – related quantities like ellipticity parameters.

documentation[source]#
units = None[source]#
definition_range = None[source]#
fixed = False[source]#
posterior_stats = None[source]#
prior = None[source]#
latex_str = None[source]#
id = None[source]#
set_point_estimate(point_estimate)[source]#

Set the point estimate value of the parameter.

Parameters:

point_estimate (int, float, list, PointEstimate) – Parameter value, or directly a PointEstimate instance.

Raises:
  • ValueError – If the provided point_estimate has not a supported type.

  • ValueError – If the parameter value is below its minimum allowed value.

  • ValueError – If the parameter value is above its maximum allowed value.

remove_point_estimate()[source]#

Remove the current point estimate of the parameter.

set_posterior(posterior_stats)[source]#

Set the posterior statistics of the parameter.

Parameters:

posterior_stats (PosteriorStatistics) – Instance of the PosteriorStatistics object.

Raises:

ValueError – If the argument is not a PosteriorStatistics instance.

remove_posterior()[source]#

Remove the current posterior statistics of the parameter.

set_prior(prior)[source]#

Associate a prior distribution to the parameter.

Parameters:

prior (Prior) – Instance of Prior object.

Raises:

ValueError – If the argument is not a Prior instance.

remove_prior()[source]#

Remove the current posterior statistics of the parameter.

fix()[source]#

Set the fixed attribute to True, marking it as fixed.

unfix()[source]#

Set the fixed attribute to False, marking as free to vary

class NonLinearParameter(*args, **kwargs)[source]#

Define a non-linear parameter of a lens model

Warning: this class may be removed in the future.

class LinearParameter(*args, **kwargs)[source]#

Define a hyper-parameter of a lens model

Warning: this class may be removed in the future, as it adds an unnecessary abstraction level.

class HyperParameter(*args, **kwargs)[source]#

Define a hyper-parameter of a model

class LinearParameterSet(*args, **kwargs)[source]#

Typically for analytical basis sets.

Warning: this class may be removed in the future, as it adds an unnecessary abstraction level.

class NonLinearParameterSet(*args, **kwargs)[source]#

Typically for position of point sources.

Warning: this class may be removed in the future, as it adds an unnecessary abstraction level.

class PixelatedRegularGridParameter(documentation, **kwargs_grid)[source]#

Typically for pixelated profiles

documentation[source]#
class IrregularGridParameter(documentation, **kwargs_grid)[source]#

Typically for pixelated profiles

documentation[source]#