# BiCopGradMMD: Computation of the gradient of the MMD criterion for... In MMDCopula: Robust Estimation of Copulas by Maximum Mean Discrepancy

## Description

This function computes a stochastic estimate of the gradient of the MMD criterion for parametric estimation of bidimensional copula family. The main arguments are the two vectors of observations, and the copula family. The family is parametrized as in `VineCopula::BiCop()`, using the Kendall's tau instead of the first parameter. This function is used by `BiCopEstMMD()` to perform parameter estimation via MMD minimization.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15``` ```BiCopGradMMD( u1, u2, family, tau, par = NULL, par2 = 0, kernel = "gaussian.Phi", gamma = 0.95, alpha = 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. This function assumes a Kendall tau parametrization. Thus, the user can choose the value of Kendall tau at which the stochastic gradient should be computed. `par` if different from `NULL`, the user must instead of `tau` specify the corresponding parameter `par`. The value of `tau` is then ignored. `par2` 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. `alpha` parameter α to be used in the kernel, if any. `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.

## References

Alquier, P., Chérief-Abdellatif, B.-E., Derumigny, A., and Fermanian, J.D. (2020). Estimation of copulas via Maximum Mean Discrepancy. ArXiv preprint arxiv:2010.00408

`BiCopEstMMD()` for the estimation of parametric bivariate copulas by stochastic gradient descent on the MMD criteria.
 ``` 1 2 3 4 5 6 7 8 9 10``` ```# Simulation from a bivariate Gaussian copula with correlation 0.5. dataSampled = VineCopula::BiCopSim(N = 500, family = 1, par = 0.5) # computation of the gradient of the MMD criteria at different points # Gradient is small at the true parameter BiCopGradMMD(dataSampled[,1], dataSampled[,2], family = 1, par = 0.5) # Gradient is negative when below the parameter BiCopGradMMD(dataSampled[,1], dataSampled[,2], family = 1, par = 0.1) # and positive when above BiCopGradMMD(dataSampled[,1], dataSampled[,2], family = 1, par = 0.8) ```