Skip to content

Commit ce857ee

Browse files
committed
provide computed jacobian for gaussian fit
1 parent 8fe511b commit ce857ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fooof/objs/fit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
from fooof.core.modutils import copy_doc_func_to_method
7272
from fooof.core.utils import group_three, check_array_dim
7373
from fooof.core.funcs import gaussian_function, get_ap_func, infer_ap_func
74+
from fooof.core.jacobians import jacobian_gauss
7475
from fooof.core.errors import (FitError, NoModelError, DataError,
7576
NoDataError, InconsistentDataError)
7677
from fooof.core.strings import (gen_settings_str, gen_results_fm_str,
@@ -1159,7 +1160,7 @@ def _fit_peak_guess(self, guess):
11591160
gaussian_params, _ = curve_fit(gaussian_function, self.freqs, self._spectrum_flat,
11601161
p0=guess, maxfev=self._maxfev, bounds=gaus_param_bounds,
11611162
ftol=self._tol, xtol=self._tol, gtol=self._tol,
1162-
check_finite=False)
1163+
check_finite=False, jac=jacobian_gauss)
11631164
except RuntimeError as excp:
11641165
error_msg = ("Model fitting failed due to not finding "
11651166
"parameters in the peak component fit.")

0 commit comments

Comments
 (0)