I have a question about priors and likelihoods and their visualisation.
A Bernoulli likelihood is $$\theta^{N_1}(1 - \theta)^{N_0}$$ where $N_1$ and $N_0$ are number of success and failures, respectively.
I want to visualise (in R
) a conjugate Beta prior $Beta(2, 2)$ and Likelihood:
N_1 = 4
N_0 = 1
N = N_1 + N_0
curve(dbeta(x, 2, 2),
col = 'red')
So far so good, but when I try to add the Likelihood function:
likelihood = function(theta) theta^N_1 * (1 - theta)^N_0
curve(likelihood,
add = T)
They are definitely on different scales. But what multiplication constant am I missing here? Thanks.