Text this: Functional quantization-based stratified sampling