def _init_a(D):
    """Initial guess for Dirichlet alpha parameters given data D

    Parameters
    ----------
    D : (N, K) shape array
        ``N`` is the number of observations, ``K`` is the number of
        parameters for the Dirichlet distribution.

    Returns
    -------
    (K,) shape array
        Crude guess for parameters of Dirichlet distribution."""
    E = D.mean(axis=0)
    E2 = (D ** 2).mean(axis=0)
    return (E[0] - E2[0]) / (E2[0] - E[0] ** 2) * E
