Modelling intransitivity in pairwise comparisons with application to baseball data