bilby.core.prior.analytical.ChiSquared
- class bilby.core.prior.analytical.ChiSquared(nu, name=None, latex_label=None, unit=None, boundary=None)[source]
Bases:
Gamma- __init__(nu, name=None, latex_label=None, unit=None, boundary=None)[source]
Chi-squared distribution
https://en.wikipedia.org/wiki/Chi-squared_distribution
- Parameters:
- nu: int
Number of degrees of freedom
- name: str
See superclass
- latex_label: str
See superclass
- unit: str
See superclass
- boundary: str
See superclass
- __call__()[source]
Overrides the __call__ special method. Calls the sample method.
- Returns:
- float: The return value of the sample method.
Methods
__init__(nu[, name, latex_label, unit, boundary])Chi-squared distribution
cdf(*args[, xp])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(*args[, xp])prob(*args[, xp])Return the prior probability of val, this should be overwritten
rescale(*args[, 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
maximumminimumnuunitwidth- 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
- prob(*args, xp=None, **kwargs)[source]
Return the prior probability of val, this should be overwritten
- Parameters:
- val: Union[float, int, array_like]
- Returns:
- np.nan