def select_covar_types(nd, ns):
    """
    Heuristics to choose the types of covariance matrix to explore based on the data dimension and the (effective)
    number of samples per mixture component.

    :param nd: data dimension.
    :param ns: number of samples.
    :return: list of covariance types.
    """
    if nd <= 20:
        # low dimensional
        if ns >= (10 * nd):
            covar_types = ['full', 'tied']
        else:
            covar_types = ['tied', 'diag']
    elif nd <= 250:
        # medium dimensional
        if ns >= (10 * nd):
            covar_types = ['tied', 'diag']
            if nd <= 50:
                covar_types.append('full')

        else:
            covar_types = ['diag', 'spherical']
    else:
        # high dimensional
        covar_types = ['diag', 'spherical']

    return covar_types