Efficient nonparametric estimation of discretely observed compound Poisson processes