copul.family.elliptical package

Submodules

copul.family.elliptical.elliptical_copula module

class copul.family.elliptical.elliptical_copula.EllipticalCopula(*args, **kwargs)[source]

Bases: MultivariateEllipticalCopula, BivCoreCopula

characteristic_function(t1, t2)[source]

Characteristic function of the elliptical copula.

Parameters:
  • t1 (float or sympy.Symbol) – First argument.

  • t2 (float or sympy.Symbol) – Second argument.

Returns:

Value of the characteristic function.

Return type:

sympy.Expr

Raises:

NotImplementedError – If the subclass does not define a generator function.

property corr_matrix

Return the 2×2 correlation matrix defined by \(\rho\).

Returns:

Matrix

\[\begin{split}\begin{bmatrix} 1 & \rho \\ \rho & 1 \end{bmatrix}\end{split}\]

Return type:

sympy.Matrix

generator = None
intervals: dict = {'rho': Interval(-1, 1)}
params: list = [rho]
rho = rho
t = t

copul.family.elliptical.gaussian module

class copul.family.elliptical.gaussian.Gaussian(*args, **kwargs)[source]

Bases: MultivariateGaussian, EllipticalCopula

Bivariate Gaussian copula.

Extends MultivariateGaussian for the 2-dimensional case. Characterized by a correlation parameter \(\rho \in [-1,1]\).

Special cases

  • \(\rho=-1\): Lower Fréchet bound (countermonotone)

  • \(\rho=0\): Independence

  • \(\rho=1\): Upper Fréchet bound (comonotone)

blests_nu()[source]

Compute Blest’s rank correlation ν.

Uses the copula form

ν(C) = 24 ∫_0^1 ∫_0^1 (1 - u) C(u, v) du dv - 2

which is linear in C and generally symbolic-friendly.

Returns:

The symbolic expression for Blest’s ν.

Return type:

sympy.Expr

blomqvists_beta(*args, **kwargs)[source]

Blomqvist’s \(\beta\) for the Gaussian copula.

\[\beta(\rho) = \frac{2}{\pi}\,\arcsin(\rho)\]
Return type:

float

property cdf

Compute the cumulative distribution function of the Gaussian copula.

For the bivariate case, this can use the statsmodels implementation for efficiency.

Returns:

Function that computes the CDF at given points

Return type:

callable

cdf_vectorized(u, v)[source]

Vectorized CDF for the bivariate Gaussian copula.

Evaluates \(C(u,v)\) at many points simultaneously.

Parameters:
  • u (array_like) – First uniform marginal, values in \([0,1]\).

  • v (array_like) – Second uniform marginal, values in \([0,1]\).

Returns:

CDF values at the specified points.

Return type:

numpy.ndarray

Notes

This implementation leverages the compiled backend in statsmodels. The defining relation is

\[C(u,v) \;=\; \Phi_{\rho}\!\bigl(\Phi^{-1}(u),\,\Phi^{-1}(v)\bigr),\]

where \(\Phi\) is the standard normal CDF and \(\Phi_{\rho}\) is the bivariate normal CDF with correlation \(\rho\).

chatterjees_xi(*args, **kwargs)[source]

Chatterjee’s \(\xi\) dependence measure for the Gaussian copula.

Returns:

Value of \(\xi\).

Return type:

float

cond_distr_1(u=None, v=None)[source]

First conditional distribution \(C(v\mid u)\).

Parameters:
  • u (float, optional) – Conditioning value.

  • v (float, optional) – Evaluation point.

Returns:

Wrapped conditional distribution function or value.

Return type:

SymPyFuncWrapper

cond_distr_2(u=None, v=None)[source]

Second conditional distribution \(C(u\mid v)\).

Parameters:
  • u (float, optional) – Evaluation point.

  • v (float, optional) – Conditioning value.

Returns:

Wrapped conditional distribution function or value.

Return type:

SymPyFuncWrapper

dim: int
generator = exp(-t/2)
gini_gamma(*args, **kwargs)[source]

Gini’s \(\gamma\) for the Gaussian copula.

\[\gamma(\rho) = \frac{8}{\pi}\,\arcsin(\rho/2)\]

See Nelsen (2006), Exercise 5.19.

Return type:

float

