The likelihood function, parameterized by a (possibly multivariate) parameter , is usually defined differently for discrete and continuous probability distributions
Discrete Case
Let be a discrete random variable with PMF depending on a parameter . Then the function
considered as a function of , is the likelihood function, given the outcome of the random variable . Sometimes this can be written as .
The likelihood is the probability that a particular outcome is observed when the true value of the parameter is .
This should not be confused with , which is the posterior probability of given the data
Example
Imagine a coin with a probability of to land heads up, and consider the observing two heads in two tosses ("HH"):
and also
Continuous Case
Let be a continuous r.v. with PDF which depends on a parameter . Then the function
considered as a function of , is the likelihood function (of , given the outcome ).