Skip to content

Initial implementation of fisher_f degrees of freedom finder#1407

Open
JacobHass8 wants to merge 4 commits into
boostorg:developfrom
JacobHass8:f-find-df
Open

Initial implementation of fisher_f degrees of freedom finder#1407
JacobHass8 wants to merge 4 commits into
boostorg:developfrom
JacobHass8:f-find-df

Conversation

@JacobHass8

@JacobHass8 JacobHass8 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

This is a simple copy and paste from the previous PR . I still need to implement a couple of tests. One set of tests to check if the function works as intended and the other to see if we properly catch the case when there are multiple degrees of freedom.

As noted above, most of this is copy and pasted from the non_central_f distribution implementation of these same functions. I wonder if it would be more concise to program a special case of the non_central_f functions when nc=0. When nc=0 we can just use the fisher_f distribution? Now that I type it out, I think I might go with that.

Closes #1305.

@JacobHass8

JacobHass8 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Hmmm, I'm not sure why this is failing on some of the platforms. The error message is

../../../boost/math/distributions/fisher_f.hpp: In static member function ‘static RealType boost::math::fisher_f_distribution<RealType, Policy>::find_v1(RealType, RealType, RealType)’:
../../../boost/math/distributions/fisher_f.hpp:58:34: error: ‘find_degrees_of_freedom_f’ is not a member of ‘boost::math::detail’
   58 |       eval_type result = detail::find_degrees_of_freedom_f(
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../boost/math/distributions/fisher_f.hpp: In static member function ‘static RealType boost::math::fisher_f_distribution<RealType, Policy>::find_v1(const boost::math::complemented3_type<A, B, C>&)’:
../../../boost/math/distributions/fisher_f.hpp:81:34: error: ‘find_degrees_of_freedom_f’ is not a member of ‘boost::math::detail’
   81 |       eval_type result = detail::find_degrees_of_freedom_f(
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../boost/math/distributions/fisher_f.hpp: In static member function ‘static RealType boost::math::fisher_f_distribution<RealType, Policy>::find_v2(RealType, RealType, RealType)’:
../../../boost/math/distributions/fisher_f.hpp:103:34: error: ‘find_degrees_of_freedom_f’ is not a member of ‘boost::math::detail’
  103 |       eval_type result = detail::find_degrees_of_freedom_f(
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../boost/math/distributions/fisher_f.hpp: In static member function ‘static RealType boost::math::fisher_f_distribution<RealType, Policy>::find_v2(const boost::math::complemented3_type<A, B, C>&)’:
../../../boost/math/distributions/fisher_f.hpp:126:34: error: ‘find_degrees_of_freedom_f’ is not a member of ‘boost::math::detail’
  126 |       eval_type result = detail::find_degrees_of_freedom_f(
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~

but find_degrees_of_freedom_f is defined in non_central_f.hpp which I included in fisher_f.hpp. @jzmaddock do you have any ideas?

@jzmaddock

Copy link
Copy Markdown
Collaborator

I suspect you've created a cyclic include - a really bad thing and all kinds of badness can ensue! If I'm right and the non-central-f depends on the regular f (which I suspect it should), then either moving the common code into fisher_f.hpp or a common shared header of it's own would do it.

@JacobHass8

Copy link
Copy Markdown
Contributor Author

I suspect you've created a cyclic include - a really bad thing and all kinds of badness can ensue! If I'm right and the non-central-f depends on the regular f (which I suspect it should), then either moving the common code into fisher_f.hpp or a common shared header of it's own would do it.

Hmmm, unfortunately I think I'm going to have to duplicate the code. I need the fisher and non-central fisher distributions to be able to access the function but both distributions need to used to create the function. Even putting it in a separate file would require cyclic including.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: more inverses for distribution CDFs

2 participants