Predicting ecosystem risk