cost_function: The cost function fed to Nelder-Mead.
Description
We want Nelder-Mead to run fast so the cost function operates with the column
reduced edge optimisation matrix and does not give any extra information about
the fit. For the details, use edge_optimisation_function instead.