copulaFitClayton
First introduced in version 3.00.6
Syntax
copulaFitClayton(X, [alpha=0.05])
Details
Fits a Clayton Copula and estimates the shape parameter alpha. This function only supports two-dimensional input and does not support negative dependence.
Clayton Copula exhibits lower tail dependence and is used to model joint extreme movements in the lower quantile region.
Parameters
X is a non-empty two-dimensional numeric matrix or table with dimensions n×2. All elements must be finite and strictly within (0, 1), and no column can be constant or nearly constant.
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:
- alpha: A DOUBLE scalar indicating the estimated shape parameter θ. Note: Here, alpha refers to the shape parameter, which is different from the function parameter alpha representing the significance level.
- alphaCI: A DOUBLE vector indicating the confidence interval for the parameter: [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 Clayton Copula data with shape parameter θ=2.0 and fit the model to verify estimation accuracy.
X = copulaRandClayton(2.0, 1000)
res = copulaFitClayton(X)
res.alpha
// Output: 2.133319
res.alphaCI
// Output: [1.955293,2.311346]
res.logLikelihood
// Output: 424.681917
res.converged
// Output: true
Example 2. Generate strongly lower-tail dependent data with shape parameter θ=5.0 (2000 samples) and fit a Clayton Copula to evaluate estimation performance under high-dependence scenarios.
Xstrong = copulaRandClayton(5.0, 2000)
resStrong = copulaFitClayton(Xstrong)
resStrong.alpha
// Output: 5.111007
resStrong.alphaCI
// Output: [4.876373,5.345640]
resStrong.logLikelihood
// Output: 1953.578222
resStrong.converged
// Output: true
Example 3. Generate weakly dependent data with shape parameter θ=0.2 (near independence) and fit a Clayton Copula to evaluate model performance under low-dependence scenarios.
Xweak = copulaRandClayton(0.2, 2000)
resWeak = copulaFitClayton(Xweak)
resWeak.alpha
// Output: 0.205467
resWeak.alphaCI
// Output: [0.146262,0.264672]
resWeak.logLikelihood
// Output: 29.451045
resWeak.converged
// Output: true
Example 4. Simulate daily returns of two stocks, convert them to pseudo-observations, and fit a Clayton Copula using a table as input to evaluate the lower-tail risk of simultaneous crashes.
n = 1000
retA = norm(0.0005, 0.02, n)
retB = 0.6 * retA + sqrt(1 - 0.36) * norm(0.0003, 0.015, n)
uA = (rank(retA) + 1) \ (n + 1.0)
uB = (rank(retB) + 1) \ (n + 1.0)
stockReturns = table(uA as stockA, uB as stockB)
res = copulaFitClayton(stockReturns)
res.alpha
// Output: 1.288283
res.alphaCI
// Output: [1.168655,1.407912]
res.logLikelihood
// Output: 262.738733
res.converged
// Output: true
Related functions: copulaFitGaussian, copulaFitStudent, copulaFitFrank, copulaFitGumbel, copulaRandClayton, copulaPdfClayton, copulaCdfClayton
