BioCMAMC-ST
|
Kokkos compatible method to draw from specific probability distribution. More...
Classes | |
struct | Exponential |
Represents a Exponential probability distribution. More... | |
struct | LogNormal |
Represents a LogNormal (Gaussian) probability distribution. More... | |
struct | Normal |
Represents a normal (Gaussian) probability distribution. More... | |
struct | ScaledTruncatedNormal |
Represents a Scaled TruncatedNormal (Gaussian) probability distribution. More... | |
struct | SkewNormal |
Represents a SkewNormal (Gaussian) probability distribution. More... | |
struct | TruncatedNormal |
Represents a TruncatedNormal (Gaussian) probability distribution. More... |
Concepts | |
concept | ProbabilityLaw |
Concept for probability distribution laws. |
Functions | |
template<FloatingPointType F> | |
KOKKOS_INLINE_FUNCTION F | erfinv (F x) |
Computes an approximation of the inverse error function. | |
template<FloatingPointType F> | |
KOKKOS_INLINE_FUNCTION F | norminv (F p, F mean, F stddev) |
Computes the inverse CDF (probit function) of a normal distribution. | |
template<FloatingPointType F> | |
KOKKOS_INLINE_FUNCTION F | std_normal_pdf (F x) |
Computes the standard normal probability density function (PDF). | |
template<FloatingPointType F> | |
KOKKOS_INLINE_FUNCTION F | std_normal_cdf (F x) |
Computes the standard normal cumulative distribution function (CDF). |
Kokkos compatible method to draw from specific probability distribution.
KOKKOS_INLINE_FUNCTION F MC::Distributions::erfinv | ( | F | x | ) |
Computes an approximation of the inverse error function.
This function approximates the inverse error function erfinv(x) using Winitzki’s method (from A. Soranzo, E. Epure), which provides a simple and computationally efficient formula based on logarithms and square roots.
F | Floating-point type (must satisfy FloatingPointType). |
x | Input value in the range [-1, 1]. |
KOKKOS_INLINE_FUNCTION F MC::Distributions::norminv | ( | F | p, |
F | mean, | ||
F | stddev ) |
Computes the inverse CDF (probit function) of a normal distribution.
This function returns the quantile function of a normal distribution with mean mean and standard deviation stddev, given a probability p.
F | Floating-point type (must satisfy FloatingPointType). |
p | Probability value in the range (0,1). |
mean | Mean of the normal distribution. |
stddev | Standard deviation of the normal distribution. |
KOKKOS_INLINE_FUNCTION F MC::Distributions::std_normal_cdf | ( | F | x | ) |
Computes the standard normal cumulative distribution function (CDF).
The standard normal CDF is given by:
\[ \Phi(x) = \frac{1}{2} \left( 1 + \operatorname{erf} \left( \frac{x}{\sqrt{2}} \right) \right) \]
F | Floating-point type (must satisfy FloatingPointType). |
x | Input value. |
KOKKOS_INLINE_FUNCTION F MC::Distributions::std_normal_pdf | ( | F | x | ) |
Computes the standard normal probability density function (PDF).
The standard normal PDF is given by:
\[ \phi(x) = \frac{1}{\sqrt{2\pi}} e^{-x^2 / 2} \]
F | Floating-point type (must satisfy FloatingPointType). |
x | Input value. |