def multivariate_t_distribution(x, mu, Sigma, df, d):
    """
    Multivariate t-student density:
    output:
        the density of the given element
    input:
        x = parameter (d dimensional numpy array or scalar)
        mu = mean (d dimensional numpy array or scalar)
        Sigma = scale matrix (dxd numpy array)
        df = degrees of freedom
        d: dimension
    """
Num = gamma(1.0 * (d + df) / 2)
Denom = gamma(1.0 * df / 2) * pow(df * pi, 1.0 * d / 2) * pow(np.linalg.det
    (Sigma), 1.0 / 2) * pow(1 + 1.0 / df * np.dot(np.dot(x - mu, np.linalg.
    inv(Sigma)), x - mu), 1.0 * (d + df) / 2)
d = 1.0 * Num / Denom
return d
multivariate student t-distribution with python