Why are there two formulas to calculate the mode of grouped data ?
probability - How does one find the mode of a distribution without counting manually? - Mathematics Stack Exchange
How do you find the 'mode' of samples from a continuous data set?
How to find the mode for continuous data in R (sales of products)?
What is no mode condition?
How to find mode for given set of values?
What is mode in statistics?
Videos
So I wanted to practice how to find the mode of grouped datas but my teacher’s studying contents are a mess, so I went on YouTube to practice but most of the videos I found were using a completely different formula from the one I learned in class (the first pic’s formula is the one I learned in class, the second image’s one is the most used from what I’ve seen). I tried to use both but found really different results. Can someone enlighten me on how is it that there are two different formulas and are they used in different contexts ? Couldn’t find much about this on my own unfortunately.
The mode of a $sample$ is the the most frequently occurring number or category (it it exists). If I die is rolled 5 times and we get faces 1,1,2,3,4,then 1 is the 'modal face' observed. But if we get faces 1,1,2,3,3, then there is no mode. (Informally, some texts might speak of a 'double mode'.)
The mode of a $distribution$ is the value $\xi$ at which the PDF achieves a maximum (if there is such a value). Thus, $Unif(0, 1)$ does not have a mode, but $Norm(\mu = 100, \sigma=15)$ has a mode (same as the mean) at $\mu = \xi = 100.$
In a right-skewed distribution, it is fairly common to have $\xi > \eta > \mu,$ where $\eta$ is the median. In particular, $Gamma(shape=5, scale=1)$ has $\xi = 4$ (by differential calculus), $\eta = 4.670909$ (by numerical integration), and $\mu = 5.$ (The notation $\mu$ is standard, $\eta$ is often seen, and there seems to be no standard notation for the mode.)
In a large sample from a continuous distribution, sometimes one tries to 'smooth' a histogram of the data to estimate the location of the mode of the population distribution. Based on 100,000 observations from $Gamma(5, 1)$, the figure below suggests that the mode of the population is near 4. (However, technically, no two observations are equal, except possibly as a result of rounding.) The purple curve is from the default density estimator in R.
For continuous densities, you use calculus (with which I am sure that you are familiar).
Let $X$ follow a Gamma distribution with density $$f_X(x) = \frac{1}{\Gamma(k)\theta^k} x^{k-1}e^{- x/\theta}.$$
Next, find the critical points $$0 =f_X'(x) = \frac{1}{\Gamma(k)\theta^k}\left[(k-1)x^{k-2}e^{-x/\theta}+e^{-x/\theta}(-1/\theta)x^{k-1}\right]$$
I skip a few steps and will let you confirm that the maximum is attained when $$0 = x^{k-2}\left(k-1+\frac{-1}{\theta}x\right).$$
This gives the mode at $$x = \theta(k-1).$$
I am looking for the 'mode' from a source where I am not expecting exactly duplicate values. My approach is to treat each sample as a normal distribution with a mean of the sample value and a constant standard deviation. Then take the sum of the PDF's of those distributions as my new PDF, divided by the number of samples. The mode should be the maxima of this function. However, I am finding it difficult to find this maxima, given that the derivative of the pdf of the sum of a number of standard distributions is not easily solvable. Is there a way to solve this analytically, or am I going to have to come up with a numerical solution? Using Newton-Raphson seems like it will have problems, as it tends to just find the nearest zero to your initial guess, and this derivative is going to have a lot of zeroes...