You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Classes > TMtxMultiNonLinReg Class > TMtxMultiNonLinReg Properties > TMtxMultiNonLinReg.RegressFunction Property
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
TMtxMultiNonLinReg.RegressFunction Property

Defines the regression function of several regression parameters.

Syntax
C#
Visual Basic
public TMultiRegressFun RegressFunction;

Defines the regression function of several regression parameters B and independent variable X.

In the following example we define general polynomial of second degree (three parameters) and also the procedure for derivatives:

// y=b0*x*x + b1*x + b2 i.e. parabola void SimpleParabola(TVec b, TVecList x, TVec y) { // return b[0]*x*x + b[1]*x + b[2]; y.Sqr(x[0]); y.Scale(b[0)); y.AddScaled(x[0], b[1]); y.Add(b[2]); } // procedure for derivatives void SimplePabolaDeriv(TRegressFun RegressFun, TVecList x, TVec y, double[] pars, TVecList Grad) { Grad[0].Sqr(x[0]); // Grad[0] := x*x; Grad[1].Copy(x[0]); // Grad[1] := x; Grad[2].Size(x[0]); // Grad[2] := 1; Grad[2].SetVal(1); } void Example(); { // ... Regress.MtxNonLinReg1.RegressFunction = SimpleParabola; Regress.MtxNonLinReg1.DeriveProcedure = SimpleParabolaDeriv; }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!