copulaFitStudent
First introduced in version 3.00.6
Syntax
copulaFitStudent(X, [method='ML'], [alpha=0.05])
Details
Fits a Student's t Copula and estimates the correlation matrix rho and the degrees of freedom nu.
The t Copula captures fat-tailed dependence and symmetric upper- and lower-tail dependence, making it suitable for extreme-risk modeling. As nu approaches infinity, the t Copula degenerates to the Gaussian Copula.
Parameters
X is a non-empty two-dimensional numeric matrix or table with dimensions n×p (p ≥ 2), specifying the input data.
- All elements must be finite and strictly within the open interval
(0, 1). - The sample size must satisfy
n >= max(10, 2*p + 1), and no column may be constant or nearly constant.
method (optional) is a STRING scalar, default 'ML'. It specifies the fitting method: 'ML' for standard maximum likelihood; 'ApproximateML' for approximate maximum likelihood.
alpha (optional) is a DOUBLE scalar, default 0.05. Significance level for the confidence interval, in the range (0, 1).
Returns
Returns a dictionary with the following key-value pairs:
- rho: A matrix indicating the estimated p×p linear correlation matrix.
- nu: A DOUBLE scalar indicating the estimated degrees of freedom.
- nuCI: A DOUBLE vector indicating the confidence interval for nu: [lower, upper].
- logLikelihood: A DOUBLE scalar indicating the log-likelihood value.
- converged: A BOOL scalar indicating whether the optimizer converged.
Examples
Note: The outputs in the following examples are for illustration only. Actual results may vary.
Example 1. Generate t Copula data with rho=0.7 and nu=5 (1000 samples), fit with default parameters, and verify whether the estimated rho and nu are close to the true values.
X = copulaRandStudent(0.7, 5, 1000)
res = copulaFitStudent(X)
res.nu
// Output: 5.226848
res.nuCI
// Output: [3.115844,7.337852]
res.logLikelihood
// Output: 323.207189
res.rho
| #0 | #1 |
|---|---|
| 1 | 0.695732 |
| 0.695732 | 1 |
Example 2. Generate a larger fat-tailed sample (5000 observations), fit using approximate maximum likelihood (ApproximateML) with a 99% confidence interval (alpha=0.01), and observe how nuCI changes compared to the default settings.
// Generate a larger fat-tailed sample to avoid an empty nuCI under ApproximateML.
Xlarge = copulaRandStudent(0.7, 5, 5000)
res2 = copulaFitStudent(Xlarge, method='ApproximateML', alpha=0.01)
res2.nu
// Output: 5.226868
res2.nuCI
// Output: [3.551869,6.901868]
res2.logLikelihood
// Output: 1780.580361
res2.rho
| #0 | #1 |
|---|---|
| 1 | 0.700865 |
| 0.700865 | 1 |
Example 3. Generate data with a lower degrees of freedom (nu=4) for heavier tails (2000 samples) and verify whether the model accurately captures stronger tail dependence.
Xtail = copulaRandStudent(0.6, 4, 2000)
resTail = copulaFitStudent(Xtail)
resTail.nu
// Output: 4.113908
resTail.nuCI
// Output: [3.089262,5.138554]
resTail.logLikelihood
// Output: 497.719249
resTail.rho
| #0 | #1 |
|---|---|
| 1 | 0.608286 |
| 0.608286 | 1 |
Example 4. Generate fat-tailed pseudo-observations using a t Copula, fit a t Copula using a table as input, and evaluate the fat-tail risk of simultaneous extreme movements in two stocks.
// Generate fat-tailed pseudo-observations using a t Copula to avoid the degrees-of-freedom estimate degenerating to the upper bound.
X = copulaRandStudent(0.6, 5, 1000)
stockReturns = table(X[0] as stockA, X[1] as stockB)
res = copulaFitStudent(stockReturns)
res.nu
// Output: 6.092823
res.nuCI
// Output: [3.293553,8.892092]
res.logLikelihood
// Output: 226.861833
res.rho
| #0 | #1 |
|---|---|
| 1 | 0.596924 |
| 0.596924 | 1 |
Related functions: copulaFitGaussian, copulaFitClayton, copulaFitFrank, copulaFitGumbel,
