> ## Documentation Index
> Fetch the complete documentation index at: https://systematica.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Student T

> systematica.models.arbitrage_index.student_t

## `StudentT`

```python theme={null}
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\_{v,   au}(u, v) = T\_{v,       au}(t\_v^{-1}(u), t\_v^{-1}(v)),
where t\_v^{-1} is the univariate t-quantile and T\_{v,       au} 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`

```python theme={null}
set_ddof(
    self,
    u: numpy.ndarray,
    v: numpy.ndarray,
) ‑> float
```

Set degree of freedom.

**Returns**:

| Type    | Description              |
| ------- | ------------------------ |
| `float` | Degree of freedom value. |

**Raises**:

| Type             | Description                                 |
| ---------------- | ------------------------------------------- |
| `AssertionError` | Degree of freedom must be between 1 and 50. |

#### `density`

```python theme={null}
density(
    self,
    u: numpy.ndarray,
    v: numpy.ndarray,
) ‑> numpy.ndarray
```

Calculate log probability density of the bivariate copula: $P(U=u, V=v)$.

**Parameters**:

| Name | Type         | Default | Description              |
| ---- | ------------ | ------- | ------------------------ |
| `u`  | `tp.Array1d` | `--`    | First uniform marginal.  |
| `v`  | `tp.Array1d` | `--`    | Second uniform marginal. |

**Returns**:

| Type         | Description              |
| ------------ | ------------------------ |
| `tp.Array1d` | Log probability density. |

#### `cumulative_density`

```python theme={null}
cumulative_density(
    self,
    u: numpy.ndarray,
    v: numpy.ndarray,
) ‑> numpy.ndarray
```

Calculate cumulative density of the bivariate copula: $P(U<=u, V<=v)$.

**Parameters**:

| Name | Type         | Default | Description              |
| ---- | ------------ | ------- | ------------------------ |
| `u`  | `tp.Array1d` | `--`    | First uniform marginal.  |
| `v`  | `tp.Array1d` | `--`    | Second uniform marginal. |

**Returns**:

| Type         | Description                     |
| ------------ | ------------------------------- |
| `tp.Array1d` | Cumulative probability density. |

#### `arbitrage`

```python theme={null}
arbitrage(
    self,
    ui: float,
    vi: float,
) ‑> Tuple[float, float]
```

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**:

| Name | Type    | Default | Description                                  |
| ---- | ------- | ------- | -------------------------------------------- |
| `ui` | `float` | `--`    | The first component of the bivariate input.  |
| `vi` | `float` | `--`    | The second component of the bivariate input. |

**Returns**:

| Type                      | Description                                              |
| ------------------------- | -------------------------------------------------------- |
| `tp.Tuple[float, float]:` | The mispricing indices for the copula, a.k.a. arbitrage. |

#### `partial_derivative`

```python theme={null}
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**:

| Name | Type         | Default | Description                                  |
| ---- | ------------ | ------- | -------------------------------------------- |
| `u`  | `tp.Array1d` | `--`    | The first component of the bivariate input.  |
| `v`  | `tp.Array1d` | `--`    | The second component of the bivariate input. |

**Returns**:

| Type         | Description                                              |
| ------------ | -------------------------------------------------------- |
| `tp.Array2d` | The mispricing indices for the copula, a.k.a. arbitrage. |

**Raises**:

| Type             | Description                       |
| ---------------- | --------------------------------- |
| `AssertionError` | u and v must have the same shape. |

#### `score`

```python theme={null}
score(
    self,
    u: numpy.ndarray,
    v: numpy.ndarray,
) ‑> numpy.ndarray
```

Compute the log-likelihood score of each sample (log-pdf) under the
model.

<Note>
  `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.
</Note>

**Parameters**:

| Name | Type         | Default | Description                                  |
| ---- | ------------ | ------- | -------------------------------------------- |
| `u`  | `tp.Array1d` | `--`    | The first component of the bivariate input.  |
| `v`  | `tp.Array1d` | `--`    | The second component of the bivariate input. |

**Returns**:

| Type         | Description                                                      |
| ------------ | ---------------------------------------------------------------- |
| `tp.Array1d` | The log-likelihood score of each sample under the fitted copula. |

**Raises**:

| Type             | Description                       |
| ---------------- | --------------------------------- |
| `AssertionError` | u and v must have the same shape. |