hoeffdings_d(*args, **kwargs)[source]

Hoeffding’s \(D\) for the Gaussian copula (numerical).

No simple closed form is known. Falls back to base-class numerical quadrature.

Return type:

float

kendalls_tau(*args, **kwargs)[source]

Kendall’s \(\tau\) for the Gaussian copula.

Returns:

Value of \(\tau\).

Return type:

float

lambda_L()[source]

Lower tail dependence for the Gaussian copula.

The Gaussian copula has no tail dependence for \(\rho < 1\):

\[\lambda_L = 0 \quad\text{for } \rho \in [-1, 1).\]
Returns:

Always 0 (unless \(\rho = 1\), comonotonic limit).

Return type:

float

lambda_U()[source]

Upper tail dependence for the Gaussian copula.

Same as lambda_L() — zero for \(\rho < 1\).

Return type:

float

property pdf

Probability density function of the Gaussian copula.

In the bivariate case, this uses the optimized statsmodels implementation.

Returns:

Function that computes \(c(u,v)\) at given points \((u,v)\in(0,1)^2\).

Return type:

callable

rvs(n=1, approximate=False, random_state=None, **kwargs)[source]

Generate random samples from the Gaussian copula.

For the bivariate case, a fast implementation from statsmodels is used.

Parameters:
  • n (int, default 1) – Number of samples to generate.

  • approximate (bool, default False) – If True, use the project’s generic approximating sampler.

  • random_state (int or numpy.random.Generator, optional) – Seed or generator for reproducibility.

  • **kwargs – Passed to the multivariate sampler when dim > 2.

Returns:

Array of shape \((n,2)\) with samples on \([0,1]^2\).

Return type:

numpy.ndarray

schweizer_wolff_sigma(*args, **kwargs)[source]

Schweizer–Wolff \(\sigma\) for the Gaussian copula.

The bivariate Gaussian copula is PQD when \(\rho \ge 0\) and NQD when \(\rho < 0\), so the absolute value in the definition of \(\sigma\) is redundant:

\[\sigma(\rho) = \lvert\rho_S\rvert = \frac{6}{\pi}\,\bigl|\!\arcsin(\rho/2)\bigr|\]
Return type:

float

spearmans_footrule(*args, **kwargs) float[source]

Spearman’s footrule \(F = \mathbb{E}\,\lvert U - V\rvert\) for the Gaussian copula.

Closed form:

\[F(\rho) \;=\; \tfrac{1}{2} \;-\; \frac{3}{\pi}\,\arcsin\!\Bigl(\frac{1+\rho}{2}\Bigr).\]
Returns:

Footrule distance in \([0, \tfrac12]\).

Return type:

float

spearmans_rho(*args, **kwargs)[source]

Spearman’s rank correlation \(\rho_{\!S}\) for the Gaussian copula.

Returns:

Value of \(\rho_{\!S}\).

Return type:

float

t = t
tail_order()[source]

Tail order for the Gaussian copula.

\[\kappa_L = \kappa_U = \frac{1}{1 - \rho}\]

for \(-1 \le \rho < 1\).

Return type:

dict

copul.family.elliptical.laplace module

class copul.family.elliptical.laplace.Laplace(*args, **kwargs)[source]

Bases: EllipticalCopula

Laplace copula implementation.

The Laplace copula is an elliptical copula based on the multivariate Laplace distribution. It is characterized by a correlation parameter rho in [-1, 1].

Special cases: - rho = -1: Lower Fréchet bound (countermonotonicity) - rho = 1: Upper Fréchet bound (comonotonicity)

property cdf

Compute the cumulative distribution function of the Laplace copula.

Returns:

Wrapped CDF function

Return type:

SymPyFuncWrapper

Note

This method is not yet implemented.

dim: int
property is_absolutely_continuous: bool

Check if the copula is absolutely continuous.

Returns:

True if the copula is absolutely continuous, False otherwise.

Return type:

bool

property is_symmetric: bool

Check if the copula is symmetric.

Returns:

True if the copula is symmetric, False otherwise.

Return type:

bool

property pdf

Compute the probability density function of the Laplace copula.

Returns:

Wrapped PDF function

Return type:

SymPyFuncWrapper

Note

This method is not yet implemented.

