3
3
Notes
4
4
-----
5
5
These functions line up with those in `funcs`.
6
- The parameters in these functions are labelled {a, b, c, ...}, but follow the order in `funcs`.
6
+ The parameters in these functions are labeled {a, b, c, ...}, but follow the order in `funcs`.
7
7
These functions are designed to be passed into `curve_fit` to provide a computed Jacobian.
8
8
"""
9
9
15
15
## Periodic fit functions
16
16
17
17
def jacobian_gauss (xs , * params ):
18
- """Create the Jacobian matrix for the Guassian function.
18
+ """Create the Jacobian matrix for the Gaussian function.
19
19
20
20
Parameters
21
21
----------
@@ -30,7 +30,7 @@ def jacobian_gauss(xs, *params):
30
30
Jacobian matrix, with shape [len(xs), n_params].
31
31
"""
32
32
33
- jacobians = np .zeros ((len (xs ), len (params )))
33
+ jacobian = np .zeros ((len (xs ), len (params )))
34
34
35
35
for i , (a , b , c ) in enumerate (zip (* [iter (params )] * 3 )):
36
36
@@ -44,11 +44,11 @@ def jacobian_gauss(xs, *params):
44
44
exp_b = exp * b
45
45
46
46
ii = i * 3
47
- jacobians [:, ii ] = (exp_b * ax ) / c2
48
- jacobians [:, ii + 1 ] = exp
49
- jacobians [:, ii + 2 ] = (exp_b * ax2 ) / c3
47
+ jacobian [:, ii ] = (exp_b * ax ) / c2
48
+ jacobian [:, ii + 1 ] = exp
49
+ jacobian [:, ii + 2 ] = (exp_b * ax2 ) / c3
50
50
51
- return jacobians
51
+ return jacobian
52
52
53
53
54
54
## Aperiodic fit functions
0 commit comments