Predefined Nonlinear Curves
Defining a nonlinear curve and calculating the partial derivatives can get quite complicated. For this reason, Numerics.NET provides a series of predefined nonlinear curves. Each class implements the ValueAt, ValueAt, and FillPartialDerivatives methods.
The table below lists the predefined non-linear curve types:
Class | Description |
---|---|
A sum of exponential terms aeb. | |
The 4-parameter logistic function. | |
The 5-parameter logistic function with asymmetry factor. | |
A 4-parameter Gaussian ('Bell') curve. | |
A 4-parameter Lorentz peak curve. | |
A quotient of two polynomials. | |
A 4-parameter periodic curve. |
These classes reside in the Numerics.NET.Curves.Nonlinear namespace. A more detailed description of each curve type is given below. In the formulas, a parameter ai represents the parameter with index i in the curve's Parameters collection. For some curves, the individual parameters have a specific meaning, and the class implementing the curve has properties with descriptive names for these parameters. These properties are also listed where available.
Exponential Curves
An exponential curve is a curve that involves one or more exponential functions eax. There is immense variety in the exact definition of different exponential curves. The ExponentialCurve class represents a curve that is the sum of one or more exponential terms:
![Definition of an exponential curve.](/documentation/media/exponentialCurve.gif)
The constructor takes one integer parameter that specifies the number of terms in the curve. The curve has 2n parameters, where n is the number of terms.
Four Parameter Logistic Curve
A logistic curve is commonly used to represent growth processes.
![Definition of a 4 parameter logistic (4PL) curve.](/documentation/media/logisticCurve.gif)
A logistic curve is implemented by the FourParameterLogisticCurve class and has four parameters:
Index | Property | Description |
---|---|---|
0 | The value of the curve as x goes to zero. | |
1 | The value of the curve as x goes to infinity. | |
2 | The halfway point in the transition from InitialValue to FinalValue. | |
3 | The Hill slope of the curve. |
Five Parameter Logistic Curve
The four-parameter logistic curve is symmetrical in that the change from the initial value and the change towards the final value occur at roughly the same rate. When the data is not symmetrical in this way, the fitted curve may not be a good fit. The five-parameter logistic curve adds an asymmetry parameter that remedies this situation.
![Definition of the 5 parameter logistic (5PL) curve.](/documentation/media/5PlogisticCurve.gif)
The 5 parameter logistic curve is implemented by the FiveParameterLogisticCurve class and has five parameters:
Index | Property | Description |
---|---|---|
0 | The value of the curve as x goes to zero. | |
1 | The value of the curve as x goes to infinity. | |
2 | The halfway point in the transition from InitialValue to FinalValue. | |
3 | The Hill slope of the curve. | |
4 | The asymmetry factor. |
Gaussian Curve
A Gaussian curve is one type of curve that is used to represent functions with a peak shape:
![Definition of a Gaussian bell curve.](/documentation/media/gaussianCurve.gif)
A Gaussian curve is implemented by the GaussianCurve class and takes four arguments:
Index | Property | Description |
---|---|---|
0 | The value of the curve as x goes to infinity. | |
1 | The location of the peak. | |
2 | The width of the peak halfway between the baseline and the top of the peak. | |
3 | The area between the curve and a horizontal line at y = Offset. |
In addition, the GaussianCurve class has an Amplitude property that returns the difference between the function value at the peak and the baseline (Offset).
Lorentz Curve
A Lorentz curve is used to represent functions with a peak shape. The peak is sharper than the Gaussian curve.
![](/assets/media/lorentzCurve.gif)
A Lorentz curve is implemented by the LorentzCurve class and takes four arguments:
Index | Property | Description |
---|---|---|
0 | The value of the curve as x goes to infinity. | |
1 | The location of the peak. | |
2 | The width of the peak halfway between the baseline and the top of the peak. | |
3 | The area between the curve and a horizontal line at y = Offset. |
In addition, the LorentzCurve class has an Amplitude property that returns the difference between the function value at the peak and the baseline (Offset).
Rational Curves
A rational curve is a curve that is the quotient of two polynomials. Multiplying both polynomials by a constant gives the same curve. To resolve this ambiguity, the constant term of the polynomial in the denominator is set to 1. A rational curve therefore has n+d+1 parameters, where n is the degree of the polynomial in the numerator, and d is the degree of the polynomial in the denominator:
![](/assets/media/rationalCurve.gif)
The RationalCurve class implements this type of curve. The constructor takes two integer parameters: the degree of the polynomial in the numerator, and the degree of the polynomial in the denominator.
Sine Curve
A sine curve represents a periodic function.
![](/assets/media/sineCurve.gif)
A sine curve is implemented by the SineCurve class and takes four arguments:
Index | Property | Description |
---|---|---|
0 | The mean value of the curve. The curve oscillates around this value. | |
1 | The starting point of the oscillation. | |
2 | The period of the curve. | |
3 | The amplitude of the curve. |