Example of a Likelihood Function
Deterministic Model
We assume a deterministic model of this form:
\[model(x, \theta) = \theta_1 + \theta_2 x + \theta_3 x^2\]
Data
For this demonstration we uses simulated data:
Likelihood function
If we assume independent obserations, the likelihood of all observation is given by:
\[p(y \mid \theta, \sigma, x) = \prod_i p(y_i \mid \theta, \sigma, x_i)\]
For computational reasons we prefere to work with the log if the likelihood:
\[\log p(y \mid \theta, \sigma, x) = \log \prod_i p(y_i \mid \theta, \sigma, x_i) = \sum_i \log p(y_i \mid \theta, \sigma, x_i)\]
We can set the parameters and visualize the different components contributing to the likelihood function:
\[\hat{y} = \theta_1 + \theta_2 x + \theta_3 x^2\]