Attend the Women in ML Symposium on December 7 Register now


Returns the conditional posterior of Normal scale given observations.

We assume the conjugate InverseGamma->Normal model:

scale ~ Sqrt(InverseGamma(variance_prior.concentration, variance_prior.scale))
for i in [1, ..., num_observations]:
  x[i] ~ Normal(0, scale)

and return a sample from p(scale | x).

variance_prior Variance prior distribution as a tfd.InverseGamma instance. Note that the prior is given on the variance, but the value returned is a sample of the scale.
observations Float Tensor of shape [..., num_observations], specifying the centered observations (x).
is_missing Optional bool Tensor of shape [..., num_observations]. A True value indicates that the corresponding observation is missing.

sampled_scale A tfd.Distribution of the conditional posterior of the inverse gamma scale.