Added a function which calculates the stationary distribution of the
system