Compute the gradient of the contrast as defined in Bordes & Vandekerkhove (2010) (see below in section 'Details'), needed for optimization purpose. Remind that one considers an admixture model, i.e. l = p*f + (1-p)*g ; where l denotes the probability density function (pdf) of the mixture with known component pdf g, p is the unknown mixture weight, and f relates to the unknown symmetric component pdf f.

BVdk_contrast_gradient(param, data, h, comp.dist, comp.param)



A numeric vector with two elements corresponding to the parameters to be estimated. First the unknown component weight, and second the location shift parameter of the symmetric unknown component distribution.


A vector of observations following the admixture model given by the pdf l.


The window width used in the kernel estimations.


A list with two elements corresponding to component distributions (specified with R native names for these distributions) involved in the admixture model. Unknown elements must be specified as 'NULL' objects, e.g. when 'f' is unknown: list(f=NULL, g='norm').


A list with two elements corresponding to the parameters of the component distributions, each element being a list itself. The names used in this list must correspond to the native R argument names for these distributions. Unknown elements must be specified as 'NULL' objects, e.g. if 'f' is unknown: list(f=NULL, g=list(mean=0,sd=1)).


A numeric vector composed of the two partial derivatives w.r.t. the two parameters on which to optimize the contrast.


The contrast is defined in Bordes, L. and Vandekerkhove, P. (2010); Semiparametric two-component mixture model when a component is known: an asymptotically normal estimator; Math. Meth. Stat.; 19, pp. 22--41.


Xavier Milhaud


## Simulate data: comp.dist <- list(f = 'norm', g = 'norm') comp.param <- list(f = list(mean = 3, sd = 0.5), g = list(mean = 0, sd = 1)) data1 <- rsimmix(n = 1000, unknownComp_weight = 0.6, comp.dist, comp.param)[['']] ## Compute the contrast gradient for some given parameter vector in real-life framework: comp.dist <- list(f = NULL, g = 'norm') comp.param <- list(f = NULL, g = list(mean = 0, sd = 1)) BVdk_contrast_gradient(c(0.3,2), data1, density(data1)$bw, comp.dist, comp.param)
#> [1] -9.0820082 -0.6115812