openmc.stats.Tabular¶
- class openmc.stats.Tabular(x, p, interpolation='linear-linear', ignore_negative=False)[source]¶
Piecewise continuous probability distribution.
This class is used to represent a probability distribution whose density function is tabulated at specific values with a specified interpolation scheme.
- Parameters
x (Iterable of float) – Tabulated values of the random variable
p (Iterable of float) – Tabulated probabilities
interpolation ({'histogram', 'linear-linear', 'linear-log', 'log-linear', 'log-log'}, optional) – Indicate whether the density function is constant between tabulated points or linearly-interpolated. Defaults to ‘linear-linear’.
ignore_negative (bool) – Ignore negative probabilities
- Variables
x (numpy.ndarray) – Tabulated values of the random variable
p (numpy.ndarray) – Tabulated probabilities
interpolation ({'histogram', 'linear-linear', 'linear-log', 'log-linear', 'log-log'}, optional) – Indicate whether the density function is constant between tabulated points or linearly-interpolated.
- classmethod from_xml_element(elem)[source]¶
Generate tabular distribution from an XML element
- Parameters
elem (xml.etree.ElementTree.Element) – XML element
- Returns
Tabular distribution generated from XML element
- Return type
- integral()[source]¶
Return integral of distribution
New in version 0.13.1.
- Returns
Integral of tabular distrbution
- Return type
- sample(n_samples=1, seed=None)[source]¶
Sample the univariate distribution
- Parameters
- Returns
A 1-D array of sampled values
- Return type