Extreme Optimization™: Complexity made simple.

Math and Statistics
Libraries for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Blog
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Partners
    • Contact us
Introduction
Deployment Guide
Nuget packages
Configuration
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Data Analysis Library User's GuideData Analysis Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand Data Access Library User's GuideData Access Library User's Guide
Expand ReferenceReference
  • Extreme Optimization
    • Features
    • Solutions
    • Documentation
    • QuickStart Samples
    • Sample Applications
    • Downloads
    • Technical Support
    • Download trial
    • How to buy
    • Blog
    • Company
    • Resources
  • Documentation
    • Introduction
    • Deployment Guide
    • Nuget packages
    • Configuration
    • Using Parallelism
    • Mathematics Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Data Access Library User's Guide
    • Reference
  • Reference
    • Extreme
    • Extreme.Collections
    • Extreme.Data
    • Extreme.Data.Json
    • Extreme.Data.Matlab
    • Extreme.Data.R
    • Extreme.Data.Stata
    • Extreme.Data.Text
    • Extreme.DataAnalysis
    • Extreme.DataAnalysis.Linq
    • Extreme.DataAnalysis.Models
    • Extreme.Mathematics
    • Extreme.Mathematics.Algorithms
    • Extreme.Mathematics.Calculus
    • Extreme.Mathematics.Calculus.OrdinaryDifferentialEquations
    • Extreme.Mathematics.Curves
    • Extreme.Mathematics.Curves.Nonlinear
    • Extreme.Mathematics.Distributed
    • Extreme.Mathematics.EquationSolvers
    • Extreme.Mathematics.Generic
    • Extreme.Mathematics.LinearAlgebra
    • Extreme.Mathematics.LinearAlgebra.Implementation
    • Extreme.Mathematics.LinearAlgebra.IterativeSolvers
    • Extreme.Mathematics.LinearAlgebra.IterativeSolvers.Preconditioners
    • Extreme.Mathematics.Optimization
    • Extreme.Mathematics.Optimization.LineSearches
    • Extreme.Mathematics.Random
    • Extreme.Mathematics.SignalProcessing
    • Extreme.Providers
    • Extreme.Providers.InteropServices
    • Extreme.Statistics
    • Extreme.Statistics.Distributions
    • Extreme.Statistics.Multivariate
    • Extreme.Statistics.Tests
    • Extreme.Statistics.TimeSeriesAnalysis
  • Extreme.Mathematics.Curves
    • BarycentricBasis Class
    • BarycentricSeries Class
    • ChebyshevBasis Class
    • ChebyshevSeries Class
    • CubicSpline Class
    • CubicSplineKind Enumeration
    • Curve Class
    • CurveFitter Class
    • FunctionBasis Class
    • GeneralCurve Class
    • GeneralFunctionBasis Class
    • LinearCombination Class
    • LinearCurveFitter Class
    • LinearLeastSquaresMethod Enumeration
    • NonlinearCurve Class
    • NonlinearCurveFitter Class
    • NonlinearCurveFitter(T) Class
    • NonlinearCurveFittingMethod Enumeration
    • PiecewiseConstantCurve Class
    • PiecewiseCurve Class
    • PiecewiseLinearCurve Class
    • Point Structure
    • Polynomial Class
    • PolynomialBase Class
    • PolynomialBasis Class
    • WeightFunctions Class
  • NonlinearCurveFitter Class
    • NonlinearCurveFitter Constructors
    • Properties
    • Methods

NonlinearCurveFitter Class

Extreme Optimization Numerical Libraries for .NET Professional
Represents an algorithm that fits a nonlinear curve to data.
Inheritance Hierarchy

SystemObject
  Extreme.Mathematics.CurvesCurveFitter
    Extreme.Mathematics.CurvesNonlinearCurveFitter

Namespace:  Extreme.Mathematics.Curves
Assembly:  Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
Syntax

C#
VB
C++
F#
Copy
public class NonlinearCurveFitter : CurveFitter
Public Class NonlinearCurveFitter
	Inherits CurveFitter
public ref class NonlinearCurveFitter : public CurveFitter
type NonlinearCurveFitter =  
    class
        inherit CurveFitter
    end

The NonlinearCurveFitter type exposes the following members.

Constructors

  NameDescription
Public methodNonlinearCurveFitter
Constructs a new NonlinearCurveFitter object.
Public methodNonlinearCurveFitter(NonlinearCurveFittingMethod)
Constructs a new NonlinearCurveFitter object.
Top
Properties

  NameDescription
