Categories &

Functions List

Function Reference: copulafit

statistics: rho = copulafit ("Gaussian", u)
statistics: [rho, nu] = copulafit ("t", u)
statistics: [param, ci] = copulafit (family, u)
statistics: […] = copulafit (…, "alpha", a)

Fit a copula to data.

copulafit (family, u) returns the maximum-likelihood estimate of the parameter of a copula of the family family, fit to the data in u. The rows of u are observations and its columns are variables; all entries must lie strictly inside the unit interval (0,1), as produced for example by a probability-integral transform or by ecdf/ksdensity.

family is the copula family name. It can be "Gaussian" for the Gaussian family, "t" for the Student’s t family, "Clayton" for the Clayton family, "Gumbel" for the Gumbel-Hougaard family, or "Frank" for the Frank family.

The returned value depends on the family:

  • For "Gaussian", rho = copulafit ("Gaussian", u) returns the estimated linear correlation matrix rho, computed as the sample correlation of the normal scores norminv (u). The data may have two or more columns.
  • For "t", copulafit ("t", u) returns the estimated correlation matrix rho and the degrees of freedom nu as [rho, nu], obtained by maximizing the copula log-likelihood. Only bivariate data (two columns) are supported.
  • For the Archimedean families "Clayton", "Gumbel", and "Frank", [param, ci] = copulafit (family, u) returns the scalar copula parameter param and, optionally, a two-element vector ci with the lower and upper confidence bounds. Only bivariate data are supported.

copulafit (…, "alpha", a) sets the significance level for the confidence interval to a, so that ci has coverage 100 * (1 - a) percent. The default is a = 0.05. The confidence interval is a Wald interval whose standard error is obtained from the outer-product-of-gradients estimate of the information.

See also: copulastat, copulaparam, copulacdf, copulapdf, copularnd

Source Code: copulafit

Fit a Clayton copula to data and recover a confidence interval

 u = copularnd ("Clayton", 2, 500);
 [alpha, ci] = copulafit ("Clayton", u)
alpha = 1.9558
ci =

   1.7192   2.1923

Fit a Gaussian copula and report the correlation matrix

 u = copularnd ("Gaussian", 0.6, 500);
 rho = copulafit ("Gaussian", u)
rho =

   1.0000   0.6291
   0.6291   1.0000