def target_distribution(q):
    """
    Calculate the target distribution

    Attributes
    ----------
    q : array
        the input data

    Returns
    -------
    target distribution
    """
    weight = q ** 2 / q.sum(0)
    return (weight.T / weight.sum(1)).T
