Interpolation.Logit Linear Method
Performs logit-linear interpolation at a single point.
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
C#
The interpolated y-value in the range (0, 1).
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
public static double LogitLinear(
ReadOnlySpan<double> xValues,
ReadOnlySpan<double> yValues,
double x
)Parameters
- xValues ReadOnlySpan<Double>
- The x-coordinates of the data points. Must be strictly increasing.
- yValues ReadOnlySpan<Double>
- The y-coordinates of the data points. Must be in the range (0, 1).
- x Double
- The x-coordinate at which to interpolate.
Return Value
DoubleThe interpolated y-value in the range (0, 1).
Remarks
This method performs linear interpolation in x and logit interpolation in y. The y-values must be in the open interval (0, 1). The result is returned in the range (0, 1).
The logit function is defined as logit(y) = log(y / (1 - y)).
This method throws an exception if x is outside the range of xValues.
Exceptions
| Argument | xValues or yValues is null. |
| Argument | xValues and yValues have different lengths, or contain fewer than 2 elements. |
| Argument | x is outside the range of xValues, or any bracketing y-value is not in the range (0, 1). |