In this chapter, we have discussed the properties of the probability density functions and how they can be employed to compute actual probabilities and relative likelihoods. We have seen how to create a histogram, which is the simplest method to represent the frequency of values after grouping them into predefined bins. As histograms have some important limitations (they are very discontinuous and it's difficult to find out the optimal bin size), we have introduced the concept of kernel density estimation, which is a slightly more sophisticated way to estimate a density using smooth functions.
We have analyzed the properties of the most common kernels (Gaussian, Epanechnikov, Exponential, and Uniform) and two empirical methods that can be employed to find out the best bandwidth for each dataset. Using such a technique, we have tried to solve a very simple univariate...