rho = rho
rvs(n=1)[source]

Generate random samples from the Laplace copula.

Parameters:

n (int) – Number of samples to generate

Returns:

Array of shape (n, 2) containing the samples

Return type:

numpy.ndarray

class copul.family.elliptical.laplace.multivariate_laplace[source]

Bases: object

Simplified multivariate_laplace implementation for Laplace copula. This is a minimal version that only includes what’s needed for the copula.

static rvs(mean=None, cov=1, size=1, random_state=None, **kwargs)[source]

Generate random samples from multivariate Laplace distribution

copul.family.elliptical.multivar_elliptical_copula module

class copul.family.elliptical.multivar_elliptical_copula.MultivariateEllipticalCopula(dimension, *args, corr_matrix=None, **kwargs)[source]

Bases: Copula

Abstract base class for multivariate elliptical copulas.

Elliptical copulas are derived from elliptical distributions and are characterized by a correlation structure. In the multivariate case, they are defined by a correlation matrix R.

abstract property cdf

Abstract method to compute the cumulative distribution function.

Must be implemented by subclasses.

Returns:

Wrapped CDF function.

Return type:

SymPyFuncWrapper

characteristic_function(t_vector)[source]

Compute the characteristic function of the elliptical copula.

Parameters:

t_vector (array_like) – Vector of arguments for the characteristic function.

Returns:

Value of the characteristic function.

Return type:

sympy.Expr

Raises:

NotImplementedError – If generator is not defined in the subclass.

property corr_matrix

Get the correlation matrix.

Returns:

Correlation matrix.

Return type:

sympy.Matrix

generator = None
abstract property is_absolutely_continuous

Check if the copula is absolutely continuous.

Returns:

True if the copula is absolutely continuous, False otherwise.

Return type:

bool

abstract property is_symmetric

Check if the copula is symmetric.

Returns:

True if the copula is symmetric, False otherwise.

Return type:

bool

params = [rho]
property params_from_matrix

Get the parameters of the copula from the correlation matrix.

For a multivariate elliptical copula, these are the off-diagonal elements of the correlation matrix.

Returns:

List of parameters (correlation values).

Return type:

list

rho = rho
t = t

copul.family.elliptical.multivar_gaussian module

class copul.family.elliptical.multivar_gaussian.MultivariateGaussian(dimension, *args, corr_matrix=None, **kwargs)[source]

Bases: MultivariateEllipticalCopula

Implementation of the multivariate Gaussian copula.

The Gaussian copula is an elliptical copula based on the multivariate normal distribution. It is characterized by a correlation matrix R.

property cdf

Compute the cumulative distribution function of the multivariate Gaussian copula.

Returns:

Function that computes the CDF at given points

Return type:

callable

cond_distr(i, u=None)[source]

Compute the conditional distribution of the i-th variable given the others.

Parameters:
  • i (int) – Index of the variable for which to compute the conditional distribution (1-based).

  • u (array_like, optional) – Values at which to evaluate the conditional distribution.

Returns:

The conditional distribution function or its value at u.

Return type:

callable or float

generator = exp(-t/2)
property is_absolutely_continuous

Check if the copula is absolutely continuous.

Returns:

Always True for the Gaussian copula.

Return type:

bool

property is_symmetric

Check if the copula is symmetric.

Returns:

Always True for the Gaussian copula.

Return type:

bool

pdf(*args, **kwargs)[source]

Compute the probability density function of the multivariate Gaussian copula.

This method supports both calling patterns: - pdf(u, v) - with separate arguments for each dimension - pdf([u, v]) - with a single list/tuple of values

Parameters:
  • *args (float or array_like) – Either separate u values or a single list/tuple of u values

  • **kwargs (dict) – Additional keyword arguments (not used)

Returns:

The PDF function or its value at the input points

Return type:

SymPyFuncWrapper or float

rvs(n=1, random_state=None, **kwargs)[source]

Generate random samples from the Gaussian copula with improved performance.

Parameters:
  • n (int) – Number of samples to generate

  • random_state (int or np.random.RandomState, optional) – Seed for random number generation

  • **kwargs – Additional keyword arguments

Returns:

Array of shape (n, dim) containing the samples

Return type:

numpy.ndarray

copul.family.elliptical.student_t module

