Skip to content

Commit

Permalink
reformat with black
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenjw committed Nov 16, 2024
1 parent a32285c commit f1619d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions demos/metropolis_hastings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
k1, k2 = jax.random.split(k0)
data = jax.random.normal(k1, 250) * 2 + 5


def llik(k, x):
return jnp.sum(jsp.stats.norm.logpdf(data, x[0], x[1]))


def prop(k, x):
return jax.random.normal(k, 2) * 0.1 + x


postmat = jsmfsb.metropolis_hastings(k2, jnp.array([1.0, 1.0]), llik, prop, verb=False)

fig, axes = plt.subplots(3, 2)
Expand Down

0 comments on commit f1619d5

Please sign in to comment.