Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
GaussianMarginal Class Referencefinal

One-dimensional Gaussian marginal distribution. More...

#include <GaussianMarginal.h>

Inheritance diagram for GaussianMarginal:
Collaboration diagram for GaussianMarginal:

Public Member Functions

 GaussianMarginal (unsigned int seed=std::random_device{}())
 
Vector sample (std::size_t n) override
 
 GaussianMarginal (double mu, double sigma, unsigned int seed=std::random_device{}())
 Constructs a Gaussian marginal.
 
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 mean of the distribution.
 
- Public Member Functions inherited from IMarginalDistribution
virtual ~IMarginalDistribution ()=default
 
virtual ~IMarginalDistribution ()=default
 Virtual destructor for safe polymorphic deletion.
 

Detailed Description

One-dimensional Gaussian marginal distribution.

This class models the normal distribution:

\[
  f(x)=\frac{1}{\sqrt{2\pi}\sigma}\exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right).
\]

It provides:

  • iid sampling,
  • exact log-density,
  • CDF,
  • inverse CDF,
  • analytical mean and standard deviation.

Sampling and distribution utilities are provided through GSL.

Definition at line 111 of file correlated_rng.cpp.

Constructor & Destructor Documentation

◆ GaussianMarginal() [1/2]

GaussianMarginal::GaussianMarginal ( unsigned int  seed = std::random_device{}())
inlineexplicit

Definition at line 113 of file correlated_rng.cpp.

◆ GaussianMarginal() [2/2]

GaussianMarginal::GaussianMarginal ( double  mu,
double  sigma,
unsigned int  seed = std::random_device{}() 
)
explicit

Constructs a Gaussian marginal.

Parameters
muMean of the distribution.
sigmaStandard deviation of the distribution.
seedSeed for the internal RNG.

Definition at line 3 of file GaussianMarginal.cpp.

Member Function Documentation

◆ cdf()

double GaussianMarginal::cdf ( double  x)
overridevirtual

Evaluates the cumulative distribution function at x.

Parameters
xPoint at which the CDF is evaluated.
Returns
$P(X \le x)$.

Implements IMarginalDistribution.

Definition at line 45 of file GaussianMarginal.cpp.

◆ f_df_ddf()

PDFDiff GaussianMarginal::f_df_ddf ( double  x)
overridevirtual

Implements IMarginalDistribution.

Definition at line 29 of file GaussianMarginal.cpp.

◆ logpdf()

double GaussianMarginal::logpdf ( double  x)
overridevirtual

Evaluates the logarithm of the probability density at x.

For continuous distributions, this is usually $\log f(x)$. For discrete or sampler-only distributions, the exact semantics depend on the implementation.

Parameters
xPoint at which the log-density is evaluated.
Returns
Natural logarithm of the density (or implementation-defined proxy).

Implements IMarginalDistribution.

Definition at line 16 of file GaussianMarginal.cpp.

◆ mean()

double GaussianMarginal::mean ( )
overridevirtual

Returns the mean of the distribution.

Returns
Distribution mean.

Implements IMarginalDistribution.

Definition at line 53 of file GaussianMarginal.cpp.

◆ ppf()

double GaussianMarginal::ppf ( double  p)
overridevirtual

Evaluates the quantile function (inverse CDF).

Parameters
xProbability in the unit interval.
Returns
Quantile associated with x.

Implements IMarginalDistribution.

Definition at line 49 of file GaussianMarginal.cpp.

◆ rvs()

std::vector< double > GaussianMarginal::rvs ( std::size_t  n)
overridevirtual

Draws random samples from the marginal distribution.

Parameters
nNumber of samples to generate.
Returns
std::vector<double> of size n containing iid draws.

Implements IMarginalDistribution.

Definition at line 9 of file GaussianMarginal.cpp.

◆ sample()

Vector GaussianMarginal::sample ( std::size_t  n)
inlineoverridevirtual

Implements IMarginalDistribution.

Definition at line 116 of file correlated_rng.cpp.

◆ std()

double GaussianMarginal::std ( )
overridevirtual

Returns the mean of the distribution.

Returns
Distribution mean.

Implements IMarginalDistribution.

Definition at line 57 of file GaussianMarginal.cpp.


The documentation for this class was generated from the following files: