Namespace List

The namespaces specified in this document are:

NamespaceAssembly
Net.Kniaz.LMANet.Kniaz.LMA
Net.Kniaz.LMA.TestsNet.Kniaz.LMA

Namespace : Net.Kniaz.LMA.Tests



Net.Kniaz.LMA.Tests Type List

Classes

TypeSummary
GaussianFit Tests Gaussian Fit
GaussianFunction Implements Gauss Bell Shape function
LineFit Summary description for LineFit.
LineFunctionInitializes a new instance of the class.
LorenzianFitInitializes a new instance of the class.
LorenzianFunction Represents Lorenzian function. Derivative is calculated using a default f(x+dx)/dx method in the base class
SinFit NUnit test function.
SinFunction function represents sinusoidal aplitude


Net.Kniaz.LMA.Tests Classes

GaussianFunction Class

Summary

public class GaussianFunction : LMAFunction

Implements Gauss Bell Shape function

Constructor Members

NameAccessSummary
GaussianFunction()publicInitializes a new instance of the class.

Method Members

NameAccessSummary
GenerateData() : Double[][]public(from Net.Kniaz.LMA.LMAFunction) Returns array of x,y values, given x and fitting parameters used by all tests to generate test data for exact fits
GetPartialDerivative() : Doublepublic Derivative value
GetY() : Doublepublic Returns Gaussian values

GaussianFit Class

Summary

public class GaussianFit

Tests Gaussian Fit

Constructor Members

NameAccessSummary
GaussianFit()publicInitializes a new instance of the class.

Method Members

NameAccessSummary
RunGaussian() : Voidpublic

LineFunction Class

Summary

public class LineFunction : LMAFunction

Constructor Members

NameAccessSummary
LineFunction()publicInitializes a new instance of the class.

Method Members

NameAccessSummary
GenerateData() : Double[][]public(from Net.Kniaz.LMA.LMAFunction) Returns array of x,y values, given x and fitting parameters used by all tests to generate test data for exact fits
GetPartialDerivative() : Doublepublic
GetY() : Doublepublic

LineFit Class

Summary

public class LineFit

Summary description for LineFit.

Constructor Members

NameAccessSummary
LineFit()publicInitializes a new instance of the class.

Method Members

NameAccessSummary
RunLine() : Voidpublic

LorenzianFunction Class

Summary

public class LorenzianFunction : LMAFunction

Represents Lorenzian function. Derivative is calculated using a default f(x+dx)/dx method in the base class

Constructor Members

NameAccessSummary
LorenzianFunction()publicInitializes a new instance of the class.

Method Members

NameAccessSummary
GenerateData() : Double[][]public(from Net.Kniaz.LMA.LMAFunction) Returns array of x,y values, given x and fitting parameters used by all tests to generate test data for exact fits
GetPartialDerivative() : Doublepublic(from Net.Kniaz.LMA.LMAFunction) The method which gives the partial derivates used in the LMA fit. If you can't provide the functional derivative, use a small a-step (e.g., da = 1e-20) and return dy/da at the given x for each fit parameter. This is provided in the method below as a default implementation
GetY() : Doublepublic Returns value ofthe Lorenzian

LorenzianFit Class

Summary

public class LorenzianFit

Constructor Members

NameAccessSummary
LorenzianFit()publicInitializes a new instance of the class.

Method Members

NameAccessSummary
RunLorenzian() : Voidpublic

SinFunction Class

Summary

public class SinFunction : LMAFunction

function represents sinusoidal aplitude

Constructor Members

NameAccessSummary
SinFunction()publicInitializes a new instance of the class.

Method Members

NameAccessSummary
GenerateData() : Double[][]public(from Net.Kniaz.LMA.LMAFunction) Returns array of x,y values, given x and fitting parameters used by all tests to generate test data for exact fits
GetPartialDerivative() : Doublepublic Returns derivative
GetY() : Doublepublic Returns value of the function

SinFit Class

Summary

public class SinFit

NUnit test function.

Constructor Members

NameAccessSummary
SinFit()publicInitializes a new instance of the class.

Method Members

NameAccessSummary
RunSin() : Voidpublic Test method

Namespace : Net.Kniaz.LMA



Net.Kniaz.LMA Type List

Classes

TypeSummary
Constants Summary description for Constants.
LMA Ctor. In the LMA fit N is the number of data points, M is the number of fit parameters. Call fit() to start the actual fitting.
LMAFunction Abstract class implementing the LMAFunction interface


Net.Kniaz.LMA Classes

LMAFunction Class

Summary

public abstract class LMAFunction

Abstract class implementing the LMAFunction interface

Constructor Members

NameAccessSummary
LMAFunction()protectedInitializes a new instance of the class.

Method Members

NameAccessSummary
GenerateData() : Double[][]public Returns array of x,y values, given x and fitting parameters used by all tests to generate test data for exact fits
GetPartialDerivative() : Doublepublic The method which gives the partial derivates used in the LMA fit. If you can't provide the functional derivative, use a small a-step (e.g., da = 1e-20) and return dy/da at the given x for each fit parameter. This is provided in the method below as a default implementation
GetY() : Doublepublic Returns the y value of the function for the given x and vector of parameters

Constants Class

Summary

public class Constants

Summary description for Constants.

Constructor Members

NameAccessSummary
Constants()publicInitializes a new instance of the class.

Field Members

NameAccessSummary
lambda : Doublepublic

Method Members

NameAccessSummary

LMA Class

Summary

public class LMA

Constructor Members

NameAccessSummary
LMA()public Ctor. In the LMA fit N is the number of data points, M is the number of fit parameters. Call fit() to start the actual fitting.

Property Members

NameAccessSummary
Chi2 : Doublepublic
Iterations : Int32public
Parameters : Double[]public

Method Members

NameAccessSummary
CalculateAlphaElement() : Doubleprotected Calculates lambda weighted element for the alpha-matrix. NOTE: Does not change the value of alpha-matrix.
CalculateBetaElement() : Doubleprotected Calculates element of the beta (gradient) matrix NOTE: Does not change the value of beta-matrix.
CalculateChi2() : Doubleprotected Calculates function value for the current fit parameters Does not change the value of chi2
CalculateChi2() : Doubleprotected Calculates value of the function for given parameter array
CalculateIncrementedChi2() : Doubleprotected Calculates function value for the incremented parameters (da + a). Does not change the value of chi2.
CheckWeights() : Double[]protected Checks if the matrix of weights for each point is a matrix of positive elements. Otherwise it initializes a new matrix and sets each value to 1
Fit() : Voidpublic The default fit. If used after calling fit(lambda, minDeltaChi2, maxIterations), uses those values. The stop condition is fetched from this.stop(). Override this.stop() if you want to use another stop condition.
Fit() : Voidpublic Initializes and starts the fit. The stop condition is fetched from this.stop(). Override this.stop() if you want to use another stop condition.
SolveIncrements() : Voidprotected Solves the increments array (this.da) using alpha and beta. Then updates the this.incrementedParameters array. NOTE: Inverts alpha. Call at least updateAlpha() before calling this.
Stop() : Booleanpublic The stop condition for the fit. Override this if you want to use another stop condition.
UpdateAlpha() : Voidprotected Calculates all elements for this.alpha.
UpdateBeta() : Voidprotected Calculates all elements for this.beta.
UpdateParameters() : Voidprotected Updates parameters from incrementedParameters.