probability icon indicating copy to clipboard operation
probability copied to clipboard

there is no f distribution

Open breadbread1984 opened this issue 3 years ago • 3 comments

f distribution which is frequently used in f test is not available in tfp.distributions. please support this distribution.

breadbread1984 avatar Feb 12 '22 15:02 breadbread1984

In a pinch, if all you wanted was log_prob/sampling, you could do:

f_dist = tfb.Chain([tfb.Scale(d2 / d1), tfb.Exp()])(tfd.SigmoidBeta(d1 / 2, d2 / 2))

but that won't have the analytic statistics (mean, variance etc) and I don't know how good its numerics will be either.

We certainly could have this distribution implemented properly. Contributions welcome.

SiegeLordEx avatar Feb 15 '22 21:02 SiegeLordEx

Happy to have a look at this one!

RonsenbergVI avatar Feb 16 '22 10:02 RonsenbergVI

https://github.com/tensorflow/probability/blob/main/tensorflow_probability/python/distributions/sigmoid_beta.py should be a good template to follow, as it's closely related to the f distribution (as shown by my snippet). Obviously you wouldn't use the snippet directly, and use the log-prob etc formulas directly. Maybe call it FisherSnedecor

SiegeLordEx avatar Feb 16 '22 23:02 SiegeLordEx