Skip to content

Instantly share code, notes, and snippets.

@phipsgabler
Created October 20, 2017 16:23
Show Gist options
  • Save phipsgabler/aa2dfa23cc32fbd89cd868aaf85c9120 to your computer and use it in GitHub Desktop.
Save phipsgabler/aa2dfa23cc32fbd89cd868aaf85c9120 to your computer and use it in GitHub Desktop.
Likelihoods for parameter of uniform distribution; see https://stats.stackexchange.com/q/309001
using Distributions
using Gadfly
function test()
@show θ = 100 * rand()
@show X = rand(Uniform(-θ, θ), 100)
ls = 0.1:0.5:100.0
plot(x = ls,
y = broadcast(l -> loglikelihood(Uniform(-l, l), X), ls),
Geom.line,
Guide.xticks(ticks = collect(0:5:100)))
# result: descending curve from maximum value
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment