public function DFFITS() : array
{
$ys = $this->reg_ys;
$xs = $this->reg_xs;
$ν = $this->ν;
$h = $this->leverages();
$e = $this->residuals();
$MSₑ = $this->meanSquareResidual();
// Mean square residuals with the the i-th observation removed
$MSₑ₍ᵢ₎ = array_map(function ($eᵢ, $hᵢ) use($MSₑ, $ν) {
return ($MSₑ - $eᵢ ** 2 / ((1 - $hᵢ) * $ν)) * ($ν / ($ν - 1));
}, $e, $h);
// Studentized residual with the i-th observation removed
$s = array_map(function ($eᵢ, $mseᵢ, $hᵢ) {
return $eᵢ / sqrt($mseᵢ * (1 - $hᵢ));
}, $e, $MSₑ₍ᵢ₎, $h);
$DFFITS = array_map(function ($s₍ᵢ₎, $hᵢ) {
return $s₍ᵢ₎ * sqrt($hᵢ / (1 - $hᵢ));
}, $s, $h);
return $DFFITS;
}