Nonparametric estimation of risk measures of collective risks