Regress::NLinRegress Function

Overload List

#SignatureDescription
1int NLinRegress(TVec *X, TVec *Y, TRegressFun RegFun, TDeriveProc DeriveProc, TVec *B, TOptMethod Method, TOptStopReason &StopReason, TVec *Weights = null, TVec *YCalc = null, bool SoftSearch = false, int MaxIter = 500, double Tol = 0.00000001, double GradTol = 0.00000001, tStrings *Verbose = null);General non-linear regression.
2int NLinRegress(TVec *X, TVec *Y, TRegressFun RegFun, TDeriveProc DeriveProc, TVec *B, TVec *BLowerB, TVec *BUpperB, TOptMethod Method, TOptStopReason &StopReason, TVec *Weights = null, TVec *YCalc = null, bool SoftSearch = false, int MaxIter = 500, double Tol = 0.00000001, double GradTol = 0.00000001, tStrings *Verbose = null);Non-linear regression with lower and upper bounds.
3int NLinRegress(TVecList *X, TVec *Y, TMultiRegressFun RegFun, TMultiDeriveProc DeriveProc, TVec *B, TOptMethod Method, TOptStopReason &StopReason, TVec *Weights = null, TVec *YCalc = null, bool SoftSearch = false, int MaxIter = 500, double Tol = 0.00000001, double GradTol = 0.00000001, tStrings *Verbose = null);General vectorized non-linear regression.
4int NLinRegress(TVecList *X, TVec *Y, TMultiRegressFun RegFun, TMultiDeriveProc DeriveProc, TVec *B, TVec *BLowerB, TVec *BUpperB, TOptMethod Method, TOptStopReason &StopReason, TVec *Weights = null, TVec *YCalc = null, bool SoftSearch = false, int MaxIter = 500, double Tol = 0.00000001, double GradTol = 0.00000001, tStrings *Verbose = null);Non-linear regression with lower and upper bounds.

Overload 1: int NLinRegress(TVec *X, TVec *Y, TRegressFun RegFun, TDeriveProc DeriveProc, TVec *B, TOptMethod Method, TOptStopReason &StopReason, TVec *Weights = null, TVec *YCalc = null, bool SoftSearch = false, int MaxIter = 500, double Tol = 0.00000001, double GradTol = 0.00000001, tStrings *Verbose = null);

General non-linear regression.

#NameTypeDescription
1XTVec *Vector of the independent variable.
2YTVec *Vector of dependent variable.
3RegFunTRegressFunRegression function.
4DeriveProcTDeriveProcProcedure to calculate the derivatives of RegFun. You can define the exact derivative or use Regress::NumericDerive routine as numerical approximation.
5BTVec *Holds initial estimate for regression parameters. After the call to NLinRegress b returns calculated regression parameters.
6MethodTOptMethodDefines which optimization method will be used to find regression parameters (see MtxVec.hlp TOptMethod type to learn more about this).
7StopReasonTOptStopReason &Returns why regression parameters search stopped (see MtxVec.hlp TOptStopReason type to learn more about different stop reasons).
8Weights = nullTVec *Weights (optional).
9YCalc = nullTVec *Returns calculated values (optional).
10SoftSearch = falseboolIf true, internal line search algoritm will use soft line search method. Set this parameter to true if you're using numerical approximation for derivative. If this parameter is set to false, internal line search algorithm will use exact line search method. Set this parameter to false if you're using *exact* derivative.
11MaxIter = 500intMaximum allowed numer of allowed iterations.
12Tol = 0.00000001doubleDesired regression parameters tolerance.
13GradTol = 0.00000001doubleMinimum allowed gradient C-Norm.
14Verbose = nulltStrings *If assigned, stores Fun, evaluated at each iteration step. Optionally, you can also pass TOptControl object to the Verbose parameter. This allows the optimization procedure to be interrupted from another thread and optionally also allows logging and iteration count monitoring.

Returns: Number of iterations needed to calculate regression parameters with specified tolerance.

Remarks:

The routine fits equations to data by minimizing the sum of squared residuals :

SS = Sum [y(k) - ycalc(k)]^2 ,

where y(k) and ycalc(k) are respectively the observed and calculated value of the dependent variable for observation k. ycalc(k) is a function of the regression parameters b(0), b(1) ... Here the observed values obey the following (non-linear) equation:

