shamrock.math.least_squares#

shamrock.math.least_squares(*, func: Callable[[list[float], float], float], x_data: list[float], y_data: list[float], p0: list[float]) tuple[list[float], float]#

Fit data with a given function by least squares method f: Function (1d values) X: $x$ Data to fit Y: $y$ Data to fit p0: Initial parameters estimated