12 unsigned int seed = 123456789;
30 std::vector<std::unique_ptr<IMarginalDistribution>> marginals;
31 marginals.push_back(std::move(m_1));
32 marginals.push_back(std::move(m_2));
36 LOG_INFO(
"JointDistribution initialized");
39 std::vector<Vector> smpl = rvg.
sample(10000);
42 os.open(
"sample.csv");
44 for (
const Vector& z : smpl) {
45 os << z[0] <<
"," << z[1] <<
"\n";
51 double x_1 {0.0}, x_2 {1.0};
55 std::size_t n1 = x1_max / dx;
56 std::size_t n2 = x2_max / dx;
58 printf(
"(%li,%li)\n", n1, n2);
60 os.open(
"logpdf.csv");
62 for (
size_t i = 0; i < n1; i++) {
64 for (
size_t j = 0; j < n2; j++) {
65 os << x_1 <<
"," << x_2 <<
"," << rvg.
logpdf({x_1, x_2}) <<
"\n";
Factory utilities for constructing copula objects from typed configurations.
@ GAUSSIAN
Gaussian copula, defined by a correlation matrix.
Gaussian copula implementation.
Joint probability distribution built from marginals and a copula.
#define LOG_INFO(...)
Macro for logging informational messages.
Factory for instantiating concrete marginal distributions.
@ FLAT
Uniform (flat) marginal on a finite interval.
Lightweight dense real-matrix utilities built on top of STL storage and GSL backends.
Asymmetric split-Gaussian marginal distribution.
static std::unique_ptr< ICopula > create(CopulaType name, CopulaConfig config, unsigned int seed=std::random_device{}())
Creates a concrete copula instance.
double logpdf(std::vector< double > x) const
Evaluates the joint log-density at a given point.
std::vector< std::vector< double > > sample(std::size_t n) const
Draws multiple samples from the joint distribution.
static std::unique_ptr< IMarginalDistribution > create(MarginalType name, MarginalConfig cfg, unsigned int seed=std::random_device{}())
Creates a concrete marginal-distribution object.
Configuration object for FlatMarginal.
Configuration object for a Gaussian copula.