Skip to content

Commit bee9d34

Browse files
committed
Fix clipping
1 parent cef09f9 commit bee9d34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/stats.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ pub fn compute_stats(input_file: &str, output_prefix: &str, sort_by: Option<Stri
260260
let pearson_residual = if denominator != 0.0 { (value - mean) / denominator } else { 0.0 };
261261

262262
// Clip Pearson residuals by sqrt(n_cols)
263-
let clip_threshold = (n_cols as f64 / 2.0).sqrt();
263+
let clip_threshold = (n_cols as f64).sqrt();
264264
let clipped_pearson_residual = pearson_residual.max(-clip_threshold).min(clip_threshold);
265265

266266
// Update Pearson residual sums for variance calculation

0 commit comments

Comments
 (0)