statsmodels.distributions.empirical_distribution.monotone_fn_inverter#

statsmodels.distributions.empirical_distribution.monotone_fn_inverter(fn, x, vectorized=True, **keywords)[source]#

Given a monotone function fn (no checking is done to verify monotonicity) and a set of x values, return an linearly interpolated approximation to its inverse from its values on x.

Parameters:
fncallable

Monotone function to invert. No check is performed to verify monotonicity.

xarray_like

Grid of values on which fn is evaluated to construct the approximate inverse.

vectorizedbool, optional

If True, fn is called on the whole array x at once. If False, fn is called separately for each element of x. Default is True.

**keywords

Additional keyword arguments passed to fn.

Returns:
callable

Linearly interpolated approximation to the inverse of fn, constructed with scipy.interpolate.interp1d.