Skip to content

Commit

Permalink
Improve description of probabilities for openmc.stats.Tabular class (#…
Browse files Browse the repository at this point in the history
…3099)

Co-authored-by: Paul Romano <[email protected]>
  • Loading branch information
valderrama-juan and paulromano authored Jul 30, 2024
1 parent 467b8e9 commit 9d9b2da
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion openmc/stats/univariate.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,8 @@ class Tabular(Univariate):
Tabulated values of the random variable
p : Iterable of float
Tabulated probabilities. For histogram interpolation, if the length of
`p` is the same as `x`, the last value is ignored.
`p` is the same as `x`, the last value is ignored. Probabilities `p` are
given per unit of `x`.
interpolation : {'histogram', 'linear-linear', 'linear-log', 'log-linear', 'log-log'}, optional
Indicates how the density function is interpolated between tabulated
points. Defaults to 'linear-linear'.
Expand All @@ -854,6 +855,15 @@ class Tabular(Univariate):
Indicates how the density function is interpolated between tabulated
points. Defaults to 'linear-linear'.
Notes
-----
The probabilities `p` are interpreted per unit of the corresponding
independent variable `x`. This follows the definition of a probability
density function (PDF) in probability theory, where the PDF represents the
relative likelihood of the random variable taking on a particular value per
unit of the variable. For example, if `x` represents energy in eV, then `p`
should represent probabilities per eV.
"""

def __init__(
Expand Down

0 comments on commit 9d9b2da

Please sign in to comment.