TMtxMultiNonLinReg::RegressFunction Property

__declspec(property(get = GetRegressFunction, put = SetRegressFunction)) TMultiRegressFun RegressFunction;

Defines the regression function of several regression parameters.

Read: TMultiRegressFun GetRegressFunction();
Write: void SetRegressFunction(const TMultiRegressFun Value);
Remarks:

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

Examples
#include "MtxVec.h"
#include "Regress.h"
#include "StatTools.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;

// y=b0*x*x + b1*x + b2 i.e. parabola
static 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
static void SimpleParabolaDeriv(const TMultiRegressFun RegressFun, TVecList* x, TVec* y, TVec* 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()
{
    TMtxMultiNonLinReg* MtxNonLinReg1 = new TMtxMultiNonLinReg(nullptr);
    // ...
    MtxNonLinReg1->RegressFunction = SimpleParabola;
    MtxNonLinReg1->DeriveProcedure = SimpleParabolaDeriv;
    delete MtxNonLinReg1;
}
See Also: TMtxMultiNonLinReg::DeriveProcedure
Declared in Dew::Stats::TMtxMultiNonLinReg · Dew.Stats/StatTools.h · Cross-compiler