|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Multivariate distribution represented through marginals and a copula. More...
#include <JointDistribution.h>
Public Member Functions | |
| JointDistribution (std::unique_ptr< IMarginalDistribution > dist, std::unique_ptr< IDecomposition > decomp) | |
| Vector | generate (const Matrix &correlation) const |
| JointDistribution (std::vector< std::unique_ptr< IMarginalDistribution > > marginals, std::unique_ptr< ICopula > copula) | |
| Constructs a joint distribution from marginals and a copula. | |
| std::vector< std::vector< double > > | sample (std::size_t n) const |
| Draws multiple samples from the joint distribution. | |
| std::vector< double > | sample () const |
| Draws a single sample from the joint distribution. | |
| double | logpdf (std::vector< double > x) const |
| Evaluates the joint log-density at a given point. | |
| RealMatrix | curvature (std::vector< double > x) const |
| Computes the negative Hessian of the joint log-density. | |
| std::size_t | dim () |
| Returns the dimension of the random vector. | |
| std::vector< double > | get_stds () |
| Returns the standard deviations of all marginals. | |
Public Attributes | |
| MarginalConfig | |
| CopulaConfig = Union[GaussianCopulaConfig, StudentTCopulaConfig] | |
Multivariate distribution represented through marginals and a copula.
The class owns one marginal distribution per dimension and a copula defining the dependence structure between dimensions. Samples are generated by drawing correlated uniforms from the copula and mapping them through each marginal inverse CDF. Density evaluation combines marginal log-densities and the copula log-density.
Definition at line 145 of file correlated_rng.cpp.
|
inline |
Definition at line 147 of file correlated_rng.cpp.
| JointDistribution::JointDistribution | ( | std::vector< std::unique_ptr< IMarginalDistribution > > | marginals, |
| std::unique_ptr< ICopula > | copula | ||
| ) |
Constructs a joint distribution from marginals and a copula.
Ownership of all marginal distributions and the copula is transferred to the constructed object.
| marginals | Marginal distributions, one per random-vector component. |
| copula | Copula encoding the dependence structure. |
Definition at line 19 of file JointDistribution.cpp.
| RealMatrix JointDistribution::curvature | ( | std::vector< double > | x | ) | const |
Computes the negative Hessian of the joint log-density.
The returned matrix corresponds to the local curvature matrix 
| x | Point at which the curvature is evaluated. |
| std::invalid_argument | if x does not match the distribution dimension. |
| std::runtime_error | if a non-finite intermediate value is detected. |
Definition at line 64 of file JointDistribution.cpp.
| std::size_t JointDistribution::dim | ( | ) |
Returns the dimension of the random vector.
Definition at line 169 of file JointDistribution.cpp.
Definition at line 152 of file correlated_rng.cpp.
| std::vector< double > JointDistribution::get_stds | ( | ) |
Returns the standard deviations of all marginals.
Definition at line 173 of file JointDistribution.cpp.
| double JointDistribution::logpdf | ( | std::vector< double > | x | ) | const |
Evaluates the joint log-density at a given point.
The value is computed as the sum of marginal log-densities plus the copula log-density evaluated at the marginal CDF values:
![\[
\log f_X(x) = \sum_i \log f_i(x_i) + \log c(F_1(x_1), \ldots, F_d(x_d)).
\]](form_43.png)
| x | Point at which the log-density is evaluated. |
| std::invalid_argument | if x does not match the distribution dimension. |
Definition at line 49 of file JointDistribution.cpp.
| std::vector< double > JointDistribution::sample | ( | ) | const |
Draws a single sample from the joint distribution.
Definition at line 38 of file JointDistribution.cpp.
| std::vector< std::vector< double > > JointDistribution::sample | ( | std::size_t | n | ) | const |
Draws multiple samples from the joint distribution.
| n | Number of samples to generate. |
n samples, one sample per row. Definition at line 25 of file JointDistribution.cpp.
| JointDistribution.CopulaConfig = Union[GaussianCopulaConfig, StudentTCopulaConfig] |
Definition at line 33 of file JointDistribution.py.
| JointDistribution.MarginalConfig |
Definition at line 27 of file JointDistribution.py.