  The problem of deciding whether two samples arise from the same distribution
is often the question of interest in many research investigations. Numerous
statistical methods have been devoted to this issue, but only few of them have
considered a Bayesian nonparametric approach. We propose a nonparametric
Bayesian index (WIKS) which has the goal of quantifying the difference between
two populations $P_1$ and $P_2$ based on samples from them. The WIKS index is
defined by a weighted posterior expectation of the Kolmogorov-Smirnov distance
between $P_1$ and $P_2$ and, differently from most existing approaches, can be
easily computed using any prior distribution over $(P_1,P_2)$. Moreover, WIKS
is fast to compute and can be justified under a Bayesian decision-theoretic
framework. We present a simulation study that indicates that the WIKS method is
more powerful than competing approaches in several settings, even in
multivariate settings. We also prove that WIKS is a consistent procedure and
controls the level of significance uniformly over the null hypothesis. Finally,
we apply WIKS to a data set of scale measurements of three different groups of
patients submitted to a questionnaire for Alzheimer diagnostic.
