pystra.dependence.copula.StudentTCopula#
Use it: User guide · Worked example · Theory
- class StudentTCopula(correlation, df)[source]#
Bases:
GaussianCopulaStudent-t copula with latent shape R and positive degrees of freedom.
Identity R does not imply independence: coordinates share a random scale. The shape is not a physical Pearson correlation matrix. df need not exceed two, since arbitrary physical marginals can have finite moments regardless of the latent t representative’s moments.
- Parameters:
correlation (
ArrayLike) – Finite symmetric positive-definite latent shape with unit diagonal.df (
float) – Finite positive degrees of freedom of the latent Student-t law.
Methods
Evaluate the copula CDF, including unit-cube boundaries.
Construct from rank correlations, validating the resulting shape.
Map independent conditional uniforms to dependent marginals.
Evaluate log density at interior uniform coordinates.
Evaluate the copula density at interior uniform coordinates.
Map dependent uniforms to independent conditional uniforms.
Sample rows using a local NumPy random generator.
- logpdf(probabilities)[source]#
Evaluate log density at interior uniform coordinates.
- Parameters:
probabilities (
ArrayLike) – Marginal probabilities strictly between zero and one, in original order.- Returns:
Log density for one point or one value per row of points.
- Return type:
float|ndarray
- cdf(probabilities, **kwargs)[source]#
Evaluate the copula CDF, including unit-cube boundaries.
- Parameters:
probabilities (
ArrayLike) – Marginal probabilities in [0, 1], in original order.**kwargs (
Any) – Keyword arguments forwarded to SciPy’s multivariate CDF integration.
- Returns:
Cumulative probability for one point or one value per row of points.
- Return type:
float|ndarray
- rosenblatt(probabilities, order=None)[source]#
Map dependent uniforms to independent conditional uniforms.
- Parameters:
probabilities (
ArrayLike) – Interior uniform marginal coordinates in original order.order (
Sequence[int] |ndarray|None) – Conditioning permutation; the default is original marginal order.
- Returns:
Conditional uniforms with the input shape. Column
order[k]holds the k-th conditional innovation, so original column labels are retained.- Return type:
ndarray- Raises:
ValueError – If coordinates, conditioning order or computed probabilities are invalid.
- inverse_rosenblatt(probabilities, order=None)[source]#
Map independent conditional uniforms to dependent marginals.
- Parameters:
probabilities (
ArrayLike) – Interior independent uniforms in original column positions.order (
Sequence[int] |ndarray|None) – Conditioning permutation used byrosenblatt().
- Returns:
Dependent uniform marginal coordinates, with the input shape and order.
- Return type:
ndarray
- property correlation: ndarray#
Copy of the latent correlation (shape matrix for Student-t).
- classmethod from_kendall_tau(tau, **kwargs)#
Construct from rank correlations, validating the resulting shape.
- Parameters:
tau (
ArrayLike) – Finite Kendall rank correlations in [-1, 1]. The transformed latent matrix must be symmetric positive definite with a unit diagonal.**kwargs (
Any) – Additional subclass constructor arguments, such asdfforStudentTCopula.
- Returns:
An instance of the class on which this method was called.
- Return type:
Self
- property kendall_tau: ndarray#
Pairwise Kendall rank correlation implied by this elliptical copula.
- pdf(probabilities)#
Evaluate the copula density at interior uniform coordinates.
- Parameters:
probabilities (
ArrayLike) – Marginal probabilities strictly between zero and one, in original order.- Returns:
Density for one point or one value per row of points.
- Return type:
float|ndarray- Raises:
ValueError – If the coordinates have an invalid shape or lie outside the interior.
- rvs(size=1, seed=None)#
Sample rows using a local NumPy random generator.
- Parameters:
size (
int) – Nonnegative number of observations.seed (
int|integer|Sequence[int] |ndarray|SeedSequence|BitGenerator|Generator|None) – Input tonumpy.random.default_rng. A supplied generator is reused and advances; other seeds construct a local generator.
- Returns:
Uniform marginal coordinates with this copula’s dependence.
- Return type:
ndarray