We recommend reading this documentation on pkgdown which renders math nicely.
https://pkg.mitchelloharawild.com/distributional/reference/dist_density.html
In the following, let \(X\) be a random variable with density
\(f_1, f_2, \ldots, f_n\) given at the values
\(x_1 < x_2 < \cdots < x_n\). Write \(w_i = x_{i+1} - x_i\) for the
width of the \(i\)th interval, and
\(s_i = (f_{i+1} - f_i) / w_i\) for the slope of the density over it.
Support: \([x_1, x_n]\)
Probability density function (p.d.f): Linear interpolation of the
given values, standardised to integrate to one:
$$
f(t) = f_i + (t - x_i) s_i \quad \text{for } x_i \le t \le x_{i+1}
$$
and \(f(t) = 0\) for \(t < x_1\) or \(t > x_n\).
Cumulative distribution function (c.d.f): The exact integral of the
interpolated density, which is piecewise quadratic. With
\(h = t - x_i\) and \(F_i = F(x_i)\),
$$
F(t) = F_i + f_i h + \frac{s_i h^2}{2}
$$
Quantile function: The inverse of the above, obtained by solving the
quadratic within the interval containing the requested probability.
Mean: Computed exactly from the interpolated density,
$$
E(X) = \sum_{i=1}^{n-1} \left[ x_i m_i + w_i^2 \left( \frac{f_i}{6} + \frac{f_{i+1}}{3} \right) \right]
$$
where \(m_i = w_i (f_i + f_{i+1}) / 2\) is the probability of the
\(i\)th interval.
Variance, skewness, and excess kurtosis: Computed
from the central moments \(\mu_k = E[(X - E(X))^k]\).
Writing \(c_i = x_i - E(X)\),
$$
\mu_2 = \sum_{i=1}^{n-1} \left[
c_i^2 m_i + \frac{c_i w_i^2 (f_i + 2 f_{i+1})}{3} +
\frac{w_i^3 (f_i + 3 f_{i+1})}{12}
\right]
$$
$$
\mu_3 = \sum_{i=1}^{n-1} \left[
c_i^3 m_i + \frac{c_i^2 w_i^2 (f_i + 2 f_{i+1})}{2} +
\frac{c_i w_i^3 (f_i + 3 f_{i+1})}{4} +
\frac{w_i^4 (f_i + 4 f_{i+1})}{20}
\right]
$$
$$
\mu_4 = \sum_{i=1}^{n-1} \left[
c_i^4 m_i + \frac{2 c_i^3 w_i^2 (f_i + 2 f_{i+1})}{3} +
\frac{c_i^2 w_i^3 (f_i + 3 f_{i+1})}{2} +
\frac{c_i w_i^4 (f_i + 4 f_{i+1})}{5} +
\frac{w_i^5 (f_i + 5 f_{i+1})}{30}
\right]
$$
Variance is \(\mu_2\), skewness is \(\mu_3 / \mu_2^{3/2}\), and
excess kurtosis is \(\mu_4 / \mu_2^2 - 3\).