Generalization of the concept of random variable to more complicated spaces than the simple real line