mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 06:40:24 +01:00
Bug in covariance fixed that appeared when working with several replica of
different length.
This commit is contained in:
parent
fc853f81c0
commit
97fc279eed
1 changed files with 2 additions and 2 deletions
|
@ -852,12 +852,12 @@ def covariance(obs1, obs2, correlation=False, **kwargs):
|
|||
|
||||
r_length.append(len(obs1.deltas[r_name]))
|
||||
|
||||
gamma += np.sum(obs1.deltas[r_name] * obs2.deltas[r_name]) / len(obs1.deltas[r_name])
|
||||
gamma += np.sum(obs1.deltas[r_name] * obs2.deltas[r_name])
|
||||
|
||||
e_N = np.sum(r_length)
|
||||
|
||||
tau_combined = (obs1.e_tauint[e_name] + obs2.e_tauint[e_name]) / 2
|
||||
dvalue += gamma * (1 + 1 / e_N) / e_N * 2 * tau_combined
|
||||
dvalue += gamma / e_N * (1 + 1 / e_N) / e_N * 2 * tau_combined
|
||||
|
||||
if np.abs(dvalue / obs1.dvalue / obs2.dvalue) > 1.0:
|
||||
dvalue = np.sign(dvalue) * obs1.dvalue * obs2.dvalue
|
||||
|
|
Loading…
Add table
Reference in a new issue