portfolio optimization sorting efficient solutions C#
I have the following problem to solve:
Let H be a set of portfolios. For each portfolio i in H let (ri,vi) be the
(return,risk) values for this solution.
For each i in H if there exists j in H (j is different from i) such that
rj>=ri and vj<=vi then delete i from H. because i is dominated by j (it
has better return for less risk).
At the end H will be the set of undominated efficient solutions.
I tried to solve the above problem using linq:
H.RemoveAll(x => H.Any(y => x.CalculateReturn() <= y.CalculateReturn() &&
x.CalculateRisk() >= y.CalculateRisk() && x != y));
But I wonder if there exist a more efficient way, because if H.Count() is
of the order of ten thousands, then it takes a lot of time to remove the
dominated portfolios.
Thanks in advance for any help !
Christos
No comments:
Post a Comment