openmc.stats.Normal

class openmc.stats.Normal(mean_value, std_dev, lower=-inf, upper=inf, bias: Univariate | None = None)[source]

Normally distributed sampling with optional truncation.

The normal distribution is characterized by parameters \(\mu\) and \(\sigma\) and has density function \(p(X) = 1/(\sqrt{2\pi}\sigma) e^{-(X-\mu)^2/(2\sigma^2)}\). When truncated to the interval [lower, upper], the distribution is renormalized so that the PDF integrates to 1 over the truncation interval.

Changed in version 0.15.4: Added optional truncation bounds via lower and upper parameters.

Parameters:
  • mean_value (float) – Mean value of the distribution

  • std_dev (float) – Standard deviation of the Normal distribution

  • lower (float, optional) – Lower truncation bound. Defaults to -infinity (no lower bound).

  • upper (float, optional) – Upper truncation bound. Defaults to +infinity (no upper bound).

  • bias (openmc.stats.Univariate, optional) – Distribution for biased sampling.

Variables:
  • mean_value (float) – Mean of the Normal distribution

  • std_dev (float) – Standard deviation of the Normal distribution

  • lower (float) – Lower truncation bound

  • upper (float) – Upper truncation bound

  • support (tuple of float) – A 2-tuple (lower, upper) defining the interval over which the distribution is nonzero-valued

  • bias (openmc.stats.Univariate or None) – Distribution for biased sampling

evaluate(x)[source]

Evaluate PDF at x, returning normalized value for truncated dist.

classmethod from_xml_element(elem: Element)[source]

Generate Normal distribution from an XML element

Parameters:

elem (lxml.etree._Element) – XML element

Returns:

Normal distribution generated from XML element

Return type:

openmc.stats.Normal

property support

Return the support of the probability distribution.

Returns:

Returns the set of unique points assigned probability mass in a discrete distribution, the sampling interval for a continuous distribution, or a dictionary storing the discrete and continuous parts of the support of a mixed random variable

Return type:

set or tuple of float or dict

to_xml_element(element_name: str)[source]

Return XML representation of the Normal distribution

Parameters:

element_name (str) – XML element name

Returns:

element – XML element containing Normal distribution data

Return type:

lxml.etree._Element