BiCopEstMMD: Estimation of parametric bivariate copulas using stochastic...

View source: R/BiCopEstMMD.R

BiCopEstMMDR Documentation

Estimation of parametric bivariate copulas using stochastic gradient descent on the MMD criteria

Description

This function uses computes the MMD-estimator of a bivariate copula family. This computation is done through a stochastic gradient algorithm, that is itself computed by the function BiCopGradMMD(). The main arguments are the two vectors of observations, and the copula family. The bidimensional copula families are indexed in the same way as in VineCopula::BiCop() (which computes the MLE estimator).

Usage

BiCopEstMMD(
  u1,
  u2,
  family,
  tau = NULL,
  par = NULL,
  par2 = NULL,
  kernel = "gaussian",
  gamma = "default",
  alpha = 1,
  niter = 100,
  C_eta = 1,
  epsilon = 1e-04,
  method = "QMCV",
  quasiRNG = "sobol",
  ndrawings = 10
)

Arguments

u1

vector of observations of the first coordinate, in [0,1].

u2

vector of observations of the second coordinate, in [0,1].

family

the chosen family of copulas (see the documentation of the class VineCopula::BiCop() for the available families).

tau

the copula family can be parametrized by the parameter par or by Kendall's tau. Here, the user can choose the initial value of tau for the stochastic gradient algorithm. If NULL, a random value is chosen instead.

par

if different from NULL, the parameter tau is ignored, and the initial parameter must be given here. The initial Kendall's tau is then computed thanks to VineCopula::BiCopPar2Tau().

par2

initial value for the second parameter, if any. (Works only for Student copula).

kernel

the kernel used in the MMD distance: it can be a function taking in parameter (u1, u2, v1, v2, gamma, alpha) or a name giving the kernel to use in the list:

  • "gaussian": Gaussian kernel k(x,y) = exp( - || (x-y) / gamma ||_2^2)

  • "exp-l2": k(x,y) = exp( - || (x-y) / gamma ||_2)

  • "exp-l1": k(x,y) = exp( - || (x-y) / gamma ||_1)

  • "inv-l2": k(x,y) = 1 / ( 1 + || (x-y) / gamma ||_2 )^α

  • "inv-l1": k(x,y) = 1 / ( 1 + || (x-y) / gamma ||_1 )^α

Each of these names can receive the suffix ".Phi", such as "gaussian.Phi" to indicates that the kernel k(x,y) is replaced by k(Φ^{-1}(x) , Φ^{-1}(y)) where Φ^{-1} denotes the quantile function of the standard Normal distribution.

gamma

parameter γ to be used in the kernel. If gamma="default", a default value is used.

alpha

parameter α to be used in the kernel, if any.

niter

the stochastic gradient algorithm is composed of two phases: a first "burn-in" phase and a second "averaging" phase. If niter is of size 1, the same number of iterations is used for both phases of the stochastic gradient algorithm. If niter is of size 2, then niter[1] iterations are done for the burn-in phase and niter[2] for the averaging phase.

C_eta

a multiplicative constant controlling for the size of the gradient descent step. The step size is then computed as C_eta / sqrt(i_iter) where i_iter is the index of the current iteration of the stochastic gradient algorithm.

epsilon

the differential of VineCopula::BiCopTau2Par() is computed thanks to a finite difference with increment epsilon.

method

the method of computing the stochastic gradient:

  • MC: classical Monte-Carlo with ndrawings replications.

  • QMCV: usual Monte-Carlo on U with ndrawings replications, quasi Monte-Carlo on V.

quasiRNG

a function giving the quasi-random points in [0,1]^2 or a name giving the method to use in the list:

  • sobol: use of the Sobol sequence implemented in randtoolbox::sobol

  • halton: use of the Halton sequence implemented in randtoolbox::halton

  • torus: use of the Torus sequence implemented in randtoolbox::torus

ndrawings

number of replicas of the stochastic estimate of the gradient drawn at each step. The gradient is computed using the average of these replicas.

Value

an object of class VineCopula::BiCop() containing the estimated copula.

References

Alquier, P., Chérief-Abdellatif, B.-E., Derumigny, A., and Fermanian, J.D. (2022). Estimation of copulas via Maximum Mean Discrepancy. Journal of the American Statistical Association, doi: 10.1080/01621459.2021.2024836.

See Also

VineCopula::BiCopEst() for other methods of estimation such as Maximum Likelihood Estimation or Inversion of Kendall's tau. BiCopGradMMD() for the computation of the stochastic gradient. BiCopEst.MO for the estimation of Marshall-Olkin copulas by MMD.

Examples

# Estimation of a bivariate Gaussian copula with correlation 0.5.
dataSampled = VineCopula::BiCopSim(N = 500, family = 1, par = 0.5)
estimator = BiCopEstMMD(u1 = dataSampled[,1], u2 = dataSampled[,2], family = 1, niter = 10)
estimator$par


# Estimation of a bivariate Student copula with correlation 0.5 and 5 degrees of freedom
dataSampled = VineCopula::BiCopSim(N = 1000, family = 2, par = 0.5, par2 = 5)
estimator = BiCopEstMMD(u1 = dataSampled[,1], u2 = dataSampled[,2], family = 2)
estimator$par
estimator$par2


# Comparison with maximum likelihood estimation with and without outliers
dataSampled = VineCopula::BiCopSim(N = 500, family = 1, par = 0.5)
estimatorMMD = BiCopEstMMD(u1 = dataSampled[,1], u2 = dataSampled[,2], family = 1)
estimatorMMD$par
estimatorMLE = VineCopula::BiCopEst(u1 = dataSampled[,1], u2 = dataSampled[,2],
  family = 1, method = "mle")
estimatorMLE$par

dataSampled[1:10,1] = 0.999
dataSampled[1:10,2] = 0.001
estimatorMMD = BiCopEstMMD(u1 = dataSampled[,1], u2 = dataSampled[,2], family = 1)
estimatorMMD$par
estimatorMLE = VineCopula::BiCopEst(u1 = dataSampled[,1], u2 = dataSampled[,2],
  family = 1, method = "mle")
estimatorMLE$par


# Estimation of a bivariate Gaussian copula with real data
data("daxreturns", package = "VineCopula")
BiCopEstMMD(u1 = daxreturns[,1], u2 = daxreturns[,2], family = 1)
estimator$par




MMDCopula documentation built on April 25, 2022, 5:06 p.m.