This function is used internally by essR to evaluate the objective function.
For internal use of MEIGOR.