TMultiRegressFun Typedef

Header: Dew.Stats/Regress.h · Cross-compiler

typedef void (*TMultiRegressFun)(TVec *, TVecList *, TVec *);

Defines multiple regression function.

The type describes the vectorized regression function of several regression parameters (B array) and multiple independent variables X. The TMultiRegressFun is used in several regression procedure. The X holds a list of independent variables and the result of the function is stored in to the Y parameter. The const parameter of "y" applies to the pointer and not to the contents of the object. When performance is not an issue, the TRegressFun can be easier to use.

Examples

cpp
#include "MtxVec.h"
#include "Regress.h"

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

static void Eckerle4(TVec* B, TVecList* x, TVec* y)
{
    //B[0]/B[1] * Exp(-0.5*Sqr((X-B[2])/B[1]));

    y->Normalize((*x)[0], (*B)[2], (*B)[1]);
    y->Sqr();
    y->Scale(-0.5);
    y->Exp();
    y->Scale((*B)[0]/(*B)[1]);
}

void Example()
{
    TMultiRegressFun RegressFun = Eckerle4;
}