vineknockoffs.copulas.GaussianCopula#

class vineknockoffs.copulas.GaussianCopula(par=nan)#

Gaussian copula (bivariate).

Parameters#

parfloat

Parameter of the Gaussian copula. Default is np.nan.

Examples#

# ToDo: add an example here

Notes#

The pdf of the Gaussian copula with parameter \(\theta \in (-1, 1)\) is given by

\[c(u, v; \theta) = \frac{1}{\sqrt{1-\theta^2}} \exp\bigg(- \frac{\theta^2 (x^2 + y^2) - 2 \theta x y}{2 (1-\theta^2)}\bigg),\]

with \(x = \Phi^{-1}(u)\) and \(y = \Phi^{-1}(v)\).

Methods

aic(u, v)

Evaluate the copula AIC.

cdf(u, v)

Evaluate the copula cdf.

d_cdf_d_par(u, v)

Evaluate the derivative of the copula cdf wrt the parameter.

d_hfun_d_par(u, v)

Evaluate the derivative of the copula hfun wrt the parameter.

d_hfun_d_u(u, v)

Evaluate the derivative of the copula hfun wrt u.

d_hfun_d_v(u, v)

Evaluate the derivative of the copula hfun wrt v.

d_inv_hfun_d_par(u, v)

Evaluate the derivative of the inverse of the copula hfun wrt the parameter.

d_inv_hfun_d_u(u, v)

Evaluate the derivative of the inverse of the copula hfun wrt u.

d_inv_hfun_d_v(u, v)

Evaluate the derivative of the inverse of the copula hfun wrt v.

d_inv_vfun_d_par(u, v)

Evaluate the derivative of the inverse of the copula vfun wrt the parameter.

d_inv_vfun_d_u(u, v)

Evaluate the derivative of the inverse of the copula vfun wrt u.

d_inv_vfun_d_v(u, v)

Evaluate the derivative of the inverse of the copula vfun wrt v.

d_vfun_d_par(u, v)

Evaluate the derivative of the copula vfun wrt the parameter.

d_vfun_d_u(u, v)

Evaluate the derivative of the copula vfun wrt u.

d_vfun_d_v(u, v)

Evaluate the derivative of the copula vfun wrt v.

hfun(u, v)

Evaluate the copula hfun.

inv_hfun(u, v)

Evaluate the inverse of the copula hfun.

inv_vfun(u, v)

Evaluate the inverse of the copula vfun.

ll(u, v)

Evaluate the copula log-likelihood.

mle_est(u, v)

Estimation of the copula parameter with maximum likelihood.

par2tau(par)

Compute Kendall's tau associated with the given value for the copula parameter.

pdf(u, v)

Evaluate the copula pdf.

sim([n_obs])

Simulate random observations from the copula.

tau2par(tau)

Compute the copula parameter associated with the given value for Kendall's tau.

vfun(u, v[, u_])

Evaluate the copula vfun.

Attributes

n_pars

The number of copula parameters.

par

Parameter of the copula.

rotation

Rotation of the copula (0, 90, 180 or 270).

GaussianCopula.aic(u, v)#

Evaluate the copula AIC.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.cdf(u, v)#

Evaluate the copula cdf.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_cdf_d_par(u, v)#

Evaluate the derivative of the copula cdf wrt the parameter.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_hfun_d_par(u, v)#

Evaluate the derivative of the copula hfun wrt the parameter.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_hfun_d_u(u, v)#

Evaluate the derivative of the copula hfun wrt u.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_hfun_d_v(u, v)#

Evaluate the derivative of the copula hfun wrt v.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_inv_hfun_d_par(u, v)#

Evaluate the derivative of the inverse of the copula hfun wrt the parameter.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_inv_hfun_d_u(u, v)#

Evaluate the derivative of the inverse of the copula hfun wrt u.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_inv_hfun_d_v(u, v)#

Evaluate the derivative of the inverse of the copula hfun wrt v.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_inv_vfun_d_par(u, v)#

Evaluate the derivative of the inverse of the copula vfun wrt the parameter.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_inv_vfun_d_u(u, v)#

Evaluate the derivative of the inverse of the copula vfun wrt u.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_inv_vfun_d_v(u, v)#

Evaluate the derivative of the inverse of the copula vfun wrt v.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_vfun_d_par(u, v)#

Evaluate the derivative of the copula vfun wrt the parameter.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_vfun_d_u(u, v)#

Evaluate the derivative of the copula vfun wrt u.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.d_vfun_d_v(u, v)#

Evaluate the derivative of the copula vfun wrt v.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.hfun(u, v)#

Evaluate the copula hfun.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.inv_hfun(u, v)#

Evaluate the inverse of the copula hfun.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.inv_vfun(u, v)#

Evaluate the inverse of the copula vfun.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.ll(u, v)#

Evaluate the copula log-likelihood.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.mle_est(u, v)#

Estimation of the copula parameter with maximum likelihood.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

self : object

GaussianCopula.par2tau(par)#

Compute Kendall’s tau associated with the given value for the copula parameter.

Parameters#

parfloat

The copula parameter

Returns#

taufloat

Kendall’s tau.

GaussianCopula.pdf(u, v)#

Evaluate the copula pdf.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.sim(n_obs=100)#

Simulate random observations from the copula.

Parameters#

n_obs :

The number of observations to simulate.

Returns#

resnumpy.ndarray

Result array.

GaussianCopula.tau2par(tau)#

Compute the copula parameter associated with the given value for Kendall’s tau.

Parameters#

taufloat

Kendall’s tau.

Returns#

parfloat

The copula parameter.

GaussianCopula.vfun(u, v, u_=None)#

Evaluate the copula vfun.

Parameters#

unumpy.ndarray

Array of observations for the first variable.

vnumpy.ndarray

Array of observations for the second variable.

Returns#

resnumpy.ndarray

Result array.