pastas.solver.LeastSquares.get_covariances ========================================== .. py:method:: pastas.solver.LeastSquares.get_covariances(jacobian: pastas.typing.ArrayLike, cost: float, method: Literal['trf', 'dogbox', 'lm'] = 'trf', absolute_sigma: bool = False) -> pastas.typing.ArrayLike :staticmethod: Method to get the covariance matrix from the jacobian. :param jacobian: The jacobian matrix with dimensions nobs, npar. :type jacobian: ArrayLike :param cost: The cost value of the scipy.optimize.OptimizeResult which is half the sum of squares. That's why the cost is multiplied by a factor of two internally to get the sum of squares. :type cost: float :param method: Algorithm with which the minimization is performed. Default is "trf". :type method: Literal["trf", "dogbox", "lm"], optional :param absolute_sigma: If True, `sigma` is used in an absolute sense and the estimated parameter covariance `pcov` reflects these absolute values. If False (default), only the relative magnitudes of the `sigma` values matter. The returned parameter covariance matrix `pcov` is based on scaling `sigma` by a constant factor. This constant is set by demanding that the reduced `chisq` for the optimal parameters `popt` when using the *scaled* `sigma` equals unity. In other words, `sigma` is scaled to match the sample variance of the residuals after the fit. Default is False. Mathematically, ``pcov(absolute_sigma=False) = pcov(absolute_sigma=True) * chisq(popt)/(M-N)`` :type absolute_sigma: bool, optional :returns: **pcov** -- numpy array with the covariance matrix. :rtype: array_like .. rubric:: Notes This method is copied from Scipy: https://github.com/scipy/scipy/blob/92d2a8592782ee19a1161d0bf3fc2241ba78bb63/scipy/optimize/_minpack_py.py Please refer to the SciPy optimization module:: https://docs.scipy.org/doc/scipy/reference/optimize.html .. !! processed by numpydoc !!