$X=\{x_{i}\}$ and $Y=\{y_{i}\}$ are numeric samples: $y_i \ge 0, x_i \ge 0, i \in [0..N]$. I need to find the mapping $F(X)=\{F(x_i)\}$ with fairly simple formula such that:
- Euclidean distance $\rho(F(X),Y)$ between samples is minimal: $\sum_{i=1}^n(F(x_i) - y_i)^2 \rightarrow min$;
- Expectations of the samples F(X) and Y are equal: $E[F(X)] = E[Y]$, i.e. $\sum_{i=1}^nF(x_i) = \sum_{i=1}^ny_i$;
- Standard deviation of the samples F(X) and Y are close: $\sum_{i=1}^n(F(x_i) - E[F(X)])^2 - \sum_{i=1}^n(y_i - E[Y])^2 \le \varepsilon$
In addition:
- $F(x_i) \ge 0$;
- $\rho(F(X),Y) \le \rho(X,Y)$;