 <p>Using:</p> <pre><code>&gt; require(KernSmooth) Loading required package: KernSmooth KernSmooth 2.23 loaded Copyright M. P. Wand 1997-2009 &gt; mod &lt;- bkde(faithful$waiting) &gt; str(mod) List of 2 $ x: num [1:401] 22.7 23 23.2 23.4 23.7 ... $ y: num [1:401] 3.46e-08 1.17e-07 1.40e-07 1.68e-07 2.00e-07 ... </code></pre> <p>is this not efficient enough?</p> <pre><code>&gt; which(mod$y == max(mod$y)) [1] 245 </code></pre> <p><code>density()</code> does something similar, but it returns 512 values of the density evaluate at 512 regular intervals of <code>x</code>.</p> <p>In both functions the number of points returned can be controlled. See argument <code>gridsize</code> in <code>bkde()</code> and <code>n</code> in <code>density()</code>. Of course, the precision of the approach does depend on the density of points at which the KDE is estimated so you won;t want to set this too low.</p> <p>My gut tells me you may spend an awful lot more time thinking up and implementing a more efficient approach than you would spend just going with the above simple solution.</p>