Likelihood and Prior density scales 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.

You could try a log scale for the $y$-axis, so the following shows

*

*your prior distribution in red

*your likelihood in black

*your posterior distribution in blue

You can see the peak of the posterior distribution is further left than the maximum likelihood position
curve(dbeta(x, 2, 2), log="y", ylim=c(0.001,5), col = 'red')
N_1 = 4
N_0 = 1
curve(x^N_1*(1-x)^N_0, add = TRUE, col="black")
curve(dbeta(x, 2+N_1, 2+N_0), add = TRUE, col="blue")


