As a problem in pure math, this belongs under Statistics or Advanced Statistics, and I am not competent to discuss the math aspects.
However, I doubt that this is a pure math problem at all. The number of companies that have similar lines of business and for which you can get reliable comparables is likely to be quite small. So the resulting estimate is going to be fairly crude in any case. If I were doing this, I'd go ahead and ask the statistics folks this question, but recognize that the resulting answer has a high probability of being impractical to apply. So I would concentrate on making sure that the members of the sample are in fact highly similar to your company. Transfer pricing is nowhere close to being an exact science.