pastas.solver.objective_function.misfit ======================================= .. py:function:: pastas.solver.objective_function.misfit(ml: pastas.typing.Model, p: pastas.typing.ArrayLike, noise: bool, weights: pandas.Series | None = None, callback: collections.abc.Callable | None = None, returnseparate: bool = False) -> pastas.typing.ArrayLike | tuple[pastas.typing.ArrayLike, pastas.typing.ArrayLike, pastas.typing.ArrayLike] Shared objective function for solvers to calculate residuals or noise. :param p: Array of parameter values. :type p: np.ndarray :param noise: If True, minimizes the sum of squared noise computed by the NoiseModel. :type noise: bool :param ml: The model instance containing residuals and noise methods. :type ml: object :param weights: Weights to scale the residuals or noise. :type weights: pandas.Series, optional :param callback: Function to call after each iteration. :type callback: Callable, optional :param returnseparate: If True, returns residuals, noise, and noise weights separately. :type returnseparate: bool, optional :returns: The calculated residuals or noise, optionally with separate components. :rtype: np.ndarray or tuple[np.ndarray, np.ndarray, np.ndarray] .. !! processed by numpydoc !!