class copul.family.elliptical.student_t.StudentT(*args, **kwargs)[source]

Bases: EllipticalCopula

Student’s t Copula implementation.

The Student’s t copula is an elliptical copula derived from the multivariate t-distribution. It is characterized by a correlation parameter rho in [-1, 1] and a degrees of freedom parameter nu > 0.

Special cases: - rho = -1: Lower Fréchet bound (countermonotonicity) - rho = 1: Upper Fréchet bound (comonotonicity) - nu → ∞: Approaches the Gaussian copula

blomqvists_beta(*args, **kwargs)[source]

Blomqvist’s \(\beta\) for the Student-t copula.

\[\beta = \frac{2}{\pi}\,\arcsin(\rho)\]

(same formula as the Gaussian copula).

Return type:

float

property cdf

Compute the cumulative distribution function of the Student’s t copula.

Returns:

Function that computes the CDF at given points

Return type:

callable

cond_distr_1(u=None, v=None)[source]

Compute the first conditional distribution C(v|u).

Parameters:
  • u (float, optional) – Conditioning value

  • v (float, optional) – Value at which to evaluate

Returns:

Wrapped conditional distribution function or value

Return type:

CD1Wrapper

cond_distr_2(u=None, v=None)[source]

Compute the second conditional distribution C(u|v).

Parameters:
  • u (float, optional) – Value at which to evaluate

  • v (float, optional) – Conditioning value

Returns:

Wrapped conditional distribution function or value

Return type:

CD2Wrapper

dim: int
gamma_function = gamma(nu/2)
intervals: dict = {'nu': Interval.open(0, oo), 'rho': Interval(-1, 1)}
property is_absolutely_continuous: bool

Check if the copula is absolutely continuous.

Returns:

True if the copula is absolutely continuous, False otherwise.

Return type:

bool

property is_symmetric: bool

Check if the copula is symmetric.

Returns:

True if the copula is symmetric, False otherwise.

Return type:

bool

kendalls_tau(*args, **kwargs)[source]

Kendall’s \(\tau\) for the Student-t copula.

\[\tau = \frac{2}{\pi}\,\arcsin(\rho)\]

(same formula as the Gaussian copula — independent of \(\nu\)).

Return type:

float

lambda_L()[source]

Lower tail dependence coefficient for the Student-t copula.

\[\lambda_L = 2\,t_{\nu+1}\!\left( -\sqrt{\frac{(\nu+1)(1-\rho)}{1+\rho}} \right)\]

where \(t_{\nu+1}\) is the CDF of the univariate Student-t distribution with \(\nu + 1\) degrees of freedom.

Returns:

Lower tail dependence coefficient in \([0, 1]\).

Return type:

float

References

Demarta & McNeil (2005), The t Copula and Related Copulas, International Statistical Review 73(1), 111–129.

lambda_U()[source]

Upper tail dependence coefficient for the Student-t copula.

The Student-t copula is radially symmetric, so \(\lambda_U = \lambda_L\).

Returns:

Upper tail dependence coefficient in \([0, 1]\).

Return type:

float

modified_bessel_function = K(nu)
nu = nu
params: list = [rho, nu]
property pdf

Compute the probability density function of the Student’s t copula.

Returns:

Function that computes the PDF at given points

Return type:

callable

rho = rho
rvs(n=1, **kwargs)[source]

Generate random samples from the Student’s t copula.

Parameters:

n (int) – Number of samples to generate

Returns:

Array of shape (n, 2) containing the samples

Return type:

numpy.ndarray

spearmans_rho(*args, **kwargs)[source]

Spearman’s \(\rho_S\) for the Student-t copula.

\[\rho_S = \frac{6}{\pi}\,\arcsin\!\left(\frac{\rho}{2}\right)\]

(same formula as the Gaussian copula — independent of \(\nu\)).

Return type:

float

tail_dependence_function(t, lower=True)[source]

Evaluate the tail dependence function at \(t \in [0,1]\).

For the Student-t copula:

\[b_L(t) = (1-t)\,t_{\nu+1}\!\left( -\sqrt{\frac{(\nu+1)(1 - \rho_{t})}{1 + \rho_{t}}} \right) + t\,t_{\nu+1}\!\left( -\sqrt{\frac{(\nu+1)(1 - \tilde\rho_{t})}{1 + \tilde\rho_{t}}} \right)\]

