14 return std::visit([seed](
auto&& c) -> std::unique_ptr<ICopula> {
15 using T = std::decay_t<
decltype(c)>;
16 if constexpr (std::is_same_v<T, GaussianCopulaConfig>)
17 return std::make_unique<GaussianCopula>(seed, c.R);
18 else if constexpr (std::is_same_v<T, StudentTCopulaConfig>)
19 return std::make_unique<StudentTCopula>(seed, c.R, c.nu);
28 return make(seed, config);
30 return make(seed, config);
32 throw std::invalid_argument(
"Unknown copula.");
std::unique_ptr< ICopula > make(unsigned int seed, CopulaConfig cfg)
Internal helper constructing a copula from the active variant alternative.
Factory utilities for constructing copula objects from typed configurations.
CopulaType
Identifies the copula family used to model dependence.
@ GAUSSIAN
Gaussian copula, defined by a correlation matrix.
@ STUDENT_T
Student-t copula, defined by a correlation matrix and degrees of freedom.
static std::unique_ptr< ICopula > create(CopulaType name, CopulaConfig config, unsigned int seed=std::random_device{}())
Creates a concrete copula instance.
double T(double x)
Wilson coefficient T(x).