Generic HMM for multi-parent populations