KDE will fail if all the elements of the input array are nan or inf or exactly the same number, or very short array (less than 3 or so). trace_plot will fail for those case too, only variables before the failing point will be plotted. I will send a PR to better deal with these cases.