Slight optimization of `F::compare_matrices`

pull/79/head
Meliurwen 2 years ago
parent 9fbdf25149
commit a2c5800891
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 7
      reCTBN/src/structure_learning/hypothesis_test.rs

@ -65,9 +65,10 @@ impl F {
let q2 = cim_2.diag();
for idx in 0..r1.shape()[0] {
let s = q2[idx] / q1[idx];
let F = FisherSnedecor::new(r1[idx], r2[idx]);
let lim_sx = F.as_ref().expect("REASON").cdf(self.alpha / 2.0);
let lim_dx = F.as_ref().expect("REASON").cdf(1.0 - (self.alpha / 2.0));
let F = FisherSnedecor::new(r1[idx], r2[idx]).unwrap();
let s = F.cdf(s);
let lim_sx = self.alpha / 2.0;
let lim_dx = 1.0 - (self.alpha / 2.0);
if s < lim_sx || s > lim_dx {
return false;
}

Loading…
Cancel
Save