Hierarchical and nested random probability measures with statistical applications