Stochastic matrices. I. Similarity via stochastic transforms