I'm working on Stata and I have a training and a test set. For each one I have a set of variables (health conditions in my case) and their probabilities over X number of classes. So, the variables are in the rows and the classes in the columns of my dataset. I want to calculate the Jensen-Shannon divergence between the classes in the training and the classes in the test set. I see that R has a ready function of these calculations but Stata doesn't. I tried to "build" the formula in Stata but I conclude with a JSdiv for every condition and I don't know how to calculate the statistic between classes. Any help or previous experience please?