skfolio.distribution
.select_bivariate_copula#
- skfolio.distribution.select_bivariate_copula(X, copula_candidates=None, selection_criterion=AIC, independence_level=0.05)[source]#
Select the best bivariate copula from a list of candidates using an information criterion.
This function first tests the dependence between the two variables in X using Kendall’s tau independence test. If the p-value is greater than or equal to
independence_level
, the null hypothesis of independence is not rejected, and theIndependentCopula
is returned. Otherwise, each candidate copula incopula_candidates
is fitted to the data X. For each candidate, either the Akaike Information Criterion (AIC) or the Bayesian Information Criterion (BIC) is computed, and the copula with the lowest criterion value is selected.- Parameters:
- Xarray-like of shape (n_observations, 2)
An array of bivariate inputs (u, v) with uniform marginals (values in [0, 1]).
- copula_candidateslist[BaseBivariateCopula]
A list of candidate copula models. Each candidate must inherit from
BaseBivariateCopula
. If None, defaults to[GaussianCopula(), StudentTCopula(), ClaytonCopula(), GumbelCopula(), JoeCopula()]
.- selection_criterionSelectionCriterion, default=SelectionCriterion.AIC
- The criterion used for model selection. Possible values are:
SelectionCriterion.AIC : Akaike Information Criterion
SelectionCriterion.BIC : Bayesian Information Criterion
- independence_levelfloat, default=0.05
The significance level for the Kendall tau independence test. If the p-value is greater than or equal to this level, the independence hypothesis is not rejected, and the
IndependentCopula
is returned.
- Returns:
- selected_copulaBaseBivariateCopula
The fitted copula model among the candidates that minimizes the selected information criterion (AIC or BIC).
- Raises:
- ValueError
If X is not a 2D array with exactly two columns, or if any candidate in
copula_candidates
does not inherit fromBaseBivariateCopula
.