[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

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

SigmoidFunction

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

SigmoidFunction

#
public SigmoidFunction(
reader
)

Properties

Centre

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

Derivative

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

High

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

Integral

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.
public sealed override Function Integral { get; }
inherited fromFunctionWithCaching

Kind

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

Low

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

MidLevel

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

Nomen

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

Notation

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

Scale

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

SlopeAtCentre

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

Ui

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

Methods

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.
public virtual Line[] Asymptotes()
inherited fromFunction

AutoCoDomain

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

DomainEstimate

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

EmitDerivative

#
protected override Function EmitDerivative()

EmitIntegral

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

FromSlope

#
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.
public static SigmoidFunction FromSlope(
centre,
low,
high,
slope,
kind
)

Holes

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.
public virtual Interval[] Holes(
x0,
Lower limit of query domain.
x1
Upper limit of query domain.
)
inherited fromFunction

Integrate

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.
public virtual double Integrate(
x0,
Integral start.
x1
Integral end.
)
inherited fromFunction
Definite integral from x0 to x1.

Poles

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.
public virtual Pole[] Poles(
x0,
Lower limit of query domain.
x1
Upper limit of query domain.
)
inherited fromFunction

Store

#
public override void Store(
writer
)

Y

#
public override double Y()
Function.Y

YYYY

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.
public double[] YYYY(
x
Value to evaluate.
)
inherited fromFunction
Evaluation results. Array will contain double.NaN entries for failed evaluations.