Exemplo n.º 1
0
    bool is_approx(const Gaussian<OtherVariate>& other)
    {


        return fl::are_similar(mean(), other.mean()) &&
               fl::are_similar(covariance(), other.covariance());
    }
Exemplo n.º 2
0
    bool is_approx(const Gaussian<OtherVariate>& other,
                   Real eps = 1.e-9,
                   bool scale_with_size = false)
    {
        Real eps_mean = eps;
        Real eps_cov = eps;

        if (scale_with_size)
        {
            eps_mean *= mean().size();
            eps_cov *= covariance().size();
        }

        return fl::are_similar(mean(), other.mean(), eps_mean) &&
               fl::are_similar(covariance(), other.covariance(), eps_cov);
    }