mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-11-29 20:46:54 +01:00
[Fix] corrected expected_chisquare by adding the number of priors
This commit is contained in:
parent
85ae9d7563
commit
f682ad463f
1 changed files with 1 additions and 1 deletions
|
|
@ -472,7 +472,7 @@ def least_squares(x, y, func, priors=None, silent=False, **kwargs):
|
|||
hat_vector = prepare_hat_matrix()
|
||||
A = W @ hat_vector
|
||||
P_phi = A @ np.linalg.pinv(A.T @ A) @ A.T
|
||||
expected_chisquare = np.trace((np.identity(y_all.shape[-1]) - P_phi) @ W @ cov @ W)
|
||||
expected_chisquare = np.trace((np.identity(y_all.shape[-1]) - P_phi) @ W @ cov @ W) + len(loc_priors)
|
||||
output.chisquare_by_expected_chisquare = output.chisquare / expected_chisquare
|
||||
if not silent:
|
||||
print('chisquare/expected_chisquare:', output.chisquare_by_expected_chisquare)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue