Skip to main content

StudentT

StudentT(
    kendall_tau: float,
    rotation: str | systematica.models.arbitrage_index.utils.BaseCopulaRotation = BaseCopulaRotation.R0,
    start: float = 0.001,
    stop: float = 0.999,
    num: int = 100,
)
Bivariate Student’s t copula estimator. The copula is defined as C_(u, v) = T_(t_v^(u), t_v^(v)), where t_v^ is the univariate t-quantile and T_ is the bivariate t CDF. For numerical stability we constrain the degrees of freedom v to [2, 50]: values below 2 produce extremely heavy tails, while values above 50 are effectively Gaussian. Notes: rho: Fitted correlation parameter (in (-1, 1)). ddof: Fitted degrees of freedom (in [2, 50]). See Also: Elliptical copulas (Gaussian, Student-t) are symmetric and do not require rotation variants. Method generated by attrs for class StudentT.

Ancestors

  • systematica.models.arbitrage_index.base.BaseCopula
  • abc.ABC

Instance variables

  • lower_tail_dependence: float: Theoretical lower tail dependence coefficient.
  • upper_tail_dependence: float: Theoretical upper tail dependence coefficient.
  • ddof: float: Degree of freedom. If set to auto, applies best fitted degree of freedom. Defaults to auto.
  • ddof_: float: Best fitted degree of freedom applied to the copula model.

Methods

set_ddof

set_ddof(
    self,
    u: numpy.ndarray,
    v: numpy.ndarray,
) ‑> float
Set degree of freedom. Returns:
TypeDescription
floatDegree of freedom value.
Raises:
TypeDescription
AssertionErrorDegree of freedom must be between 1 and 50.

density

density(
    self,
    u: numpy.ndarray,
    v: numpy.ndarray,
) ‑> numpy.ndarray
Calculate log probability density of the bivariate copula: P(U=u,V=v)P(U=u, V=v). Parameters:
NameTypeDefaultDescription
utp.Array1d--First uniform marginal.
vtp.Array1d--Second uniform marginal.
Returns:
TypeDescription
tp.Array1dLog probability density.

cumulative_density

cumulative_density(
    self,
    u: numpy.ndarray,
    v: numpy.ndarray,
) ‑> numpy.ndarray
Calculate cumulative density of the bivariate copula: P(U<=u,V<=v)P(U<=u, V<=v). Parameters:
NameTypeDefaultDescription
utp.Array1d--First uniform marginal.
vtp.Array1d--Second uniform marginal.
Returns:
TypeDescription
tp.Array1dCumulative probability density.

arbitrage

arbitrage(
    self,
    ui: float,
    vi: float,
) ‑> Tuple[floatfloat]
Compute the h-function (partial derivative) for the bivariate Clayton copula, a.k.a. the mispricing index, for every time step in the trading period using the estimated copula. Parameters:
NameTypeDefaultDescription
uifloat--The first component of the bivariate input.
vifloat--The second component of the bivariate input.
Returns:
TypeDescription
tp.Tuple[float, float]:The mispricing indices for the copula, a.k.a. arbitrage.

partial_derivative

partial_derivative(
    self,
    u: numpy.ndarray,
    v: numpy.ndarray,
) ‑> numpy.ndarray
Compute the h-function (partial derivative) for the bivariate Clayton copula, a.k.a. the mispricing index, for every time step in the trading period using the estimated copula. Parameters:
NameTypeDefaultDescription
utp.Array1d--The first component of the bivariate input.
vtp.Array1d--The second component of the bivariate input.
Returns:
TypeDescription
tp.Array2dThe mispricing indices for the copula, a.k.a. arbitrage.
Raises:
TypeDescription
AssertionErroru and v must have the same shape.

score

score(
    self,
    u: numpy.ndarray,
    v: numpy.ndarray,
) ‑> numpy.ndarray
Compute the log-likelihood score of each sample (log-pdf) under the model.
u and v are bivariate inputs (u, v) where each row represents a bivariate observation. Both u and v must be in the interval [0, 1], having been transformed to uniform marginals.
Parameters:
NameTypeDefaultDescription
utp.Array1d--The first component of the bivariate input.
vtp.Array1d--The second component of the bivariate input.
Returns:
TypeDescription
tp.Array1dThe log-likelihood score of each sample under the fitted copula.
Raises:
TypeDescription
AssertionErroru and v must have the same shape.