EOSCheck¶
- class EOSCheck(minimum=-inf, maximum=inf)[source]¶
Bases:
Constraint- __init__(minimum=-inf, maximum=inf)[source]¶
Constraint used for EoS sampling. Converts the result of various checks on the EoS and its parameters into a prior that can reject unphysical samples. Necessary for EoS sampling.
- __call__()[source]¶
Overrides the __call__ special method. Calls the sample method.
- Returns:
- float: The return value of the sample method.
Methods
__init__([minimum, maximum])Constraint used for EoS sampling.
cdf(*args[, xp])Generic method to calculate CDF, can be overwritten in subclass
from_json(dct)from_repr(string)Generate the prior from its __repr__
get_instantiation_dict()is_in_prior_range(val)Returns True if val is in the prior boundaries, zero otherwise
ln_prob(val, *[, xp])Return the prior ln probability of val, this should be overwritten
prob(val, *[, xp])Returns the result of the equation of state check in the conversion function.
rescale(val, *[, xp])'Rescale' a sample from the unit line element to the prior.
sample([size, random_state])Draw a sample from the prior
to_json()Attributes
boundaryReturns True if the prior is fixed and should not be used in the sampler.
Latex label that can be used for plots.
If a unit is specified, returns a string of the latex label and unit
maximumminimumunitwidth- cdf(*args, xp=None, **kwargs)[source]¶
Generic method to calculate CDF, can be overwritten in subclass
- property is_fixed¶
Returns True if the prior is fixed and should not be used in the sampler. Does this by checking if this instance is an instance of DeltaFunction.
- Returns:
- bool: Whether it’s fixed or not!
- is_in_prior_range(val)[source]¶
Returns True if val is in the prior boundaries, zero otherwise
- Parameters:
- val: Union[float, int, array_like]
- Returns:
- np.nan
- property latex_label¶
Latex label that can be used for plots.
Draws from a set of default labels if no label is given
- Returns:
- str: A latex representation for this prior
- property latex_label_with_unit¶
If a unit is specified, returns a string of the latex label and unit
- ln_prob(val, *, xp=<module 'numpy' from '/home/runner/work/bilby/bilby/.pixi/envs/documentation/lib/python3.13/site-packages/numpy/__init__.py'>)[source]¶
Return the prior ln probability of val, this should be overwritten
- Parameters:
- val: Union[float, int, array_like]
- Returns:
- np.nan
- prob(val, *, xp=<module 'numpy' from '/home/runner/work/bilby/bilby/.pixi/envs/documentation/lib/python3.13/site-packages/numpy/__init__.py'>)[source]¶
Returns the result of the equation of state check in the conversion function.