aka "Bayesian Methods for Hackers": An introduction to Bayesian methods + probabilistic programming with a computation/understanding-first, mathematics-second point of view. All in pure Python ;)
I'm a bit confused about joint_log_prob function used in Chapter 3 (Tensorflow Probability).
I can see that rv_prob is a Uniform random variable from in the range [0, 1]. We don't really do anything with that variable but we use it to calculate how likely sample_prob_1 and sample_prob_2 are to be from that distribution.
I assume that:
1) we can remove the two lines of code that use rv_prob in the calculation of joint log probability OR
2) sample rv_prob (as p) and use that as probability of sampling from first distribution and use 1 - p as probability of sampling from the second distribution. Something like:
I'm a bit confused about
joint_log_prob
function used in Chapter 3 (Tensorflow Probability).I can see that
rv_prob
is a Uniform random variable from in the range [0, 1]. We don't really do anything with that variable but we use it to calculate how likelysample_prob_1
andsample_prob_2
are to be from that distribution.I assume that: 1) we can remove the two lines of code that use
rv_prob
in the calculation of joint log probability OR 2) samplerv_prob
(as p) and use that as probability of sampling from first distribution and use1 - p
as probability of sampling from the second distribution. Something like:And then we could include
rv_assignments.log_prob(sample_prob_1) + rv_assignments.log_prob(sample_prob_2)
injoint_log_probability
calculation.