CamDavidsonPilon / Probabilistic-Programming-and-Bayesian-Methods-for-Hackers

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 ;)
http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/
MIT License
26.5k stars 7.84k forks source link

Ch 5 Dark World, Text equation uses min by code uses max #516

Closed ZachariahRosenberg closed 9 months ago

ZachariahRosenberg commented 3 years ago

In the text discussing Tim's decreasing function for euclidean distance, the formula is displayed as:

Screen Shot 2021-01-18 at 8 34 53 PM

This shows the minimum of the Euclidean distance and some value.

--

In the code (here shown as the PyMC3 version), the T.maximum is used:

def f_distance(gxy_pos, halo_pos, c):
    return T.maximum(euclidean_distance(gxy_pos, halo_pos), c)[:, None]

Shouldn't these two be the same?

Thanks!

ZachariahRosenberg commented 9 months ago

closing since this has gone stale.