File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,13 @@ def jacobian_expo(xs, *params):
7070 """
7171
7272 a , b , c = params
73- jacobian = np .hstack ([
74- np .ones ([len (xs ), 1 ]),
75- - (1 / (b + xs ** c )).reshape (- 1 , 1 ),
76- - ((xs ** c * np .log10 (xs )) / (b + xs ** c )).reshape (- 1 , 1 ),
77- ])
73+
74+ xs_c = xs ** c
75+ b_xs_c = xs_c + b
76+
77+ jacobian = np .ones ((len (xs ), len (params )))
78+ jacobian [:, 1 ] = - 1 / b_xs_c
79+ jacobian [:, 2 ] = - (xs_c * np .log10 (xs )) / b_xs_c
7880
7981 return jacobian
8082
@@ -95,9 +97,7 @@ def jacobian_expo_nk(xs, *params):
9597 Jacobian matrix, with shape [len(xs), n_params].
9698 """
9799
98- jacobian = np .hstack ([
99- np .ones ([len (xs ), 1 ]),
100- (- np .log10 (xs ) / np .log10 (10 )).reshape (- 1 , 1 ),
101- ])
100+ jacobian = np .ones ((len (xs ), len (params )))
101+ jacobian [:, 1 ] = - np .log10 (xs )
102102
103103 return jacobian
You can’t perform that action at this time.
0 commit comments