Discovering the hidden structure of financial markets through bayesian modelling