[IoId("00000000-51a0-4b10-9c31-0a1b2c3d5e01")] public sealed class SigmoidFunction : FunctionWithCaching

A bounded, monotonic sigmoid (S-curve) transitioning from a low asymptote to a high asymptote. The curve is antisymmetric about its inflection point, which sits at the mid-level halfway between the two asymptotes.

The steepness is given by the slope at the inflection. A negative slope produces a falling sigmoid. Every SigmoidKind shares the same asymptotes, inflection and inflection-slope for a given set of parameters, so switching variants keeps those anchors fixed and changes only the tail behaviour.

Constructors

SigmoidFunction

#
public SigmoidFunction()
Create a default logistic sigmoid rising from 0 to 1 with its inflection at the origin.

SigmoidFunction

#
public SigmoidFunction(double centre, double low, double high, double scale, SigmoidKind kind)
Create a new sigmoid.
centre (double)Inflection x-coordinate.
low (double)Low asymptote.
high (double)High asymptote.
scale (double)Signed horizontal scale of the normalised profile. Negative falls.
kind (SigmoidKind)Sigmoid variant.

SigmoidFunction

#
public SigmoidFunction(IReader reader)
reader (IReader)

Properties

Centre

#
public double Centre { get; }
Gets the inflection x-coordinate.

Derivative

public sealed override Function Derivative { get; }
Gets a function which is the derivative of this function. The returned function may be either analytic or approximate.
inherited fromFunctionWithCaching

High

#
public double High { get; }
Gets the high asymptote.

Integral

public sealed override Function Integral { get; }
Gets a function which is the indefinite integral of this function. The returned function may be analytic or approximate. Note that numeric approximation of indefinite integrals is a slow and not particularly high quality process.
inherited fromFunctionWithCaching

Kind

#
public SigmoidKind Kind { get; }
Gets the sigmoid variant.

Low

#
public double Low { get; }
Gets the low asymptote.

MidLevel

#
public double MidLevel { get; }
Gets the mid-level, y at the inflection point.

Nomen

public sealed override Nomen Nomen { get; }
Gets a description of this function.
inherited fromFunctionWithCaching
Function.Nomen

Notation

public override string Notation { get; }
Gets the notation for this function. Notation is aimed at humans and does not need to return a parseable string.
inherited fromFunctionWithCaching

Scale

#
public double Scale { get; }
Gets the signed horizontal scale of the normalised profile. Negative = falling.

SlopeAtCentre

#
public double SlopeAtCentre { get; }
Gets the slope of the curve at the inflection point.

Ui

#
public override FunctionUi Ui { get; }
Gets a UI object for modifying this function. This property may return null, not all functions must be editable.
Function.Ui

Methods

Asymptotes

public virtual Line[] Asymptotes()
Returns an array of *all* the non-vertical asymptotes for this function. This property may return both null and empty arrays, implying no asymptotes. Due to the nature of non-vertical asymptotes, there can only be a finite amount of them.
inherited fromFunction

AutoCoDomain

protected void AutoCoDomain(double x0, double x1, out double y0, out double y1, int samples = 100)
Compute the automatic codomain for a given domain.
inherited fromFunction
x0 (double)Domain start.
x1 (double)Domain end.
y0 (out double)Lowest value in codomain.
y1 (out double)Highest value in codomain.
samples (int = 100)Samples.

DomainEstimate

#
public override void DomainEstimate(out double x0, out double x1, out double y0, out double y1)
x0 (out double)
x1 (out double)
y0 (out double)
y1 (out double)

EmitDerivative

#
protected override Function EmitDerivative()

EmitIntegral

protected virtual Function EmitIntegral()
Override this method to provide an analytic indefinite integral.
inherited fromFunctionWithCaching

FromSlope

#
public static SigmoidFunction FromSlope(double centre, double low, double high, double slope, SigmoidKind kind)
Create a sigmoid from its inflection slope rather than its internal scale. The scale is solved so the curve has exactly this slope at the centre, whatever the variant.
centre (double)
low (double)
high (double)
slope (double)
kind (SigmoidKind)

Holes

public virtual Interval[] Holes(double x0, double x1)
Returns a collection of domains for which this function is not defined. This method may return null or an empty array, implying no undefined domains. This method may also return domains outside of the specified interval.
inherited fromFunction
x0 (double)Lower limit of query domain.
x1 (double)Upper limit of query domain.

Integrate

public virtual double Integrate(double x0, double x1)
Evaluate the definite integral between two parameters. Unless a function specifically implements an analytic integral, this value will be approximate. Note to implementer: if you provide an analytic integral via the Function.Integral property, that function will be used to compute an analytic result. There is typically no reason to override this method.
inherited fromFunction
x0 (double)Integral start.
x1 (double)Integral end.
Definite integral from x0 to x1.

Poles

public virtual Pole[] Poles(double x0, double x1)
Returns an array of all the poles (i.e. vertical asymptotes) within a domain. This method may return both null and empty arrays, implying no poles. Furthermore this method may choose to return poles which fall outside of the given domain.
inherited fromFunction
x0 (double)Lower limit of query domain.
x1 (double)Upper limit of query domain.

Store

#
public override void Store(IWriter writer)
writer (IWriter)

Y

#
public override double Y(double x)
x (double)
Function.Y

YYYY

public double[] YYYY(double[] x)
Evaluate a large amount of values. Functions may choose to use multiple threads to perform this calculation. This method should not throw, instead every failed evaluation will be represented by a NaN value.
inherited fromFunction
x (double[])Value to evaluate.
Evaluation results. Array will contain double.NaN entries for failed evaluations.