4.I $9 \mathrm{H} \quad$

Suppose that $Y_{1}, \ldots, Y_{n}$ are independent random variables, with $Y_{i}$ having the normal distribution with mean $\beta x_{i}$ and variance $\sigma^{2}$; here $\beta, \sigma^{2}$ are unknown and $x_{1}, \ldots, x_{n}$ are known constants.

Derive the least-squares estimate of $\beta$.

Explain carefully how to test the hypothesis $H_{0}: \beta=0$ against $H_{1}: \beta \neq 0$.

*Typos? Please submit corrections to this page on GitHub.*