Ejemplo n.º 1
0
int
Statistic::ajustement(QVector<double> &Xi,QVector<double> &Yi,int n)
{
        QVector<double> r(5),lnXi(100),lnYi(100),logXi(100),logYi(100),invXi(100);

        //corrélation pour linéaire

        r[0]=val_abs(corr(Xi,Yi,n));

        //corrélation pour exponetielle

        lntab(Yi,lnYi,n);
        r[1]=val_abs(corr(Xi,lnYi,n));

        //corrélation pour puissance

        logtab(Xi,logXi,n);
        logtab(Yi,logYi,n);
        r[2]=val_abs(corr(logXi,logYi,n));

        //corrélation pour inverse

        invtab(Xi,invXi,n);
        r[3]=val_abs(corr(invXi,Yi,n));

        //corrélation pour logarithmique

        lntab(Xi,lnXi,n);
        r[4]=val_abs(corr(lnXi,Yi,n));

        //Test du meilleur ajustement

        return rmax(r);
}
Ejemplo n.º 2
0
int HrPwWindow::fit(QVector<double> &Xi,QVector<double> &Yi,int n)
{
        QVector<double> r(5),lnXi(100),lnYi(100),logXi(100),logYi(100),invXi(100);

        //Linear correlation

        r[0]=val_abs(corr(Xi,Yi,n));

        //Exponential correlation

        lnarray(Yi,lnYi,n);
        r[1]=val_abs(corr(Xi,lnYi,n));

        //Power correlation

        logarray(Xi,logXi,n);
        logarray(Yi,logYi,n);
        r[2]=val_abs(corr(logXi,logYi,n));

        //Inverse correlation

        invarray(Xi,invXi,n);
        r[3]=val_abs(corr(invXi,Yi,n));

        //Logarithmic correlation

        lnarray(Xi,lnXi,n);
        r[4]=val_abs(corr(lnXi,Yi,n));

        //Best fit test

        return rmax(r);
}