Skip to content

Noncentral t distribution CDF can be negative #1430

Description

@dschmitz89

Reproducer: another edge case for the noncentral T distribution CDF that returns a negative value of -2.16994e-121.

#include <boost/math/distributions/non_central_t.hpp>
#include <iostream>

int main() {
    double df = 1000.0; // degrees of freedom
    double nc = 23.0; // non-centrality parameter
    double x = -1.0; // value to evaluate the CDF at
    double p = boost::math::cdf(boost::math::non_central_t_distribution<double>(df, nc), x);
    std::cout << "x: " << x << ", df: " << df << ", nc: " << nc << ", p: " << p << std::endl;
    return 0;
}

This came up in scipy/scipy#25470.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions