Since commit 826ec94, PDL::Stats can return negative variance, and stdev of NA, for some cases due to floating point precision.
perl -MPDL -MPDL::Stats -E'my $x = pdl [(0.001) x 6]; say $x->var; say $x->stdv'
-1.41172157875717e-22
NaN
The easiest solution is to set the variance to zero when it is negative.
Unless there is a better way I'll prep a PR with tests in the next few days.