Generate guassian data and compute f(K)