Maximum likelihood theory for large interacting systems