y(k) = RegFun[x(k), b(0), b(1), ... ]
Y = RegFun[X,b(0),b(1), ...]

where RegFun is the regression function and b(0),..b(i) are the regression parameters.

See Also: Regress::NumericDerive
Declared in Dew::Stats::Units::Regress · Dew.Stats/Units.Regress.h · Cross-compiler

Overload 2: int NLinRegress(TVec *X, TVec *Y, TRegressFun RegFun, TDeriveProc DeriveProc, TVec *B, TVec *BLowerB, TVec *BUpperB, TOptMethod Method, TOptStopReason &StopReason, TVec *Weights = null, TVec *YCalc = null, bool SoftSearch = false, int MaxIter = 500, double Tol = 0.00000001, double GradTol = 0.00000001, tStrings *Verbose = null);

Non-linear regression with lower and upper bounds.

#NameTypeDescription
1XTVec *Vector of the independent variable.
2YTVec *Vector of the dependent variable.
3RegFunTRegressFunRegression function.
4DeriveProcTDeriveProcProcedure to calculate the derivatives of RegFun. You can define the exact derivative or use Regress::NumericDerive routine as numerical approximation.
5BTVec *Holds initial estimate for regression parameters. After the call to NLinRegress b returns calculated regression parameters.
6BLowerBTVec *Holds lower bounds for regression parameters. If there are no lower bounds, set BLowerB values to -INF.
7BUpperBTVec *Holds upper bounds for regression parameters. If there are no upper bounds, set BUpperB values to +INF.
8MethodTOptMethodDefines which optimization method will be used to find regression parameters (see MtxVec.hlp TOptMethod type to learn more about this).
9StopReasonTOptStopReason &Returns why regression parameters search stopped (see MtxVec.hlp TOptStopReason type to learn more about different stop reasons).
10Weights = nullTVec *Weights (optional).
11YCalc = nullTVec *Returns calculated values (optional).
12SoftSearch = falseboolIf true, internal line search algoritm will use soft line search method. Set this parameter to true if you're using numerical approximation for derivative. If this parameter is set to false, internal line search algorithm will use exact line search method. Set this parameter to false if you're using *exact* derivative.
13MaxIter = 500intMaximum allowed numer of allowed iterations.
14Tol = 0.00000001doubleDesired regression parameters tolerance.
15GradTol = 0.00000001doubleMinimum allowed gradient C-Norm.
16Verbose = nulltStrings *If assigned, stores Fun, evaluated at each iteration step. Optionally, you can also pass TOptControl object to the Verbose parameter. This allows the optimization procedure to be interrupted from another thread and optionally also allows logging and iteration count monitoring.

Returns: Number of iterations needed to calculate regression parameters with specified tolerance.

Remarks:

General non-linear regression with lower and upper bounds for regression coefficients.

Declared in Dew::Stats::Units::Regress · Dew.Stats/Units.Regress.h · Cross-compiler

Overload 3: int NLinRegress(TVecList *X, TVec *Y, TMultiRegressFun RegFun, TMultiDeriveProc DeriveProc, TVec *B, TOptMethod Method, TOptStopReason &StopReason, TVec *Weights = null, TVec *YCalc = null, bool SoftSearch = false, int MaxIter = 500, double Tol = 0.00000001, double GradTol = 0.00000001, tStrings *Verbose = null);

General vectorized non-linear regression.

