MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / sample_from_prior

Function sample_from_prior

bayesian_ml/4/npbgmm.py:54–58  ·  view source on GitHub ↗
(c0, m0, a0, B0)

Source from the content-addressed store, hash-verified

52
53
54def sample_from_prior(c0, m0, a0, B0):
55 precision0 = wishart.rvs(df=a0, scale=np.linalg.inv(B0))
56 cov = np.linalg.inv(precision0)
57 mean = mvn.rvs(mean=m0, cov=cov/c0)
58 return mean, cov
59
60
61# samples mu, sigma from P(mu, sigma | X)

Callers 2

sample_from_XFunction · 0.85
gmmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected