def nth_moment(index, data, center=0.0, n=0):
    """Determine n-th moment of distribution.

    Parameters
    ----------
    index : array
        data x axis index array
    data : array
        the data distribution
    center : float
        coordinate around which the moment is determined
    n : int
        number of moment

    """
    return sum((index - center) ** n * data) / sum(data)
