<a id="skfolio-distribution-select-bivariate-copula"></a>

# skfolio.distribution.select_bivariate_copula

<a id="skfolio.distribution.select_bivariate_copula"></a>

### skfolio.distribution.select_bivariate_copula(X, copula_candidates=None, selection_criterion=AIC, independence_level=0.05)

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 the
`IndependentCopula` is returned. Otherwise, each candidate copula in
`copula_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:**
  **X** *array-like of shape (n_observations, 2)*
  : An array of bivariate inputs (u, v) with uniform marginals (values in [0, 1]).

  **copula_candidates** *list[BaseBivariateCopula]*
  : A list of candidate copula models. Each candidate must inherit from
    `BaseBivariateCopula`. If None, defaults to
    `[GaussianCopula(), StudentTCopula(), ClaytonCopula(), GumbelCopula(), JoeCopula()]`.

  **selection_criterion** *SelectionCriterion, default=SelectionCriterion.AIC*
  : The criterion used for model selection. Possible values are:
    : - SelectionCriterion.AIC : Akaike Information Criterion
      - SelectionCriterion.BIC : Bayesian Information Criterion

  **independence_level** *float, 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_copula** *BaseBivariateCopula*
  : 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 from `BaseBivariateCopula`.

