这是一份nottingham诺丁汉大学MATH2011作业代写的成功案例
A commonly used measure of goodness of fit for multiple linear regression models is based on a comparison with the simplest or minimal model using the least squares criterion (in contrast to the maximal model and the loglikelihood function, which are used to define the deviance). For the model specified in, the least squares criterion is
$$
S=\sum_{i=1}^{N} e_{i}^{2}=\mathbf{e}^{T} \mathbf{e}=(\mathbf{Y}-\mathbf{X} \boldsymbol{\beta})^{T}(\mathbf{Y}-\mathbf{X} \boldsymbol{\beta})
$$
and, from, the least squares estimate is $\mathbf{b}=\left(\mathbf{X}^{T} \mathbf{X}\right)^{-1} \mathbf{X}^{T} \mathbf{y}$ so the minimum value of $S$ is
$$
\widehat{S}=(\mathbf{y}-\mathbf{X b})^{T}(\mathbf{y}-\mathbf{X b})=\mathbf{y}^{T} \mathbf{y}-\mathbf{b}^{T} \mathbf{X}^{T} \mathbf{y}
$$
The simplest model is $\mathrm{E}\left(Y_{i}\right)=\mu$ for all $i$. In this case, $\beta$ has the single element $\mu$ and $\mathbf{X}$ is a vector of $N$ ones. So $\mathbf{X}^{T} \mathbf{X}=N$ and $\mathbf{X}^{T} \mathbf{y}=\sum y_{i}$ so that $\mathbf{b}=\widehat{\mu}=\bar{y}$. In this case, the value of $S$ is
$$
\widehat{S}{0}=\mathbf{y}^{T} \mathbf{y}-N \bar{y}^{2}=\sum\left(y{i}-\bar{y}\right)^{2}
$$
MATH2011 COURSE NOTES :
where $\lambda$ is an arbitrary constant. It used to be conventional to impose the additional sum-to-zero constraint
$$
\sum_{j=1}^{J} \alpha_{j}=0
$$
so that
$$
\frac{1}{K} \sum_{j=1}^{J} Y_{j} \cdot J \lambda=0
$$
and hence,
$$
\lambda=\frac{1}{J K} \sum_{j=1}^{J} Y_{j}=\frac{Y_{.}}{N}
$$
This gives the solution
$$
\widehat{\mu}=\frac{Y_{\cdots}}{N} \quad \text { and } \quad \widehat{\alpha}{j}=\frac{Y{j}}{K}-\frac{Y_{\cdots}}{N} \quad \text { for } j=1, \ldots, J
$$
Hence,
$$
\mathbf{b}^{T} \mathbf{X}^{T} \mathbf{y}=\frac{Y_{\cdots}^{2}}{N}+\sum_{j=1}^{J} Y_{j \cdot}\left(\frac{Y_{j \cdot}}{K}-\frac{Y_{\cdots}}{N}\right)=\frac{1}{K} \sum_{j=1}^{J} Y_{j}^{2}
$$