Consider the unit interval $I$ with a continuous probability measure $\mu$, and consider a smooth random variable $f:I\to \mathbb{R}$. We can define its cumulative distribution function and probability density function in the regular way. There is a number of known way to obtain the latter two functions using histograms, kernel smoothing and so on. Both methods rely on the statistically motivated assumption that we randomly sample $f$.

Assume now that we have sampled $f$ on the Gauss-Legendre quadrature point $\lbrace \alpha_{i}^N \rbrace_{i=1}^N$, which are the roots of orthogonal polynomials w.r.t. $\mu$, $p_n (\alpha)$. We can now obtain an $N$-th order approximation of $f$ using $p_n$, $$ f \approx \sum\limits_{n=0}^{N-1} p_n (\alpha) \hat{f}(n) \, .$$

**My Question:** Is there an elegant way of approximating the CDF and/or PDF of $f$ only with the spectral coefficients $\hat{f} (n)$ and the value at tha quadrature point $f(\alpha _j ^N )$?

Note that generally speaking, $f$ is not the same as its PDF.