A Bayesian approach to model interdependent event histories by graphical models