I would like to find a algorithm that will do the following:Given two sets $A, B \subseteq \mathbb{R}$, where $|B| > |A|$, find the largest subset $C \subseteq B$, such that:$\qquad |\operatorname{mean}(A) - \operatorname{mean}(C) |< \delta$ and$\qquad |\operatorname{std}(A) - \operatorname{std}(C) | < \epsilon$ I think this problem is NP-hard, but I would like a good approximation that does reasonably well. An even harder version of this is to find the larget subset $C$ that matches not just the moments, but the histogram of $A$ to some quality metric. If you have a solution, or can point to same papers that would great!I am a neuroscientist, and this is for my research.
Finding largest subset that matches moments
algorithms;reference request;optimization