statsmodels.distributions.copula.api.GaussianCopula#
- class statsmodels.distributions.copula.api.GaussianCopula(corr=None, k_dim=2, allow_singular=False)[source]#
Gaussian copula.
It is constructed from a multivariate normal distribution over \(\mathbb{R}^d\) by using the probability integral transform.
For a given correlation matrix \(R \in[-1, 1]^{d \times d}\), the Gaussian copula with parameter matrix \(R\) can be written as:
\[C_R^{\text{Gauss}}(u) = \Phi_R\left(\Phi^{-1}(u_1),\dots, \Phi^{-1}(u_d) \right),\]where \(\Phi^{-1}\) is the inverse cumulative distribution function of a standard normal and \(\Phi_R\) is the joint cumulative distribution function of a multivariate normal distribution with mean vector zero and covariance matrix equal to the correlation matrix \(R\).
- Parameters:
- corr
floator array_like,optional Correlation or scatter matrix for the elliptical copula. In the bivariate case,
corrcan be a scalar and is then considered as the correlation coefficient. Ifcorris None, then the scatter matrix is the identity matrix.- k_dim
int,optional Dimension, number of components in the multivariate random variable.
- allow_singularbool,
optional Allow singular correlation matrix. The behavior when the correlation matrix is singular is determined by
scipy.stats.multivariate_normaland might not be appropriate for all copula or copula distribution methods. Behavior might change in future versions.
- corr
Methods
cdf(u[, args, rng])Evaluate the cdf of the copula.
corr_from_tau(tau)Pearson correlation from kendall's tau.
dependence_tail([corr])Bivariate tail dependence parameter.
fit_corr_param(data)Copula correlation parameter using Kendall's tau of sample data.
logpdf(u[, args])Log of copula pdf, loglikelihood.
pdf(u[, args])Evaluate the pdf of the copula.
plot_pdf([ticks_nbr, ax])Plot the PDF.
plot_scatter([sample, nobs, rng, ax])Sample the copula and plot.
rvs([nobs, args, rng])Generate random variates from the copula.
tau([corr])Bivariate kendall's tau based on correlation coefficient.
tau_simulated([nobs, rng])Kendall's tau based on simulated samples.
Notes
Elliptical copulas require that copula parameters are set when the instance is created. Those parameters currently cannot be provided in the call to methods. (This will most likely change in future versions.) If non-empty
argsare provided in methods, then a ValueError is raised. Theargskeyword is provided for a consistent interface across copulas.References
[1]Joe, Harry, 2014, Dependence modeling with copulas. CRC press. p. 163
Methods
cdf(u[, args, rng])Evaluate the cdf of the copula.
corr_from_tau(tau)Pearson correlation from kendall's tau.
dependence_tail([corr])Bivariate tail dependence parameter.
fit_corr_param(data)Copula correlation parameter using Kendall's tau of sample data.
logpdf(u[, args])Log of copula pdf, loglikelihood.
pdf(u[, args])Evaluate the pdf of the copula.
plot_pdf([ticks_nbr, ax])Plot the PDF.
plot_scatter([sample, nobs, rng, ax])Sample the copula and plot.
rvs([nobs, args, rng])Generate random variates from the copula.
tau([corr])Bivariate kendall's tau based on correlation coefficient.
tau_simulated([nobs, rng])Kendall's tau based on simulated samples.