Last active
May 26, 2024 23:31
-
-
Save dlakelan/9949cdaf8c3b4bb67fe3d7e21e1cdb43 to your computer and use it in GitHub Desktop.
Showing high Dimensional log(p) distribution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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