Elliptical Copulas
GaussianCopula
Copulas.GaussianCopula
— TypeGaussianCopula{d,MT}
Fields:
- Σ::MT - covariance matrix
Constructor
GaussianCopula(Σ)
The Gaussian Copula is the copula of a Multivariate normal distribution. It is constructed as:
\[C(\mathbf{x}; \boldsymbol{\Sigma}) = F_{\Sigma}(F_{\Sigma,i}^{-1}(x_i),i\in 1,...d)\]
where $F_{\Sigma}$ is a cdf of a gaussian random vector and $F_{\Sigma,i}$ is the ith marginal cdf, while $\Sigma$ is the covariance matrix.
It can be constructed in Julia via:
C = GaussianCopula(Σ)
You can sample it, compute pdf and cdf, or even fit the distribution via:
u = rand(C,1000)
Random.rand!(C,u) # other calling syntax for rng.
pdf(C,u) # to get the density
cdf(C,u) # to get the distribution function
Ĉ = fit(GaussianCopula,u) # to fit on the sampled data.
GaussianCopulas have a special case:
- When
isdiag(Σ)
, the constructor returns anIndependentCopula(d)
References:
- [3] Nelsen, Roger B. An introduction to copulas. Springer, 2006.
TCopula
Copulas.TCopula
— TypeTCopula{d,MT}
Fields:
- df::Int - number of degree of freedom
- Σ::MT - covariance matrix
Constructor
TCopula(df,Σ)
The Student's T Copula is the copula of a Multivariate Student distribution. It is constructed as :
\[C(\mathbf{x}; \boldsymbol{n,\Sigma}) = F_{n,\Sigma}(F_{n,\Sigma,i}^{-1}(x_i),i\in 1,...d)\]
where $F_{n,\Sigma}$ is a cdf of a multivariate student random vector with covariance matrix $\Sigma$ and $n$ degrees of freedom. and F_{n,\Sigma,i}
is the ith marignal cdf.
It can be constructed in Julia via:
C = TCopula(2,Σ)
You can sample it, compute pdf and cdf, or even fit the distribution via:
u = rand(C,1000)
Random.rand!(C,u) # other calling syntax for rng.
pdf(C,u) # to get the density
cdf(C,u) # to get the distribution function
Ĉ = fit(TCopula,u) # to fit on the sampled data.
Except that currently it does not work since fit(Distributions.MvTDist,data)
does not dispatch.
References:
- [3] Nelsen, Roger B. An introduction to copulas. Springer, 2006.
- [3]
- R. B. Nelsen. An Introduction to Copulas. 2nd ed Edition, Springer Series in Statistics (Springer, New York, 2006).