After some consideration, in my opinion, "lower boundary" will make more sense rather than lower limit.
For example, this is the data,
Class Frequency
1 1
2 1
3 1
4 1
Based on the data, using we can know that the median is 2.5, without calculation. If using the formula as mentioned above, $\frac{n}{2}$ will get 2, there for the class contains the median is class 2, then using $L_m$ is a lower boundary,
$median = 1.5 + \left[ \frac{2 -1}{1}\right] \times 1 = 2.5$
This doesn't make sense for using lower limit. If changing the class to
Class Frequency
1-2 1
3-4 1
5-6 1
7-8 1
Using the method above, we will get,
$median = 2.5 + \left[ \frac{2 -1}{1}\right] \times 2 = 4.5$
However, if using class limit, then we will get 5.
For the record, here are some general solution sketches that also work for high-dimensional distributions (probably too complex for the asker, though; some sort of kernel density estimation is much simpler and reasonably good):
Train an f-GAN with reverse KL divergence, without giving any random input to the generator (i.e. force it to be deterministic).
Train an f-GAN with reverse KL divergence, move the input distribution to the generator towards a Dirac delta function as training progresses, and add a gradient penalty to the generator loss function.
Train a (differentiable) generative model that can tractably evaluate an approximation of the pdf at any point (I believe that e.g. a VAE, a flow-based model, or an autoregressive model would do). Then use some type of optimization (some flavor of gradient ascent can be used if model inference is differentiable) to find a maximum of that approximation.
Best Answer
we can take their value as 0. The frequency of the succeeding model class is taken as 0 if model class is the last observation.
You can also check it from the equation as-
$l =$ lower limit of the modal class,
$h =$ size of the class interval (assuming all class sizes to be equal),
$f_1 =$ frequency of the modal class,
$f_0 =$ frequency of the class preceding the modal class,
$f_2 =$ frequency of the class succeeding the modal class.
Even if $f_2$ is $0$, the mode can be easily found by using the above expression.