Exact conjugate update for iid N(mu, sigma^2) data under the prior sigma^2 distributed Inv-chi2(nu0, sigma0^2) and mu given sigma^2 distributed N(mu0, sigma^2/kappa0) – the (mu, sigma^2) parameterization of the normal-inverse-gamma family. Posterior parameters (Gelman et al., BDA3, Section 3.3, Eq. 3.8): \(\mu_n = (\kappa_0 \mu_0 + n \bar y)/(\kappa_0 + n)\), \(\kappa_n = \kappa_0 + n\), \(\nu_n = \nu_0 + n\), \(\nu_n \sigma_n^2 = \nu_0 \sigma_0^2 + (n-1) s^2 + \kappa_0 n (\bar y - \mu_0)^2 / (\kappa_0 + n)\). The marginal posterior of mu is t with nu_n degrees of freedom, centre mu_n and scale^2 sigma_n^2/kappa_n; the posterior predictive for one new observation has scale^2 sigma_n^2 (kappa_n + 1)/kappa_n.
Value
List with estimate, mu_n, kappa_n,
nu_n, sigma_n_sq, mu_scale_sq,
pred_scale_sq, n, ybar, s_sq,
method.