Public propertyBestFitParameters
Gets the curve parameters corresponding to the best fit.
(Inherited from CurveFitter.)
Public propertyCurve
Gets the non-linear curve that is being fitted.
(Overrides CurveFitterCurve.)
Public propertyInitialGuess
Gets or sets the initial value for the iteration.
(Inherited from CurveFitter.)
Public propertyLowerBounds
Gets or sets the vector of lower bounds of the curve parameters.
Public propertyMethod
Gets or sets the nonlinear least squares algorithm that is to be used in the calculations.
Public propertyOptimizer
Gets the optimizer used to calculate the nonlinear least-squares solution.
Public propertyResiduals
Gets the residuals for the observations.
(Inherited from CurveFitter.)
Public propertyScaleVector
Gets or sets the vector used to scale the curve parameters.
(Inherited from CurveFitter.)
Public propertyStandardError
Gets the standard error of the curve fit.
(Inherited from CurveFitter.)
Public propertyUpperBounds
Gets or sets the vector of upper bounds of the curve parameters.
Public propertyWeightFunction
Gets or sets the weight function.
(Inherited from CurveFitter.)
Public propertyWeightVector
Gets or sets the weight vector.
(Inherited from CurveFitter.)
Public propertyXValues
Gets or sets the vector of x-values.
(Inherited from CurveFitter.)
Public propertyYValues
Gets or sets the vector of y-values.
(Inherited from CurveFitter.)
Top
Methods

  NameDescription
Protected methodComputeFit
Calculates the least-squares fit.
(Overrides CurveFitterComputeFit(DenseVectorDouble, SymmetricMatrixDouble, Double).)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFit
Calculates the least-squares fit.
(Inherited from CurveFitter.)
Public methodGetConfidenceBandwidth(Double)
Gets the width of the confidence band around the best-fit curve at the specified point at the 95% confidence level.
(Inherited from CurveFitter.)
Public methodGetConfidenceBandwidth(Double, Double)
Gets the width of the confidence band around the best-fit curve at the specified point.
(Overrides CurveFitterGetConfidenceBandwidth(Double, Double).)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetPredictionBandwidth(Double)
Gets the width of the prediction band around the best-fit curve at the specified point at the 95% confidence level.
(Inherited from CurveFitter.)
Public methodGetPredictionBandwidth(Double, Double)
Gets the width of the prediction band around the best-fit curve at the specified point.
(Overrides CurveFitterGetPredictionBandwidth(Double, Double).)
Public methodGetStandardDeviations
Gets the standard deviations.
(Inherited from CurveFitter.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetVarianceCovarianceMatrix
Returns the variance-covariance matrix of the fit.
(Inherited from CurveFitter.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodScale(DenseVectorDouble)
Scales the components of a vector using the values from ScaleVector.
(Inherited from CurveFitter.)
Protected methodScale(VectorDouble)
Scales the components of a vector using the values from ScaleVector.
(Inherited from CurveFitter.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodUnscale(DenseVectorDouble)
Undoes the scaling of the components of a vector using the values from ScaleVector.
(Inherited from CurveFitter.)
Protected methodUnscale(VectorDouble)
Undoes the scaling of the components of a vector using the values from ScaleVector.
(Inherited from CurveFitter.)
Top
Remarks

Use the NonlinearCurveFitter class to fit data to a nonlinear curve by the method of least squares. The curve, which must be of a type that inherits from NonlinearCurve, is specified by the Curve property. The data is supplied as Vector objects through the XValues and YValues properties.

The Fit method performs the actual curve fit. This method returns the NonlinearCurve that best fits the supplied data. The Optimizer property returns the MultidimensionalOptimizer object that was used to find the least squares solution. To verify that the algorithm terminated normally, you can inspect the Optimizer's Status property, which is of type AlgorithmStatus. A value of Normal indicates that the algorithm terminated normally. However, it is still possible that the algorithm didn't converge to the actual best fit. A visual inspection is always recommended.

The parameters of the fitted curve can be retrieved through the BestFitParameters property. The standard deviations associated with each parameter are available through the GetStandardDeviations method.

By default, the observations are unweighted. You can supply a weighting method in two ways. You can set the WeightFunction property to a function of two variables delegate that computes the weight for each observation. The WeightFunctions class provides predefined delegates for the most common weight functions. Alternatively, you can set the individual weights by setting the WeightVector property to a Vector that contains the weight for each individual observation.

See Also

Reference

Extreme.Mathematics.Curves Namespace

Copyright (c) 2004-2021 ExoAnalytics Inc.

Send comments on this topic to support@extremeoptimization.com

Copyright © 2004-2021, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.