  We propose a flexible method for estimating luminosity functions (LFs) based
on kernel density estimation (KDE), the most popular nonparametric density
estimation approach developed in modern statistics, to overcome issues
surrounding binning of LFs. One challenge in applying KDE to LFs is how to
treat the boundary bias problem, since astronomical surveys usually obtain
truncated samples predominantly due to the flux-density limits of surveys. We
use two solutions, the transformation KDE method ($\hat{\phi}_{\mathrm{t}}$),
and the transformation-reflection KDE method ($\hat{\phi}_{\mathrm{tr}}$) to
reduce the boundary bias. We develop a new likelihood cross-validation
criterion for selecting optimal bandwidths, based on which, the posterior
probability distribution of bandwidth and transformation parameters for
$\hat{\phi}_{\mathrm{t}}$ and $\hat{\phi}_{\mathrm{tr}}$ are derived within a
Markov chain Monte Carlo (MCMC) sampling procedure. The simulation result shows
that $\hat{\phi}_{\mathrm{t}}$ and $\hat{\phi}_{\mathrm{tr}}$ perform better
than the traditional binned method, especially in the sparse data regime around
the flux-limit of a survey or at the bright-end of the LF. To further improve
the performance of our KDE methods, we develop the transformation-reflection
adaptive KDE approach ($\hat{\phi}_{\mathrm{tra}}$). Monte Carlo simulations
suggest that it has a good stability and reliability in performance, and is
around an order of magnitude more accurate than using the binned method. By
applying our adaptive KDE method to a quasar sample, we find that it achieves
estimates comparable to the rigorous determination by a previous work, while
making far fewer assumptions about the LF. The KDE method we develop has the
advantages of both parametric and non-parametric methods.
