Skip to content

Instantly share code, notes, and snippets.

@dlakelan
Last active May 26, 2024 23:31
Show Gist options
  • Save dlakelan/9949cdaf8c3b4bb67fe3d7e21e1cdb43 to your computer and use it in GitHub Desktop.
Save dlakelan/9949cdaf8c3b4bb67fe3d7e21e1cdb43 to your computer and use it in GitHub Desktop.
Showing high Dimensional log(p) distribution
using Distributions,Random,StatsPlots,LinearAlgebra
dist = MvNormal(zeros(20),I(20))
samp = rand(dist,200)
lps = [logpdf(dist,c) for c in eachcol(samp)]
histogram(lps; label="lp of 200 draws")
bar!((mean(lps),10); label="Mean logp")
bar!((logpdf(dist,zeros(20)),10); label="lp of mode")
plot(0:.02:1.0, map(x->x^20,0:.02:1.0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment