Skip to content

Commit f6bd845

Browse files
[FIX] fitting field 'error log beta' now only contains the log beta error and not the concentrations as well
1 parent c3088b8 commit f6bd845

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/libeq/optimizers/potentiometry.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,10 @@ def PotentiometryOptimizer(data: SolverData, reporter=None) -> dict[str, Any]:
398398

399399
retval = bridge.final_result()
400400
retval.update(fit_result)
401-
erB, cor, cov = fit_final_calcs(fit_result['jacobian'], fit_result['residuals'], bridge.weights())
401+
stdev, cor, cov = fit_final_calcs(fit_result['jacobian'], fit_result['residuals'], bridge.weights())
402402
retval['covariance'] = cov
403403
retval['correlation'] = cor
404-
retval['error log beta'] = erB
404+
retval['error log beta'] = stdev[bridge._slice_betas] if bridge._any_beta_refined else None
405405
return retval
406406

407407

@@ -441,12 +441,12 @@ def fit_final_calcs(jacobian, resids, weights):
441441
"""
442442
covariance = covariance_fun(jacobian, weights, resids)
443443
cov_diag = np.diag(covariance)
444-
error_B = np.sqrt(cov_diag) / np.log(10)
444+
stdev = np.sqrt(cov_diag)
445445
lenD = len(cov_diag)
446446
correlation = covariance / np.sqrt(
447447
np.dot(cov_diag.reshape((lenD, 1)), cov_diag.reshape((1, lenD)))
448448
)
449-
return error_B, correlation, covariance
449+
return stdev, correlation, covariance
450450

451451

452452
def ravel(x, y, flags):

0 commit comments

Comments
 (0)