|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Gaussian copula based on a correlation matrix. More...
#include <GaussianCopula.h>


Public Member Functions | |
| GaussianCopula (unsigned int seed, RealMatrix R) | |
| Constructs a Gaussian copula from a correlation matrix. | |
| std::vector< Vector > | sample_u (std::size_t n) override |
| Draws multiple samples from the copula. | |
| Vector | sample_u () override |
| Draws a single sample from the copula. | |
| double | log_density (Vector u) override |
| Evaluates the log-density of the copula at a point in the unit cube. | |
| RealMatrix | dlog_density (std::vector< double > u) override |
| Computes the gradient of the Gaussian copula log-density. | |
| RealMatrix | ddlog_density (std::vector< double > u) override |
| Computes the Hessian of the Gaussian copula log-density. | |
| LogDensityDiff | log_c_dc_ddc (std::vector< double > u) override |
| Computes the log-density and its first and second derivatives. | |
Public Member Functions inherited from GenericCopula | |
| GenericCopula (unsigned int seed=std::random_device{}()) | |
| Constructs the copula base with a seeded random engine. | |
Public Member Functions inherited from ICopula | |
| virtual | ~ICopula ()=default |
| Virtual destructor. | |
Additional Inherited Members | |
Protected Attributes inherited from GenericCopula | |
| const gsl_rng_type * | rng_tp {gsl_rng_mt19937} |
| gsl_rng_sptr | eng_ {nullptr, &gsl_rng_free} |
| GSL RNG type used by the copula. | |
Gaussian copula based on a correlation matrix.
Internally, the copula stores:
Sampling:
Density evaluation:
Definition at line 63 of file GaussianCopula.h.
|
explicit |
Constructs a Gaussian copula from a correlation matrix.
The matrix is projected to a nearest positive semidefinite correlation matrix before decomposition.
| seed | Seed for the RNG. |
| R | Correlation matrix. |
Definition at line 3 of file GaussianCopula.cpp.
|
overridevirtual |
Computes the Hessian of the Gaussian copula log-density.
| u | Uniform vector in ![]() |
u. Implements ICopula.
Definition at line 66 of file GaussianCopula.cpp.
|
overridevirtual |
Computes the gradient of the Gaussian copula log-density.
| u | Uniform vector in ![]() |

Implements ICopula.
Definition at line 49 of file GaussianCopula.cpp.
|
overridevirtual |
Computes the log-density and its first and second derivatives.
This combined evaluation is intended to avoid repeated transformations of the same uniform vector when curvature information is required.
| u | Uniform vector in ![]() |
Implements ICopula.
Definition at line 89 of file GaussianCopula.cpp.
|
overridevirtual |
Evaluates the log-density of the copula at a point in the unit cube.
| u | Point in ![]() |


This evaluates the Gaussian copula density:
![\[
\log c(u)
= -\frac12 \log\det(R)
- \frac12 z^\top (R^{-1} - I) z
\]](form_29.png)
where 
Implements ICopula.
Definition at line 37 of file GaussianCopula.cpp.
|
overridevirtual |
Draws a single sample from the copula.
![$[0,1]^d$](form_34.png)
Implements ICopula.
Definition at line 20 of file GaussianCopula.cpp.
|
overridevirtual |
Draws multiple samples from the copula.
Each sample is a vector of uniform variates on ![$[0,1]$](form_35.png)
| n | Number of samples to generate. |
Implements ICopula.
Definition at line 10 of file GaussianCopula.cpp.