Infer the mean of a Gaussian whose (co)variance is known, with a conjugate Gaussian prior. Work with precisions (inverse variances).
posterior_1d(y, sigma2, m0, tau2): data (at least one point) from , prior . Return the posterior (mean, variance) as floats. The posterior precision is the prior precision plus units of observation precision, and the posterior mean is the precision-weighted combination of and . tau2 may be float('inf'), a flat prior with precision .posterior_mvn(Y, Sigma, m0, V0): rows of Y (shape (N, D)) are draws from , prior . Return (m_post, V_post) as numpy arrays, using
flat_prior_interval(y): the approximate 95% credible interval for the flat-prior case, where plugs in for . Return (lo, hi) as floats.