|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Continuous uniform marginal distribution on [a,b]. More...
#include <FlatMarginal.h>


Public Member Functions | |
| FlatMarginal (double a, double b, unsigned int seed=std::random_device{}()) | |
| Constructs a uniform marginal on [a,b]. | |
| std::vector< double > | rvs (std::size_t n) override |
| Draws random samples from the marginal distribution. | |
| double | logpdf (double x) override |
Evaluates the logarithm of the probability density at x. | |
| PDFDiff | f_df_ddf (double x) override |
| double | cdf (double x) override |
Evaluates the cumulative distribution function at x. | |
| double | ppf (double p) override |
| Evaluates the quantile function (inverse CDF). | |
| double | mean () override |
| Returns the mean of the distribution. | |
| double | std () override |
| Returns the standard deviation of the distribution. | |
Public Member Functions inherited from IMarginalDistribution | |
| virtual | ~IMarginalDistribution ()=default |
| virtual Vector | sample (std::size_t n)=0 |
| virtual | ~IMarginalDistribution ()=default |
| Virtual destructor for safe polymorphic deletion. | |
Continuous uniform marginal distribution on [a,b].
This class models the flat probability density:
![\[
f(x) = \frac{1}{b-a}, \qquad x \in [a,b].
\]](form_67.png)
It provides:
A GSL random-number generator is owned internally.
The constructor rejects non-finite or reversed bounds. The density and log-density use the closed support convention at the two endpoints; this choice has no effect on probabilities for a continuous distribution.
Definition at line 75 of file FlatMarginal.h.
|
explicit |
Constructs a uniform marginal on [a,b].
| a | Lower bound of the support. |
| b | Upper bound of the support. |
| seed | Seed for the internal RNG. |
Definition at line 3 of file FlatMarginal.cpp.
|
overridevirtual |
Evaluates the cumulative distribution function at x.
| x | Point at which the CDF is evaluated. |

Implements IMarginalDistribution.
Definition at line 36 of file FlatMarginal.cpp.
|
overridevirtual |
Implements IMarginalDistribution.
Definition at line 31 of file FlatMarginal.cpp.
|
overridevirtual |
Evaluates the logarithm of the probability density at x.
For continuous distributions, this is usually 
| x | Point at which the log-density is evaluated. |
Implements IMarginalDistribution.
Definition at line 22 of file FlatMarginal.cpp.
|
overridevirtual |
Returns the mean of the distribution.
Implements IMarginalDistribution.
Definition at line 44 of file FlatMarginal.cpp.
|
overridevirtual |
Evaluates the quantile function (inverse CDF).
| x | Probability in the unit interval. |
x. Implements IMarginalDistribution.
Definition at line 40 of file FlatMarginal.cpp.
|
overridevirtual |
Draws random samples from the marginal distribution.
| n | Number of samples to generate. |
n containing iid draws. Implements IMarginalDistribution.
Definition at line 15 of file FlatMarginal.cpp.
|
overridevirtual |
Returns the standard deviation of the distribution.
Implements IMarginalDistribution.
Definition at line 48 of file FlatMarginal.cpp.