Skip to main content

Frank

Frank(
    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 Clayton Copula Estimation. The Clayton copula is an Archimedean copula characterized by strong lower tail dependence and little to no upper tail dependence. In its unrotated form, it is used for modeling extreme co-movements in the lower tail (i.e. simultaneous extreme losses). Rotations allow the copula to be adapted for different types of tail dependence:
  • A 180 rotation captures extreme co-movements in the upper tail (i.e. simultaneous extreme gains).
  • A 90 rotation captures scenarios where one variable exhibits extreme gains while the other shows extreme losses.
  • A 270 rotation captures the opposite scenario, where one variable experiences extreme losses while the other suffers extreme gains.
The Frank copula is a widely used copula in statistics and finance for modeling dependencies between random variables. The Frank copula captures symmetric dependence and is particularly useful when there is no tail dependence.
  1. Symmetric Dependency : The Frank copula is suitable for datasets where dependency between variables is symmetric and without tail dependence.
  2. Modeling Joint Distributions : Used in scenarios where the relationship between random variables is non-linear but consistent across their range.
  3. Risk Management and Finance : It can model dependencies between financial assets, insurance claims, or other risk variables with moderate dependencies.
Rotations are needed for Archimedean copulas (e.g., Joe, Gumbel, Clayton) because their parameters only model positive dependence, and they exhibit asymmetric tail behavior. To model negative dependence, one uses rotations to “flip” the copula’s tail dependence. Method generated by attrs for class Frank.

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.

Methods

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.
Raises:
TypeDescription
AssertionErrorFrank dependence (theta) must not be 0.

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 density.
Raises:
TypeDescription
AssertionErrorFrank dependence (theta) must not be 0.

arbitrage

arbitrage(
    self,
    ui: float,
    vi: float,
) ‑> Tuple[floatfloat]
Compute the h-function (partial derivative) for the bivariate Frank 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.
Raises:
TypeDescription
AssertionErrorFrank dependence (theta) must not be 0.

partial_derivative

partial_derivative(
    self,
    u: numpy.ndarray,
    v: numpy.ndarray,
) ‑> numpy.ndarray
Compute the h-function (partial derivative) for the bivariate Frank 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.
AssertionErrorFrank dependence (theta) must not be 0.

score

score(
    self,
    u: numpy.ndarray,
    v: numpy.ndarray,
    best_fit: bool = False,
) ‑> 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.
best_fitboolFalseApply best fitted rotation. Defaults to False.
Returns:
TypeDescription
tp.Array1dThe log-likelihood score of each sample under the fitted copula.
Raises:
TypeDescription
AssertionErroru and v must have the same shape.
AssertionErrorFrank dependence (theta) must not be 0.