Click or drag to resize

NewtonRaphsonParameterCalc Class

Parameter calculation for a logistic regression model. The parameters are computed to maximize the log likelihood function for the model, using the Newton Raphson algorithm to compute the zeros of the first order partial derivaties of the log likelihood function.
Inheritance Hierarchy
SystemObject
  CenterSpace.NMath.CoreNewtonRaphsonParameterCalc

Namespace: CenterSpace.NMath.Core
Assembly: NMath (in NMath.dll) Version: 7.4
Syntax
[SerializableAttribute]
public class NewtonRaphsonParameterCalc : ILogisticRegressionCalc, 
	ICloneable

The NewtonRaphsonParameterCalc type exposes the following members.

Constructors
 NameDescription
Public methodNewtonRaphsonParameterCalc Constructs a NewtonRaphsonParameterCalc object with a default tolerance of 1e-8, and a default value of 1000 for the maximum number of iterations.
Public methodNewtonRaphsonParameterCalc(Double) Constructs a NewtonRaphsonParameterCalc object with the given tolerance. A default value of 1000 is used for the maximum number of iterations.
Public methodNewtonRaphsonParameterCalc(Int32) Constructs a NewtonRaphsonParameterCalc object with the given maximum number of iterations. A default value of 1e-8 is used for the tolerance.
Public methodNewtonRaphsonParameterCalc(Int32, Double) Constructs a NewtonRaphsonParameterCalc object with the given maximum number of iterations and tolerance.
Public methodNewtonRaphsonParameterCalc(Int32, Double, Boolean) Constructs a NewtonRaphsonParameterCalc object with the given maximum number of iterations and tolerance.
Top
Properties
 NameDescription
Public propertyCalculationMessage This string will contain information about algorithm failure, or if the regression matrix is rank deficient and pseudo inverses were used. Otherwise it will be empty.
Public propertyConverged Gets a boolean value indicating whether or not the algorithm converged.
Public propertyFailIfNotFullRank Gets and sets a boolean value indicating whether or not parameter calculation should fail if the input matrix of observed values, the regression matrix does not have full rank. The default value is false.
Public propertyInformationMatrix The information matrix is the matrix of negated second partial derivations of the log likelihood function. It is the inverse of the variance/covariance matrix for the parameter estimates.
Public propertyIsGood Gets a boolean indicating success of failure of the calculation.
Public propertyIterations Gets the number of iterations performed by the algorithm.
Public propertyMaxIterations Gets the sets the maximum number of iterations performed by the algorithm. Default is 1000.
Public propertySolutionChange Gets the change in the solution value on the last iteration of the algorithm.
Public propertyTolerance Gets and sets the tolerance used to determine convergence of the algorithm. The algorithm is judged converged when the norm of the solution change is less than Tolerance * max(B), where max(B) is the magnitude of the largest solution component. Default value is 1e-8.
Top
Methods
 NameDescription
Public methodCalculateParameters Calculate the parameters for the logistic model.
Public methodClone Creates a deep copy of self.
Top
Remarks
This algorithm is equivalent to, and sometimes refered to, as an iteratively reweighted least squares. Each iteration involves solving a linear system of the form X'WX = b, where X is the regression matrix, X' is its transpose and W is a diagonal matrix of weights. The matrix X'WX will be singular if the matrix X does not have full rank. The NewtonRaphsonParameterCalc has a property called FailIfNotFullRank which if true will fail in this case. if the property FailIfNotFullRank is false the linear system will be solved using a pseudo-inverse and the calculation will not fail.
See Also