.calculateCostMetrics() double-counts censored observations by including them in the LSQ sum and then adding the M3 term on top. In .calculateCensoredContribution(), stDev is computed from unique(lloq), producing a vector that mismatches per-observation pnorm() calls when datasets have different LLOQs. scaling is also injected by mutating a runtime copy of objectiveFunctionOptions.
Exclude censored rows from the LSQ sum. Compute stDev per row as abs(linScaleCV * observedCensored$lloq). Pass scaling directly from PIOutputMapping$scaling without mutating config objects.
.calculateCostMetrics()double-counts censored observations by including them in the LSQ sum and then adding the M3 term on top. In.calculateCensoredContribution(),stDevis computed fromunique(lloq), producing a vector that mismatches per-observationpnorm()calls when datasets have different LLOQs.scalingis also injected by mutating a runtime copy ofobjectiveFunctionOptions.Exclude censored rows from the LSQ sum. Compute
stDevper row asabs(linScaleCV * observedCensored$lloq). Passscalingdirectly fromPIOutputMapping$scalingwithout mutating config objects.