## 3 The Algorithm
### Stochastic Outline of Our Algorithm  
Let \(X_{1}\), \(X_{2}\),...,\(X_{m}\) (resp. \(Y_{1}\), \(Y_{2}\),...,\(Y_{m}\)) be a sequence of \(m\) independent random vectors with the same density \(f\) (resp. \(g\)). As customary in nonparametric \(\phi\)-divergence optimizations, all estimates of \(f\) and \(f_{a}\), as well as all uses of Monte Carlo methods are being performed using subsamples \(X_{1}\), \(X_{2}\),...,and \(Y_{1}\), \(Y_{2}\),...,\(Y_{n}\)--extracted respectively from \(X_{1}\), \(X_{2}\),..,\(X_{m}\) and \(Y_{1}\), \(Y_{2}\),..,\(Y_{m}\)--since the estimates are bounded below by some positive deterministic sequence \(\theta_{m}\)--see Appendix D.  
Let \(\mathbb{P}_{n}\) be the empirical measure based on the subsample \(X_{1}\), \(X_{2}\),..,\(X_{n}\). Let \(f_{n}\) (resp. \(f_{a,n}\) for any \(a\) in \(\mathbb{R}_{*}^{d}\)) be the kernel estimate of \(f\) (resp. \(f_{a}\)), which is built from \(X_{1}\), \(X_{2}\),..,\(X_{n}\) (resp. \(a^{\top}X_{1}\), \(a^{\top}X_{2}\),..,\(a^{\top}X_{n}\)). As defined in Section 2.2, we consider the following sequences \((a_{k})_{k\geq 1}\) and \((g^{(k)})_{k\geq 1}\) such that  
\[a_{k}\text{ is a non null vector of }\mathbb{R}^{d}\text{ defined by }a_{k}=arg\min_{a\in\mathbb{R}_{*}^{d}}D_{\phi}\left(g^{(k-1)}\frac{f_{a}}{g_{ a}^{(k-1)}},f\right)\] \[g^{(k)}\text{ is the density defined by }g^{(k)}=g^{(k-1)}\frac{f_{a_{k}}}{g_{ a_{k}}^{(k-1)}}\text{ with }g^{(0)}=g \tag{3.3}\]  
The stochastic setting up of the algorithm uses \(f_{n}\) and \(g_{n}^{(0)}=g\) instead of \(f\) and \(g^{(0)}=g\)--since \(g\) is known. Thus, at the first step, we build the vector \(\check{a}_{1}\) which minimizes the \(\phi\)-divergence between \(f_{n}\) and \(g\frac{f_{a,n}}{g_{a}}\) and which estimates \(a_{1}\). First, since proposition D.1 and lemma C.4 show how the infimum of the criteria (or index)  
\[\check{D_{\phi}}\left(g\frac{f_{a,n}}{g_{a}},f_{n}\right)=\frac{1}{n}\Sigma_{ i=1}^{n}\varphi\left(\frac{g(X_{i})f_{a,n}(a^{\top}X_{i})}{f_{n}(X_{i})g_{a}(a^{ \top}X_{i})}\right)\]  
is reached, we are then able to minimize the \(\phi\)-divergence between \(f_{n}\) and \(g\frac{f_{a,n}}{g_{a}}\). Second, defining \(\check{a}_{1}\) as the argument of this minimization, proposition 4.3 infers that this vector tends to \(a_{1}\). Finally, we define the density \(\check{g}_{n}^{(1)}\) as \(\check{g}_{n}^{(1)}=g\frac{f_{a_{1},n}}{g_{a_{1}}}\) which estimates \(g^{(1)}\) through theorem 4.1. Now, from the second step and as defined in Section 2.2, we derive the fact that the density \(g^{(2-1)}\) is unknown. Consequently, once again, the samples have to be truncated. All estimates of \(f\) and \(f_{a}\) (resp. \(g^{(1)}\) and \(g_{a}^{(1)}\)) are being performed using a subsample \(X_{1}\), \(X_{2}\),..,\(X_{n}\) (resp. \(Y_{1}^{(1)}\), \(Y_{2}^{(1)}\),...,\(Y_{n}^{(1)}\)) extracted from \(X_{1}\), \(X_{2}\),...,\(X_{m}\) (resp. \(Y_{1}^{(1)}\), \(Y_{2}^{(1)}\),...,\(Y_{m}^{(1)}\), which is a sequence of \(m\) independent random vectors with same density \(g^{(1)}\)) such that the estimates are bounded below by some positive deterministic sequence \(\theta_{m}\)--see Appendix D.  
Let \(\mathbb{P}_{n}\) be the empirical measure of the subsample \(X_{1}\), \(X_{2}\),...,\(X_{n}\). Let \(f_{n}\) (resp. \(g_{n}^{(1)}\), \(f_{a,n}\), \(g_{a,n}^{(1)}\) for any \(a\) in \(\mathbb{R}_{*}^{d}\)) be the kernel estimate of \(f\) (resp. \(g^{(1)}\) and \(f_{a}\) as well as \(g_{a}^{(1)}\)) which is built from \(X_{1}\), \(X_{2}\),...,\(X_{n}\) (resp. \(Y_{1}^{(1)}\), \(Y_{2}^{(1)}\),...,\(Y_{n}^{(1)}\) and \(a^{\top}X_{1}\), \(a^{\top}X_{2}\),...,\(a^{\top}X_{n}\) as well as \(a^{\top}Y_{1}^{(1)}\), \(a^{\top}Y_{2}^{(1)}\),...,\(a^{\top}Y_{m}^{(1)}\)). The stochastic setting up of the algorithm uses \(f_{n}\) and \(g_{n}^{(1)}\) instead of \(f\) and \(g^{(1)}\). Thus, we build the vector \(\check{a}_{2}\), which minimizes the \(\phi\)-divergence between \(f_{n}\) and \(g_{n}^{(1)}\frac{f_{a,n}}{g_{a,n}^{(1)}}\), since \(g^{(1)}\) and \(g_{a}^{(1)}\) are unknown--and which estimates \(a_{2}\).