当前位置: 首页 > 文档资料 > Edward 中文文档 >

ed.get_control_variate_coef

优质
小牛编辑
129浏览
2023-12-01

Aliases:

  • ed.get_control_variate_coef
  • ed.util.get_control_variate_coef
get_control_variate_coef(
    f,
    h
)

Defined in edward/util/tensorflow.py.

Returns scalar used by control variates method for variance reduction in Monte Carlo methods.

If we have a statistic $(m)$ as an unbiased estimator of $(\mu)$ and and another statistic $(t)$ which is an unbiased estimator of $(\tau)$ then $(m^* = m + c(t - \tau))$ is also an unbiased estimator of $(\mu)$ for any coefficient $(c)$.

This function calculates the optimal coefficient

$(c^* = \frac{\text{Cov}(m,t)}{\text{Var}(t)})$

for minimizing the variance of $(m^*)$.

Args:

  • f: tf.Tensor. A 1-D tensor.
  • h: tf.Tensor. A 1-D tensor.

Returns:

tf.Tensor. A 0 rank tensor