{\geqslant}1, \qquad \mathcal{L}\left( \langle \varphi_j,X \rangle|Y=1\right) = \mathcal{N}(\theta_j,1) \qquad \text{and} \qquad  \mathcal{L}\left(\langle \varphi_j,X \rangle|Y=0\right) =  \mathcal{N}(\mu_j,1) \,,$$ and that the coefficients $\bigl(\langle \varphi_j,X \rangle\bigr)_{j {\geqslant}1}$ are conditionally independent given $Y$.

### Estimation of $(\theta_j)_{1 {\leqslant}j {\leqslant}d}$ and $(\mu_j)_{1 {\leqslant}j {\leqslant}d}$ {#sec:estimatethetamu}

In order to estimate the $\theta_j$ and $\mu_j$, we split the sample $(X_i,Y_i)_{1 {\leqslant}i {\leqslant}n}$ into two subsamples corresponding to either $Y_i=0$ or $Y_i=1$. More formally, we define the two subsamples $(X^0_i)_{1 {\leqslant}i {\leqslant}N_0}$ and $(X^1_i)_{1 {\leqslant}i {\leqslant}N_1}$ (one of which can be empty) by $$\left\{\begin{array}{l}
    X^0_i := X_{\tau^0_i} \,, \quad 1 {\leqslant}i {\leqslant}N_0 \\
    X^1_i := X_{\tau^1_i} \,, \quad 1 {\leqslant}i {\leqslant}N_1
\end{array}\right.$$ where $$\label{eq:defN0N1}
 N_0 := \sum_{i=1}^n \mathds{1}_{\lbrace Y_i = 0\rbrace} \quad \mathrm{and} \quad N_1 := \sum_{i=1}^n \mathds{1}_{\lbrace Y_i = 1\rbrace} \,,$$ and where $\tau^k_i$ is the index $t \in \{1,\ldots,n\}$ such that $Y_t = k$ for the $i$-th time, [i.e.]{}, for all $k \in \{0,1\}$ and $i \in \{1,\ldots,N_k\}$, $$\tau^k_i := \min \left\{t \in \{1,\ldots,n\} : \; \sum_{t'=1}^t \mathds{1}_{\{Y_{t'}=k\}} {\geqslant}i \right\} \,.$$ The sizes $N_0$ and $N_1$ are random variables; they satisfy $N_0 + N_1 = n$ and both have a binomial distribution $\mathcal{B}(n,1/2)$. In particular, both subsamples have (with high probability) approximately the same sizes.

 