# Estimate the variance for log likelihood of gaussian saturated model

When we calculate the Null Deviance, we need calculate the log-likelihood of the Saturated Model first. For the linear regression, the log-likelihood function would be

$l(\mu|y)=-\frac{n}{2}\log(2\pi\sigma^2)-\frac{1}{2\sigma^2}\sum^n_{i=1}(y_i-\mu_i)^2$

for the saturated model, as $y=\hat{y}$, we will have

$l(\mu|y)=-\frac{n}{2}\log(2\pi\sigma^2)$

So how can we estimate the $\sigma$ here? Usually, in a non-saturated model,

$\hat{\sigma}^2=\frac{1}{n}\sum^n_{i=1}(y_i-\hat{y}_i)^2$.

If we do similar thing to saturated model, $\hat{\sigma}$ would be 0 and the log-likelihood of saturated model would not exist.