# Population stability index - division by zero

Population stability index quantifies the change of a distribution of a variable by comparing data samples in two time periods. It is very commonly used to measure shifts in scores.

It is calculated as follows:
1) The sample from base period is discretized. Usually it is partitioned into deciles
2) The sample from target period is discretized using the same intervals as in first step
$PSI = \sum_{i} (A_{i} - B_{i}) \cdot ln(\frac{A_{i}}{B_{i}})$
Where:
$A_{i}$ - share of i-th bin in base period. $B_{i}$ - share of i-th bin in target period.

Question: What should be done when one of the bins from target sample is empty?

• I usually join the class with no elements with an adjacent class that has elements. Hope that helps. C. – CSands Dec 13 '13 at 12:49
• Welcome to the list. This is more like a comment than a full answer, so I converted it. If you'd like to expand it (e.g. by saying why you do this, how it works etc.) then it could be an answer. – Peter Flom Dec 13 '13 at 12:53
• @CSands: Thanks for answer, but if I understood correctly then in case when all observations from ninth decile shifts to the tenth decile your solution would join ninth and tenth decile and PSI would be 0, where in reality the distribution has changed significantly. Am I right? – Tomek Tarczynski Dec 13 '13 at 13:54
• Rather than using bins, is it possible to use density estimates and replace the sum with an integral? – dsaxton Mar 22 '16 at 2:53
• You could probably make a better estimator by adapting the ideas from my answer here: stats.stackexchange.com/questions/211175/… – kjetil b halvorsen Apr 20 '17 at 21:00