26: Likelihood

Author

Derek Sollberger

Published

April 7, 2023

Notation

Notation

Recall,

  • Lower-case {x1,x2,x3,...,xn} is a set of observations
  • Upper-case {X1,X2,X3,...,Xn} is a set of random variables (i.e. a data set)
  • Treating {X1,X2,...,Xn} as a set of n i.i.d. (independent and identically distributed) random variables is a common assumption.
  • With independence, P(X1,X2,...,Xn)=P(X1)P(X2)...P(Xn)
  • Each individual probability is computed (at least theoretically) with a PDF (probability density function) P(xi)=fX(xi)

Inverse

Inverse

Suppose that we have a sample of data {x1,x2,x3,...,xn}. Now we want to model with a probability distribution, but we need to figure out the distribution’s parameters. Let us think about this in a Bayesian way:

P(model|data)=P(data|model)P(model)P(data)

  • P(model|data) is the posterior probability that we want
  • P(data|model) is a likelihood
  • Since the prior probability P(data) is a constant …

… we say that the posterior probability is proportional to the likelihood.

Likelihood

Likelihood Function

Let the likelihood function, in terms of a parameter θ, be the joint probability

L(θ)=P(X1=x1,X2=x2,...,Xn=xn)=fX(x1)fX(x2)fX(xn)

or

L(θ;{xi}i=1n)=i=1nfX(xi)

Suppose that we have data for how long a certain type and brand of light bulb operated (in the same working conditions), and that data in months was

6,18,29,44,48 Goal: characterize the top 5 percent of light bulbs.

  • Build the likelihood function assuming an exponential distribution.
  • Compute the likelihood that μ=25.
  • Compute the likelihood that μ=50.

Log Likelihood

Logarithms

You know that logarithms make large numbers smaller. More precisely, ln(x)<x,x>1

Example: ln(1234)7.1180

Did you know that logarithms make small numbers larger (in size). More precisely, |ln(x)|>x,0<x<1

Example: |ln(0.1234)|2.0923

From pre-calculus, recall the properties of logarithms: ln(AB)=ln(A)+ln(B),ln(AB)=lnAlnB,ln(Ac)=clnA

For modeling with the exponential distribution, we saw that the likelihood function was

L(λ;{xi}i=1n)=i=1nfX(xi)=λneλxi

We take the natural logarithm to compute the log-likelihood function

(λ;{xi}i=1n)=lnL(λ;{xi}i=1n)=nlnλλi=1nxi

  • Compute the log-likelihood that μ=25.
  • Compute the log-likelihood that μ=50.

Visuals

simulation a better simulation

Looking Ahead

  • WHW9

  • Exam 2, Mon., Apr. 10

    • more information in weekly announcement