robust_rs_core/theory/influence.rs
1//! The influence function of an M-estimator of location.
2
3use super::variance::expect_psi_prime;
4use crate::rho::RhoFunction;
5
6/// Return the influence function `x ↦ ψ(x) / E_Φ[ψ']` as a closure.
7pub fn influence_function<'a>(
8 rho: &'a dyn RhoFunction,
9 quad_points: usize,
10) -> impl Fn(f64) -> f64 + 'a {
11 let c = expect_psi_prime(rho, quad_points);
12 move |x: f64| rho.psi(x) / c
13}