Skip to main content

evaluate_residuals

Function evaluate_residuals 

Source
pub fn evaluate_residuals(
    pattern: &PatternRecord,
    calculated_y: &[f64],
    options: ResidualOptions,
) -> Result<ResidualEvaluation, ResidualError>
Expand description

Evaluate masked residual arrays and standard powder residual metrics.

Residual is calculated - observed. If enabled and present, uncertainty is interpreted as one standard deviation. Zero Rp/Rwp denominators and non-positive residual degrees of freedom produce positive infinity, matching the scripting contract.

ยงErrors

Returns ResidualError if the pattern is invalid, has no observations, or calculated_y has the wrong length or contains a non-finite sample.