So, it's a nice little result.

So, anyway, with mu 0 fixed, the maximum likelihood estimator

for sigma squared is this generalization of the variance right there.

So that's the peak of our likelihood, all right?

That's the point where the light

switches from being able to not go through the likelihood to the point

right above it where the light is

actually, you know, passes over the likelihood.

And that's that point.

That's that point that gets shadowed onto the wall at mu 0.

And so, we want to plug this back in

to the likelihood and we get this function right here.

Summation xi minus mu 0 squared over n raised to the minus n over 2 power,

and then e to minus -n over 2.

And this e to the -n over 2 is irrelevant because that it doesn't involve mu 0.

So that's for one mu 0 and if we did that for every mu 0, we would get a function.

And so here's our profile likelihood is this function.

Summation xi minus mu square raised to the negative n over 2.

That function is our profile likelihood.

And then again, this function is clearly maximized it at mu equals x bar.

You can,

of course, solve it.

But in general, one nice property of

the profile likelihood is that the maximizer of

the profile likelihood, the maximum profile likelihood

estimate is also your MLE for the parameter.

So, in this case, the maximum of the profile likelihood for mu is

going to be x bar, the same as the maximum likelihood for the complete value.

So if

we wanted to divide this by its peak value, we would simply divide it

by the same thing in, with instead of mu, there plug x bar n.

And that would normalize this function so it tops it out at 1.

So, lets actually go through the R code to generate this function, our

mu for the sleep data. So, our muVals, we're going to go from say

zero to three and do a thousand of them, so we plot a function of the thousand

mu not values, our likelihood values.

And then so it would just be the sum xi minus mu squared sum raise to the minus

n over 2 power so that's this term right

here, raise to the negative n over 2 power.

But I want it to be maxed out at

one, so normally I create the likelihood and then divide by its maximum value.

But in this case, I know exactly what the exact maximum value is.

It's when you replace mu by the mean.

So instead, I divide it by the mean right here and this sapply

is just a loop it says loop over mu values and do this function.

And then I'll plot them and connect them together with type equals l and then I'll

put the likely values above 1 eighth and

above 1 sixteenth and then I get this plot.

So that is my profile

likelihood for mu.

That is the function that I get if I take

the bivariate likelihood for mu and sigma, place a light along

the direction of the sigma axis and look at the

shadow on the wall, this is the outline of that shadow.

And that's called the profile likelihood.

And there's many theoretical properties of the profile likelihood.

But, most importantly, you can kind of treat them as

if they were a standard univariate likelihood.

So, you would treat this just like a regular likelihood for mu, the

higher values are better supported, the peak

is where the maximum likelihood estimate occurs.

And you could draw horizontal lines to get likelihood-based intervals for mu.