where the mixed-quantile correlations involve the parameter. The simple diagonal case is \(b_L(1/2) = \lambda_L / 2\).

Parameters:
  • t (float or array_like) – Point(s) in \([0, 1]\).

  • lower (bool) – If True, evaluate the lower TDF. If False, upper TDF.

Return type:

float or numpy.ndarray

Module contents

class copul.family.elliptical.Gaussian(*args, **kwargs)[source]

Bases: MultivariateGaussian, EllipticalCopula

Bivariate Gaussian copula.

Extends MultivariateGaussian for the 2-dimensional case. Characterized by a correlation parameter \(\rho \in [-1,1]\).

Special cases

  • \(\rho=-1\): Lower Fréchet bound (countermonotone)

  • \(\rho=0\): Independence

  • \(\rho=1\): Upper Fréchet bound (comonotone)

blests_nu()[source]

Compute Blest’s rank correlation ν.

Uses the copula form

ν(C) = 24 ∫_0^1 ∫_0^1 (1 - u) C(u, v) du dv - 2

which is linear in C and generally symbolic-friendly.

Returns:

The symbolic expression for Blest’s ν.

Return type:

sympy.Expr

blomqvists_beta(*args, **kwargs)[source]

Blomqvist’s \(\beta\) for the Gaussian copula.

\[\beta(\rho) = \frac{2}{\pi}\,\arcsin(\rho)\]
Return type:

float

property cdf

Compute the cumulative distribution function of the Gaussian copula.

For the bivariate case, this can use the statsmodels implementation for efficiency.

Returns:

Function that computes the CDF at given points

Return type:

callable

cdf_vectorized(u, v)[source]

Vectorized CDF for the bivariate Gaussian copula.

Evaluates \(C(u,v)\) at many points simultaneously.

Parameters:
  • u (array_like) – First uniform marginal, values in \([0,1]\).

  • v (array_like) – Second uniform marginal, values in \([0,1]\).

Returns:

CDF values at the specified points.

Return type:

numpy.ndarray

Notes

This implementation leverages the compiled backend in statsmodels. The defining relation is

\[C(u,v) \;=\; \Phi_{\rho}\!\bigl(\Phi^{-1}(u),\,\Phi^{-1}(v)\bigr),\]

where \(\Phi\) is the standard normal CDF and \(\Phi_{\rho}\) is the bivariate normal CDF with correlation \(\rho\).

chatterjees_xi(*args, **kwargs)[source]

Chatterjee’s \(\xi\) dependence measure for the Gaussian copula.

Returns:

Value of \(\xi\).

Return type:

float

cond_distr_1(u=None, v=None)[source]

First conditional distribution \(C(v\mid u)\).

Parameters:
  • u (float, optional) – Conditioning value.

  • v (float, optional) – Evaluation point.

Returns:

Wrapped conditional distribution function or value.

Return type:

SymPyFuncWrapper

cond_distr_2(u=None, v=None)[source]

Second conditional distribution \(C(u\mid v)\).

Parameters:
  • u (float, optional) – Evaluation point.

  • v (float, optional) – Conditioning value.

Returns:

Wrapped conditional distribution function or value.

Return type:

SymPyFuncWrapper

dim: int
generator = exp(-t/2)
gini_gamma(*args, **kwargs)[source]

Gini’s \(\gamma\) for the Gaussian copula.

\[\gamma(\rho) = \frac{8}{\pi}\,\arcsin(\rho/2)\]

See Nelsen (2006), Exercise 5.19.

Return type:

float

hoeffdings_d(*args, **kwargs)[source]

Hoeffding’s \(D\) for the Gaussian copula (numerical).

No simple closed form is known. Falls back to base-class numerical quadrature.

Return type:

float

kendalls_tau(*args, **kwargs)[source]

Kendall’s \(\tau\) for the Gaussian copula.

Returns:

Value of \(\tau\).

Return type:

float

lambda_L()[source]

Lower tail dependence for the Gaussian copula.

The Gaussian copula has no tail dependence for \(\rho < 1\):

\[\lambda_L = 0 \quad\text{for } \rho \in [-1, 1).\]
Returns:

