Stochastic Process Algebra and Stability Analysis of Collective Systems