def entropy(df, scale, batch_shape, dtype):
"""Compute entropy of the StudentT distribution.
Args:
df: Floating-point `Tensor`. The degrees of freedom of the
distribution(s). `df` must contain only positive values.
scale: Floating-point `Tensor`; the scale(s) of the distribution(s). Must
contain only positive values.
batch_shape: Floating-point `Tensor` of the batch shape
dtype: Return dtype.
Returns:
A `Tensor` of the entropy for a Student's T with these parameters.
"""
v = tf.ones(batch_shape, dtype=dtype)
u = v * df
return (tf.math.log(tf.abs(scale)) + 0.5 * tf.math.log(df) +
tfp_math.lbeta(u / 2., v / 2.) + 0.5 * (df + 1.) *
(tf.math.digamma(0.5 * (df + 1.)) - tf.math.digamma(0.5 * df)))
Implement the entropy function for CoupledNormal. Use the commented out TFP's Student
entropy
code as a foundation.See our latest nsc code here.
See original StudentT code here: