Generalized Rescaled P\'olya urn and its statistical applications.