use Array1;
use crateexternally_studentized_residuals;
use crateOlsFit;
/// DFFITS `ᵢ` for each observation.
///
/// `DFFITSᵢ = tᵢ · √(hᵢ / (1 − hᵢ))`
///
/// where `tᵢ` is the **externally** studentized residual and `hᵢ` the leverage.
/// It measures, in standard-error units, how much observation `i`'s own fitted
/// value changes when that observation is deleted from the fit — a leave-one-out
/// influence measure.
///
/// A commonly cited flag is `|DFFITSᵢ| > 2·√(p/n)` (convention, not a hard rule).
///
/// DFFITS uses the external (leave-one-out) residual scale, whereas
/// [`cooks_distance`](super::cooks_distance) uses the internal one; the two
/// normally agree, but DFFITS reacts more sharply to a lone extreme outlier since
/// that point is excluded from the scale it is judged against. Entries are `NaN`
/// where the external studentized residual is undefined (`n − p − 1 < 1`).