def portfolio_computeKmm_np(X, l, sigma):
    n = X.shape[0]
    xdim = X.shape[1]
    l = l.reshape(1, xdim)
    X = (X / l)
    Q = np.tile(np.sum((X * X), axis=1, keepdims=True), reps=(1, n))
    dist = ((Q + Q.T) - (2 * X.dot(X.T)))
    kmm = (sigma * np.exp(((- 0.5) * dist)))
    return kmm
def portfolio_computeKmm_np(X, l, sigma):
    n = X.shape[0]
    xdim = X.shape[1]
    l = l.reshape(1, xdim)
    X = (X / l)
    Q = np.tile(np.sum((X * X), axis=1, keepdims=True), reps=(1, n))
    dist = ((Q + Q.T) - (2 * X.dot(X.T)))
    kmm = (sigma * np.exp(((- 0.5) * dist)))
    return kmm