# Fisher distribution expressed with Chi ²

I am learning about the ANOVA test. This involves the Fisher-distribution. I know there is the ANOVA function and the FRatioDistribution. Both work well. What I am after is better understanding of the usage of the Fisher distribution. In Wikipedia Fisher-distribution in chapter Characterization there is the equation that uses the ChiĀ² distribution to express the Fisher distribution. I tried to do this, for learning purposes, also in Mathematica by this code:

fF[m_, n_, x_] :=
PDF[ChiSquareDistribution[m], x]/
m/(PDF[ChiSquareDistribution[n], x]/n)


That does not lead to the same results as FRatioDistribution. Is my ChiĀ² representation coded wrong or do I have the wrong expections?

Unfortunately, your approach is not correct since the PDF of the ratio of two random variables does not equal the ratio of their PDFs.

The right approach is as follows. Compare (Letters n and m are similar so I replace these by d1 and d2 to avoid any misunderstanding.)

PDF[TransformedDistribution[x/y/d1*d2, {x \[Distributed] ChiSquareDistribution[d1],
y \[Distributed] ChiSquareDistribution[d2]}], t]


$$\begin{cases} \frac{\text{d1}^{\text{d1}/2} \text{d2}^{\text{d2}/2} t^{\frac{\text{d1}}{2}-1} (\text{d1} t+\text{d2})^{\frac{1}{2} (-\text{d1}-\text{d2})}}{B\left(\frac{\text{d1}}{2},\frac{\text{d2 }}{2}\right)} & t>0 \\ 0 & \text{True} \end{cases}$$ with

PDF[FRatioDistribution[d1, d2], t]


$$\begin{cases} \frac{\text{d1}^{\text{d1}/2} \text{d2}^{\text{d2}/2} t^{\frac{\text{d1}}{2}-1} (\text{d1} t+\text{d2})^{\frac{1}{2} (-\text{d1}-\text{d2})}}{B\left(\frac {\text{d1}}{2} ,\frac{\text{d2 }}{2}\right)} & t>0 \\ 0 & \text{True} \end{cases}$$ See Wiki for info.

• +1. More simply, TransformedDistribution[x/y/d1*d2, {x \[Distributed] ChiSquareDistribution[d1], y \[Distributed] ChiSquareDistribution[d2]}] evaluates to FRatioDistribution[d1, d2] (at least in v12.1.1) – Bob Hanlon Oct 21 at 15:03
• @BobHanlon: Frankly saying, I think this relation is implemented as a table value. Its derivation is too complicated for Mathematica. – user64494 Oct 22 at 5:40