  We propose boundary conditions for the diffusion equation that maintain the
initial mean and the total mass of a discrete data sample in the density
estimation process. A complete study of this framework with numerical
experiments using the finite element method is presented for the one
dimensional diffusion equation, some possible applications of this results are
presented as well. We also comment on a similar methodology for the
two-dimensional diffusion equation for future applications in two-dimensional
domains.
