Stochastic analysis of transit systems