turnbull: Fix typo
Copy paste error in likelihood-ratio CIs resulting in lower confidence limit being reported as upper confidence limit
This commit is contained in:
parent
162e415e07
commit
d690da72e3
@ -723,12 +723,12 @@ fn survival_prob_likelihood_ratio_ci(data: &TurnbullData, progress_bar: Progress
|
|||||||
// Compute upper confidence limit
|
// Compute upper confidence limit
|
||||||
|
|
||||||
root_finder = AndersonBjorckRootFinder::new(
|
root_finder = AndersonBjorckRootFinder::new(
|
||||||
0.0, s[time_index],
|
s[time_index], 1.0,
|
||||||
f64::NAN, -CHI2_1DF_95 // Value of (lr_statistic - CHI2_1DF_95), which we are seeking the roots of
|
-CHI2_1DF_95, f64::NAN // Value of (lr_statistic - CHI2_1DF_95), which we are seeking the roots of
|
||||||
);
|
);
|
||||||
|
|
||||||
ci_estimate = s[time_index] - Z_97_5 * oim_se[time_index - 1];
|
ci_estimate = s[time_index] + Z_97_5 * oim_se[time_index - 1];
|
||||||
if ci_estimate < 0.0 {
|
if ci_estimate > 1.0 {
|
||||||
ci_estimate = root_finder.next_guess(); // Returns interval midpoint in this case
|
ci_estimate = root_finder.next_guess(); // Returns interval midpoint in this case
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -744,8 +744,6 @@ fn survival_prob_likelihood_ratio_ci(data: &TurnbullData, progress_bar: Progress
|
|||||||
value_left, value_right // Value of (lr_statistic - CHI2_1DF_95), which we are seeking the roots of
|
value_left, value_right // Value of (lr_statistic - CHI2_1DF_95), which we are seeking the roots of
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: Terminate if reached precision already
|
|
||||||
|
|
||||||
ci_estimate = root_finder.next_guess(); // Returns interval midpoint in this case
|
ci_estimate = root_finder.next_guess(); // Returns interval midpoint in this case
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user