tfp.distributions.normal_conjugates_known_scale_predictive
Stay organized with collections
Save and categorize content based on your preferences.
Posterior predictive Normal distribution w. conjugate prior on the mean.
tfp.distributions.normal_conjugates_known_scale_predictive(
prior, scale, s, n
)
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 predictive"
is the distribution of new observations, conditioned on the existing
observations and our prior.
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).
Calculates the Normal distribution(s) p(x | sigma**2)
:
p(x | sigma**2) = int N(x | mu, sigma**2)N(mu | prior.loc, prior.scale**2) dmu
= N(x | prior.loc, 1 / (sigma**2 + prior.scale**2))
Returns the predictive posterior distribution object, with parameters
(loc', scale'**2)
, where:
sigma_n**2 = 1/(1/sigma0**2 + n/sigma**2),
mu' = (mu0/sigma0**2 + s/sigma**2) * sigma_n**2.
sigma'**2 = sigma_n**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 predictive distribution object.
|
Raises |
TypeError
|
if dtype of s does not match dtype , or prior is not a
Normal object.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-21 UTC."],[],[],null,["# tfp.distributions.normal_conjugates_known_scale_predictive\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/distributions/normal_conjugate_posteriors.py#L208-L271) |\n\nPosterior predictive Normal distribution w. conjugate prior on the mean. \n\n tfp.distributions.normal_conjugates_known_scale_predictive(\n prior, scale, s, n\n )\n\nThis model assumes that `n` observations (with sum `s`) come from a\nNormal with unknown mean `loc` (described by the Normal `prior`)\nand known variance `scale**2`. The \"known scale predictive\"\nis the distribution of new observations, conditioned on the existing\nobservations and our prior.\n\nAccepts a prior Normal distribution object, having parameters\n`loc0` and `scale0`, as well as known `scale` values of the predictive\ndistribution(s) (also assumed Normal),\nand statistical estimates `s` (the sum(s) of the observations) and\n`n` (the number(s) of observations).\n\nCalculates the Normal distribution(s) `p(x | sigma**2)`: \n\n p(x | sigma**2) = int N(x | mu, sigma**2)N(mu | prior.loc, prior.scale**2) dmu\n = N(x | prior.loc, 1 / (sigma**2 + prior.scale**2))\n\nReturns the predictive posterior distribution object, with parameters\n`(loc', scale'**2)`, where: \n\n sigma_n**2 = 1/(1/sigma0**2 + n/sigma**2),\n mu' = (mu0/sigma0**2 + s/sigma**2) * sigma_n**2.\n sigma'**2 = sigma_n**2 + sigma**2,\n\nDistribution parameters from `prior`, as well as `scale`, `s`, and `n`.\nwill broadcast in the case of multidimensional sets of parameters.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------|---------------------------------------------------------------------------------------------|\n| `prior` | `Normal` object of type `dtype`: the prior distribution having parameters `(loc0, scale0)`. |\n| `scale` | tensor of type `dtype`, taking values `scale \u003e 0`. The known stddev parameter(s). |\n| `s` | Tensor of type `dtype`. The sum(s) of observations. |\n| `n` | Tensor of type `int`. The number(s) of observations. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A new Normal predictive distribution object. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|-------------|----------------------------------------------------------------------------|\n| `TypeError` | if dtype of `s` does not match `dtype`, or `prior` is not a Normal object. |\n\n\u003cbr /\u003e"]]