Portfolio optimization w.r.t. equivalence classes