update Jensen-Shannon metric function