Skip to content

Error with non_central_chi_squared::find_degrees_of_freedom when running with Valgrind #95

Description

@stla

Hello,

I ported the function non_central_chi_squared::find_degrees_of_freedom to a R package. My R-C++ function is just:

double find_chisq_df(double delta, double q, double p){
  // gives nu such that pchisq(q, nu, delta) = p
  return non_central_chi_squared::find_degrees_of_freedom(delta, q, p);
}

When an example is executed under Valgrind, this error is generated:

Error in function boost::math::non_central_chi_squared_distribution<long double>::non_central_chi_squared_distribution(long double,long double): Degrees of freedom argument is -nan, but must be > 0 !

Would you have an idea of the cause? I'm really not fluent in C++.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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