#NameTypeDescription
1XTVecList *List of vectors of independent variable(s).
2YTVec *Vector of the dependent variable.
3RegFunTMultiRegressFunRegression function.
4DeriveProcTMultiDeriveProcProcedure to calculate the derivatives of RegFun. You can define the exact derivative or use Regress::MultiNumericDerive routine as numerical approximation.
5BTVec *Holds initial estimate for regression parameters. After the call to NLinRegress b returns calculated regression parameters.
6MethodTOptMethodDefines which optimization method will be used to find regression parameters (see MtxVec.hlp TOptMethod type to learn more about this).
7StopReasonTOptStopReason &Returns why regression parameters search stopped (see MtxVec.hlp TOptStopReason type to learn more about different stop reasons).
8Weights = nullTVec *Weights of X values (optional).
9YCalc = nullTVec *Returns calculated values (optional).
10SoftSearch = falseboolIf true, internal line search algoritm will use soft line search method. Set this parameter to true if you're using numerical approximation for derivative. If this parameter is set to false, internal line search algorithm will use exact line search method. Set this parameter to false if you're using *exact* derivative.
11MaxIter = 500intMaximum allowed numer of allowed iterations.
12Tol = 0.00000001doubleDesired regression parameters tolerance.
13GradTol = 0.00000001doubleMinimum allowed gradient C-Norm.
14Verbose = nulltStrings *If assigned, stores Fun, evaluated at each iteration step. Optionally, you can also pass TOptControl object to the Verbose parameter. This allows the optimization procedure to be interrupted from another thread and optionally also allows logging and iteration count monitoring.

Returns: Number of iterations needed to calculate regression parameters with specified tolerance.

Remarks:

The routine fits equations to data by minimizing the sum of squared residuals :

SS = Sum [y(k) - ycalc(k)]^2 ,

where y(k) and ycalc(k) are respectively the observed and calculated value of the dependent variable for observation k. ycalc(k) is a function of the regression parameters b(0), b(1) ... Here the observed values obey the following (non-linear) equation:

y(k) = RegFun[x(k), b(0), b(1), ... ]
Y = RegFun[X,b(0),b(1), ...]

where RegFun is the regression function and b(0),..b(i) are the regression parameters.

See Also: Regress::NumericDerive
Declared in Dew::Stats::Units::Regress · Dew.Stats/Units.Regress.h · Cross-compiler

Overload 4: int NLinRegress(TVecList *X, TVec *Y, TMultiRegressFun RegFun, TMultiDeriveProc DeriveProc, TVec *B, TVec *BLowerB, TVec *BUpperB, TOptMethod Method, TOptStopReason &StopReason, TVec *Weights = null, TVec *YCalc = null, bool SoftSearch = false, int MaxIter = 500, double Tol = 0.00000001, double GradTol = 0.00000001, tStrings *Verbose = null);

Non-linear regression with lower and upper bounds.

#NameTypeDescription
1XTVecList *List of vectors of independent variable(s).
2YTVec *Vector of dependent variable.
3RegFunTMultiRegressFunRegression function.
4DeriveProcTMultiDeriveProcProcedure to calculate the derivatives of RegFun. You can define the exact derivative or use Regress::NumericDerive routine as numerical approximation.
5BTVec *Holds initial estimate for regression parameters. After the call to NLinRegress b returns calculated regression parameters.
6BLowerBTVec *Holds lower bounds for regression parameters. If there are no lower bounds, set BLowerB values to -INF.
7BUpperBTVec *Holds upper bounds for regression parameters. If there are no upper bounds, set BUpperB values to +INF.
8MethodTOptMethodDefines which optimization method will be used to find regression parameters (see MtxVec.hlp TOptMethod type to learn more about this).
9StopReasonTOptStopReason &Returns why regression parameters search stopped (see MtxVec.hlp TOptStopReason type to learn more about different stop reasons).
10Weights = nullTVec *Weights (optional).
11YCalc = nullTVec *Returns calculated values (optional).
12SoftSearch = falseboolIf true, internal line search algoritm will use soft line search method. Set this parameter to true if you're using numerical approximation for derivative. If this parameter is set to false, internal line search algorithm will use exact line search method. Set this parameter to false if you're using *exact* derivative.
13MaxIter = 500intMaximum allowed numer of allowed iterations.
14Tol = 0.00000001doubleDesired regression parameters tolerance.
15GradTol = 0.00000001doubleMinimum allowed gradient C-Norm.
16Verbose = nulltStrings *If assigned, stores Fun, evaluated at each iteration step. Optionally, you can also pass TOptControl object to the Verbose parameter. This allows the optimization procedure to be interrupted from another thread and optionally also allows logging and iteration count monitoring.

Returns: Number of iterations needed to calculate regression parameters with specified tolerance.

Remarks:

General non-linear regression with lower and upper bounds for regression coefficients.

Declared in Dew::Stats::Units::Regress · Dew.Stats/Units.Regress.h · Cross-compiler