def sample_niw(mu,lmbda,kappa,nu):
<EOL>assert nu > lmbda.shape[<NUM_LIT:0>] and kappa > <NUM_LIT:0><EOL>lmbda = sample_invwishart(lmbda,nu)<EOL>mu = np.random.multivariate_normal(mu,lmbda / kappa)<EOL>return mu, lmbda<EOL>
Returns a sample from the normal/inverse-wishart distribution, conjugate
prior for (simultaneously) unknown mean and unknown covariance in a
Gaussian likelihood model. Returns covariance.