Forward modeling in the era of cosmological surveys