  The probability density function (PDF) associated with a given set of samples
is approximated by a piecewise-linear polynomial constructed with respect to a
binning of the sample space. The kernel functions are a compactly supported
basis for the space of such polynomials, i.e. finite element hat functions,
that are centered at the bin nodes rather than at the samples, as is the case
for the standard kernel density estimation approach. This feature naturally
provides an approximation that is scalable with respect to the sample size. On
the other hand, unlike other strategies that use a finite element approach, the
proposed approximation does not require the solution of a linear system. In
addition, a simple rule that relates the bin size to the sample size eliminates
the need for bandwidth selection procedures. The proposed density estimator has
unitary integral, does not require a constraint to enforce positivity, and is
consistent. The proposed approach is validated through numerical examples in
which samples are drawn from known PDFs. The approach is also used to determine
approximations of (unknown) PDFs associated with outputs of interest that
depend on the solution of a stochastic partial differential equation.