Always 0 (unless \(\rho = 1\), comonotonic limit).

Return type:

float

lambda_U()[source]

Upper tail dependence for the Gaussian copula.

Same as lambda_L() — zero for \(\rho < 1\).

Return type:

float

property pdf

Probability density function of the Gaussian copula.

In the bivariate case, this uses the optimized statsmodels implementation.

Returns:

Function that computes \(c(u,v)\) at given points \((u,v)\in(0,1)^2\).

Return type:

callable

rvs(n=1, approximate=False, random_state=None, **kwargs)[source]

Generate random samples from the Gaussian copula.

For the bivariate case, a fast implementation from statsmodels is used.

Parameters:
  • n (int, default 1) – Number of samples to generate.

  • approximate (bool, default False) – If True, use the project’s generic approximating sampler.

  • random_state (int or numpy.random.Generator, optional) – Seed or generator for reproducibility.

  • **kwargs – Passed to the multivariate sampler when dim > 2.

Returns:

Array of shape \((n,2)\) with samples on \([0,1]^2\).

Return type:

numpy.ndarray

schweizer_wolff_sigma(*args, **kwargs)[source]

Schweizer–Wolff \(\sigma\) for the Gaussian copula.

The bivariate Gaussian copula is PQD when \(\rho \ge 0\) and NQD when \(\rho < 0\), so the absolute value in the definition of \(\sigma\) is redundant:

\[\sigma(\rho) = \lvert\rho_S\rvert = \frac{6}{\pi}\,\bigl|\!\arcsin(\rho/2)\bigr|\]
Return type:

float

spearmans_footrule(*args, **kwargs) float[source]

Spearman’s footrule \(F = \mathbb{E}\,\lvert U - V\rvert\) for the Gaussian copula.

Closed form:

\[F(\rho) \;=\; \tfrac{1}{2} \;-\; \frac{3}{\pi}\,\arcsin\!\Bigl(\frac{1+\rho}{2}\Bigr).\]
Returns:

Footrule distance in \([0, \tfrac12]\).

Return type:

float

spearmans_rho(*args, **kwargs)[source]

Spearman’s rank correlation \(\rho_{\!S}\) for the Gaussian copula.

Returns:

Value of \(\rho_{\!S}\).

Return type:

float

t = t
tail_order()[source]

Tail order for the Gaussian copula.

\[\kappa_L = \kappa_U = \frac{1}{1 - \rho}\]

for \(-1 \le \rho < 1\).

Return type:

dict

class copul.family.elliptical.Laplace(*args, **kwargs)[source]

Bases: EllipticalCopula

Laplace copula implementation.

The Laplace copula is an elliptical copula based on the multivariate Laplace distribution. It is characterized by a correlation parameter rho in [-1, 1].

Special cases: - rho = -1: Lower Fréchet bound (countermonotonicity) - rho = 1: Upper Fréchet bound (comonotonicity)

property cdf

Compute the cumulative distribution function of the Laplace copula.

Returns:

Wrapped CDF function

Return type:

SymPyFuncWrapper

Note

This method is not yet implemented.

dim: int
property is_absolutely_continuous: bool

Check if the copula is absolutely continuous.

Returns:

True if the copula is absolutely continuous, False otherwise.

Return type:

bool

property is_symmetric: bool

Check if the copula is symmetric.

Returns:

True if the copula is symmetric, False otherwise.

Return type:

bool

property pdf

Compute the probability density function of the Laplace copula.

Returns:

Wrapped PDF function

Return type:

SymPyFuncWrapper

Note

This method is not yet implemented.

rho = rho
rvs(n=1)[source]

Generate random samples from the Laplace copula.

Parameters:

n (int) – Number of samples to generate

Returns:

Array of shape (n, 2) containing the samples

Return type:

numpy.ndarray

class copul.family.elliptical.StudentT(*args, **kwargs)[source]

Bases: EllipticalCopula

Student’s t Copula implementation.

The Student’s t copula is an elliptical copula derived from the multivariate t-distribution. It is characterized by a correlation parameter rho in [-1, 1] and a degrees of freedom parameter nu > 0.

Special cases: - rho = -1: Lower Fréchet bound (countermonotonicity) - rho = 1: Upper Fréchet bound (comonotonicity) - nu → ∞: Approaches the Gaussian copula

