Could you please apply the attached patch to correct the bug (3519563) I reported a while ago about incorrect kernel density calculation in Gnuplot ?
I have applied your patch to both 4.6 and 4.7
The calculation of the mean was clearly wrong.
However, I'd like someone to confirm whether the kernel density function wants sigma or estimated standard deviation. Given that gnuplot is usually given experimental samples, the original division by (N-1) may be correct.