Maximum likelihood estimation of phase-type distributions