copulaFitFrank
First introduced in version 3.00.6
Syntax
copulaFitFrank(X, [alpha=0.05])
Details
Fits a Frank Copula and estimates the shape parameter alpha. This function only supports two-dimensional input. The shape parameter θ ∈ ℝ \ {0}, where θ > 0 indicates positive dependence, θ < 0 indicates negative dependence, and θ approaching 0 corresponds to independence.
Frank Copula models symmetric dependence without tail dependence.
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 positively correlated Frank Copula data with shape parameter θ=5.0 and fit the model to verify estimation accuracy.
X = copulaRandFrank(5.0, 1000)
res = copulaFitFrank(X)
res.alpha
// Output: 5.154311
res.alphaCI
// Output: [4.702187,5.606435]
res.logLikelihood
// Output: 275.6565
res.converged
// Output: true
Example 2. Refit the same data with alpha=0.01 to observe how the 99% confidence interval differs from the default 95%.
resCI = copulaFitFrank(X, alpha=0.01)
resCI.alpha
// Output: 5.154311
resCI.alphaCI
// Output: [4.560119,5.748503]
resCI.logLikelihood
// Output: 275.6565
resCI.converged
// Output: true
Example 3. Generate negatively correlated data with shape parameter θ=−3.0 and fit a Frank Copula to verify its estimation of negative dependence. Frank Copula is the only Archimedean Copula among the five that supports negative dependence.
Xneg = copulaRandFrank(-3.0, 2000)
resNeg = copulaFitFrank(Xneg)
resNeg.alpha
// Output: -2.842699
resNeg.alphaCI
// Output: [-3.123232,-2.562167]
resNeg.logLikelihood
// Output: 203.529925
resNeg.converged
// Output: true
Example 4. Simulate daily returns of two stocks, convert them to pseudo-observations, and fit a Frank Copula using a table as input to evaluate symmetric dependence structure (no tail dependence).
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 = copulaFitFrank(stockReturns)
res.alpha
// Output: 5.577092
res.alphaCI
// Output: [5.091839,6.062344]
res.logLikelihood
// Output: 307.059948
res.converged
// Output: true
Related functions: copulaFitGaussian, copulaFitStudent, copulaFitClayton, copulaFitGumbel, copulaRandFrank, copulaPdfFrank, copulaCdfFrank
