3
$\begingroup$

I am looking for a simple approximation to the median of the (simply) non-central F distribution with parameters dlnum, dldenominator, and ncp, the non-centrality parameter. Clearly, there is no closed-form expression; an approximation if fine. Thanks.

$\endgroup$
2
$\begingroup$

Here is an approach (as opposed to a complete answer unfortunately) to obtain a good approximation with maybe a limited amount of programming.

It appears that for any fixed values of the two degrees of freedom parameters (call these $\nu_1$ and $\nu_2$), the median for the noncentral F distribution is a close to a linear function of $\lambda$ (the noncentrality parameter). To support that observation consider the Mathematica code below. (And from your profile I see that you use Mathematica.)

 Manipulate[
 Plot[N[InverseCDF[NoncentralFRatioDistribution[v1, v2, \[Lambda]], 1/2]], 
   {\[Lambda], 0, max\[Lambda]}, 
   PlotLabel -> Style["\[Nu]1=" <> ToString[v1] <> "  \[Nu]2=" <> ToString[v2], Bold, 24], 
   Frame -> True, 
   FrameLabel -> (Style[#, Bold, 18] &) /@ {"Noncentrality parameter (\[Lambda])", "Median"}, 
   ImagePadding -> {{50, 10}, {50, 10}}, 
   PlotRange -> {{0, max\[Lambda]}, {0, 5}}],
 {{v1, 1, "\[Nu]1"}, 1, 100, 1, Appearance -> "Labeled"}, 
 {{v2, 1, "\[Nu]2"}, 1, 100, 1, Appearance -> "Labeled"}, 
 {{max\[Lambda], 20, "Maximum \[Lambda]"}, 1, 100, 1, Appearance -> "Labeled"}, 
 TrackedSymbols :> {v1, v2, max\[Lambda]}]

Noncentral F noncentrality vs median

Moving the sliders will show that given $\nu_1$ and $\nu_2$ the relationship remains fairly linear. So it would seem that one could generate a grid of values for $\nu_1$, $\nu_2$, and $\lambda$ and then interpolate/extrapolate where desired.

Alternatively, one could probably come up with a function that estimates the slope and intercept from $\nu_1$ and $\nu_2$ which would be a much more compact approximation. Such a function will look something like that for the mean which is a linear function of $\lambda$:

$$\mu={{\nu_2}\over{\nu_2-2}}+\lambda {{\nu_2}\over{\nu_1(\nu_2-2)}}$$

(at least for large values of $\nu_1$ and $\nu_2$).

$\endgroup$
  • $\begingroup$ Thanks for this approach, it does give me a strong direction to further deepen the relation. $\endgroup$ – Denis Cousineau Mar 7 '18 at 14:02
0
$\begingroup$

Why code your own if a function with a lot of testing is available?

R:

qf(0.5, 3, 12, 1)

Mathematica:

N[InverseCDF[NoncentralFRatioDistribution[3, 12, 1], 1/2]]

My suggestion about using what's available besides being well-tested, is that many of the algorithms that you'll find will likely work only for large values of the degrees of freedom. So that means multiple algorithms depending on the size of the degrees of freedom. Also, many of the algorithms will be for the cumulative distribution function when means you'll need to make a guess as to the median and have an iterative routine to pin that down.

Maybe the best places to start are Abramowitz and Stegun "Handbook of Mathematical Functions" or Johnson and Kotz "Univariate Distributions".

$\endgroup$
  • 3
    $\begingroup$ @ jimB: Because. Because I want to inverse the relation to get a heuristic relation between the median and the parameter; because I want a faster-running function to run 10^8 simulations; because I want to provide a solution that is not software-dependent. Because. Users of StackExchange should not have to justify their questions. $\endgroup$ – Denis Cousineau Mar 6 '18 at 14:04
  • $\begingroup$ Denis, I don't think JimB was challenging your question. He offers a plausible interpretation and a simple solution to the question as interpreted. The clarifications in your comment are helpful and welcome, but please put them more prominently in your post itself so that all readers will better understand what you are looking for. $\endgroup$ – whuber Mar 6 '18 at 14:11
  • $\begingroup$ @whuber JimB's answer strikes me precisely as a challenge to the OP's question, which seems very clear. While JimB's intentions were surely intended as helpful, they seem to assume that the OP must not know his own motivations. $\endgroup$ – Alexis Mar 6 '18 at 17:03
  • 1
    $\begingroup$ @Alexis My response was an attempt to be both helpful and challenging which I think we should do more often when the question appears to lack details. For example, the OP doesn't mention what particular language in which the algorithm would be implemented. That seems important as some respondent might know of a package that already implements the desired function. Responses that don't address what's in the OP's mind hopefully suggest that additional clarity or details are needed. $\endgroup$ – JimB Mar 6 '18 at 17:43
  • $\begingroup$ JimB, I am of two minds about your answer. I agree that frame challenges can useful. Your point about languages is a good one. But I think there's also something to be said about not opening an answer with the challenge: answer part 1 – here's my take plus some good resources; answer part 2 – the precise solution to your question will vary depending on circumstances, have you considered a, b, c. <—This approach seems more inviting to (especially new) folks asking the questions in contrast to opening with "why are you asking this?" $\endgroup$ – Alexis Mar 6 '18 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.