Statistical inference of the rates of cell proliferation and phenotypic switching in cancer