Custom Function
curve_fit
Fit a curve with curve_fit method.
This function returns FitResult see the documentation for more information what is possible with it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fit_func
|
Function to fit. |
required | |
x
|
_NDARRAY
|
x data. |
required |
data
|
_NDARRAY
|
data to fit. |
required |
p0
|
Optional[List[Any]]
|
Initial guess for the parameters. |
None
|
bounds
|
Optional[Union[List[Tuple[Any, Any]], Tuple[Any, Any]]]
|
Bounds for the parameters. |
(-inf, inf)
|
**kwargs
|
Additional keyword arguments to curve_fit. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
FitResult |
FitResult[DynamicNamedTuple]
|
Fit result. |
Source code in ffit/front.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
leastsq
Perform a least squares optimization using the leastsq
function from the optimize
module.
This function returns FitResult see the documentation for more information what is possible with it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
func
|
Callable
|
The objective function to minimize. |
required |
x0
|
Sequence
|
The initial guess for the optimization. |
required |
args
|
tuple
|
Additional arguments to be passed to the objective function. |
()
|
**kwarg
|
Additional keyword arguments to be passed to the |
{}
|
Returns:
Type | Description |
---|---|
FitResult[tuple]
|
A |
Source code in ffit/front.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|