I have a dataset composed of $N$ iid observations ($x_1, x_2, ..., x_N$) and a function $f(x_i,\, i{=}1,..M$) that takes as input a subset of fixed length $M$ of unique elements from the original dataset (where $M{<}N$ and it is known). This function is basically a comparision of two kernel density estimators (one is always fixed, the other is generated with the elements in $M$), where the exact same value is returned for the same input values. I need to find the subset $M^*$ that maximizes $f(x_i)$.
I can think of a few strategies:
- Process all the possible subsets of length $M$ that can be created from my $N$ observations, evaluate all of them in $f(x_i)$, and keep the one that gives the maximum value. This is prohibitively time-consuming for even small numbers of $N$ and $M$.
- Process only a random subset out of all the possible combinations defined above, keep the one that gives the maximum likelihood value. This is the easiest method, but I'm not sure how large the random subset of combinations should be to get a somewhat meaningful (trustworthy?) answer.
- Use some optimization/MCMC algorithm? This is the option that seems more reasonable, but I'm not sure which one is best suited for this task.
Which method would you recommend?