Beispiel #1
0
calc_data do_cucl(int k, int n, double m, double g, QVector<double> trend_m, QVector<double> trend_s,
                  double level)
{
    QVector<QVector<double>> matrix = createMatrix(k,n,m,g,trend_m,trend_s);
    QVector<double> y;
    for(auto sample : matrix)
    {
        y.push_back(sample_mean(sample));
    }
    QVector<double> x;
    for(int i = 0; i<k;i++)
    {
        x.push_back(i);
    }

    QVector<bool> u = U(y);
    QVector<bool> l = L(y);

    int a = Asum(u,l);
    int b = Bsum(u,l);

    //Тренд средних
    double F = f(k);
    double t_stat_mean = a/F;

    double L = l_const(k);
    double t_stat_s = (b-F*F)/L;
    double t_cr = t_test_cr(k,level);
    qDebug() << "a" << a;
    qDebug() << "b" << b;
    qDebug() << "t mean" << t_stat_mean;
    qDebug() << "t s" << t_stat_s;
    qDebug() << t_cr;
    calc_data data;
    data.x=x;
    data.y=y;
    data.t_A=t_stat_mean;
    data.t_B=t_stat_s;
    data.t_cr=t_cr;
    data.A=a;
    data.B=b;
    return data;
}
Beispiel #2
0
 bool Vector::HasValidNumbersImpl() const
 {
   Number sum = Asum();
   return IsFiniteNumber(sum);
 }