Assessing the heterogeneity in the transmission of infectious diseases from time series of epidemiological data