blomqvists_beta(*args, **kwargs)[source]

Blomqvist’s \(\beta\) for the Student-t copula.

\[\beta = \frac{2}{\pi}\,\arcsin(\rho)\]

(same formula as the Gaussian copula).

Return type:

float

property cdf

Compute the cumulative distribution function of the Student’s t copula.

Returns:

Function that computes the CDF at given points

Return type:

callable

cond_distr_1(u=None, v=None)[source]

Compute the first conditional distribution C(v|u).

Parameters:
  • u (float, optional) – Conditioning value

  • v (float, optional) – Value at which to evaluate

Returns:

Wrapped conditional distribution function or value

Return type:

CD1Wrapper

cond_distr_2(u=None, v=None)[source]

Compute the second conditional distribution C(u|v).

Parameters:
  • u (float, optional) – Value at which to evaluate

  • v (float, optional) – Conditioning value

Returns:

Wrapped conditional distribution function or value

Return type:

CD2Wrapper

dim: int
gamma_function = gamma(nu/2)
intervals: dict = {'nu': Interval.open(0, oo), 'rho': Interval(-1, 1)}
property is_absolutely_continuous: bool

Check if the copula is absolutely continuous.

Returns:

True if the copula is absolutely continuous, False otherwise.

Return type:

bool

property is_symmetric: bool

Check if the copula is symmetric.

Returns:

True if the copula is symmetric, False otherwise.

Return type:

bool

kendalls_tau(*args, **kwargs)[source]

Kendall’s \(\tau\) for the Student-t copula.

\[\tau = \frac{2}{\pi}\,\arcsin(\rho)\]

(same formula as the Gaussian copula — independent of \(\nu\)).

Return type:

float

lambda_L()[source]

Lower tail dependence coefficient for the Student-t copula.

\[\lambda_L = 2\,t_{\nu+1}\!\left( -\sqrt{\frac{(\nu+1)(1-\rho)}{1+\rho}} \right)\]

where \(t_{\nu+1}\) is the CDF of the univariate Student-t distribution with \(\nu + 1\) degrees of freedom.

Returns:

Lower tail dependence coefficient in \([0, 1]\).

Return type:

float

References

Demarta & McNeil (2005), The t Copula and Related Copulas, International Statistical Review 73(1), 111–129.

lambda_U()[source]

Upper tail dependence coefficient for the Student-t copula.

The Student-t copula is radially symmetric, so \(\lambda_U = \lambda_L\).

Returns:

Upper tail dependence coefficient in \([0, 1]\).

Return type:

float

modified_bessel_function = K(nu)
nu = nu
params: list = [rho, nu]
property pdf

Compute the probability density function of the Student’s t copula.

Returns:

Function that computes the PDF at given points

Return type:

callable

rho = rho
rvs(n=1, **kwargs)[source]

Generate random samples from the Student’s t copula.

Parameters:

n (int) – Number of samples to generate

Returns:

Array of shape (n, 2) containing the samples

Return type:

numpy.ndarray

spearmans_rho(*args, **kwargs)[source]

Spearman’s \(\rho_S\) for the Student-t copula.

\[\rho_S = \frac{6}{\pi}\,\arcsin\!\left(\frac{\rho}{2}\right)\]

(same formula as the Gaussian copula — independent of \(\nu\)).

Return type:

float

tail_dependence_function(t, lower=True)[source]

Evaluate the tail dependence function at \(t \in [0,1]\).

For the Student-t copula:

\[b_L(t) = (1-t)\,t_{\nu+1}\!\left( -\sqrt{\frac{(\nu+1)(1 - \rho_{t})}{1 + \rho_{t}}} \right) + t\,t_{\nu+1}\!\left( -\sqrt{\frac{(\nu+1)(1 - \tilde\rho_{t})}{1 + \tilde\rho_{t}}} \right)\]

where the mixed-quantile correlations involve the parameter. The simple diagonal case is \(b_L(1/2) = \lambda_L / 2\).

Parameters:
  • t (float or array_like) – Point(s) in \([0, 1]\).

  • lower (bool) – If True, evaluate the lower TDF. If False, upper TDF.

Return type:

float or numpy.ndarray