Random effects in population models with hereditary effects