contrib.distributions.normal_conjugates_known_scale_posterior

tf.contrib.distributions.normal_conjugates_known_scale_posterior

tf.contrib.distributions.normal_conjugates_known_scale_posterior

normal_conjugates_known_scale_posterior(
    prior,
    scale,
    s,
    n
)

Defined in tensorflow/contrib/distributions/python/ops/normal_conjugate_posteriors.py.

See the guide: Statistical Distributions (contrib) > Normal likelihood with conjugate prior

Posterior Normal distribution with conjugate prior on the mean.

This model assumes that n observations (with sum s) come from a Normal with unknown mean loc (described by the Normal prior) and known variance scale**2. The "known scale posterior" is the distribution of the unknown loc.

Accepts a prior Normal distribution object, having parameters loc0 and scale0, as well as known scale values of the predictive distribution(s) (also assumed Normal), and statistical estimates s (the sum(s) of the observations) and n (the number(s) of observations).

Returns a posterior (also Normal) distribution object, with parameters (loc', scale'**2), where:

mu ~ N(mu', sigma'**2)
sigma'**2 = 1/(1/sigma0**2 + n/sigma**2),
mu' = (mu0/sigma0**2 + s/sigma**2) * sigma'**2.

Distribution parameters from prior, as well as scale, s, and n. will broadcast in the case of multidimensional sets of parameters.

Args:

  • prior: Normal object of type dtype: the prior distribution having parameters (loc0, scale0).
  • scale: tensor of type dtype, taking values scale > 0. The known stddev parameter(s).
  • s: Tensor of type dtype. The sum(s) of observations.
  • n: Tensor of type int. The number(s) of observations.

Returns:

A new Normal posterior distribution object for the unknown observation mean loc.

Raises:

  • TypeError: if dtype of s does not match dtype, or prior is not a Normal object.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/distributions/normal_conjugates_known_scale_posterior

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部