2 min read

Regression random variable Y for a given value x

We want to make regression of a random variable \(Y\) for a given value \(x\), the function \(f_{Y|x}(y)\) denotes the pdf of the random variable \(Y\) for a given value \(x\), and the expected value associated with \(f_{Y|x}(y)\) is \(E(Y | x)\). The function \(y = E(Y | x)\) is called the regression curve of \(Y\) on \(x\). The regression model is called simple linear model if it satisfy the \(4\) assumptions:

  • \(f_{Y|x}(y)\) is a normal distribution,

  • with all the same standard deviation \(\sigma\) for all value of \(x\),

  • the means of all the conditional \(Y\) distributions are collinear \(y = E(Y|x) = \beta_0 + \beta_1x\)

  • and all of the conditional distributions represent independent random variables,

Let \((x_1,Y_1)\), \((x_2,Y_2)\), . . . , and \((x_n,Y_n)\) be a set of points satisfying the simple linear model, then \(Y_i\) is normally distributed with mean equal to \(E(Y|x) = \beta_0 + \beta_1x\) and variance equal to \(\sigma^2\), the likelihood function is \[L=\prod_{i=1}^{n}f_{Y_i|x_i}(y_i)=\prod_{i=1}^{n}\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{1}{2}(\frac{y_i-\beta_0 - \beta_1x_i}{\sigma})^2}=(2\pi\sigma^2)^{-\frac{n}{2}}exp\Biggl[{-\frac{1}{2}\sum_{i=1}^{n}\Bigl(\frac{y_i-\beta_0 - \beta_1x_i}{\sigma}\Bigr)^2}\Biggr]\] and \[\ln L=-\frac{n}{2}\ln (2\pi\sigma^2)-\frac{1}{2}\sum_{i=1}^{n}\Bigl(\frac{y_i-\beta_0 - \beta_1x_i}{\sigma}\Bigr)^2\] and \[-2\ln L=n(2\pi\sigma^2)+\frac{1}{\sigma^2}\sum_{i=1}^{n}\Bigl(y_i-\beta_0 - \beta_1x_i\Bigr)^2\].
Then we take partial derivatives of \(-2\ln L\) with respect to \(\beta_0\) and \(\beta_1\) and let them equal to \(0\) to get the maximum of \(L\): \[\frac{\partial (-2\ln L)}{\partial \beta_0}=-2\frac{1}{\sigma^2}\sum_{i=1}^{n}(y_i-\beta_0-\beta_1x_i)=0\] \[\frac{\partial (-2\ln L)}{\partial \beta_1}=-2\frac{1}{\sigma^2}\sum_{i=1}^{n}(y_i-\beta_0-\beta_1x_i)x_i=0\]
\[\frac{\partial (-2\ln L)}{\partial (\sigma^2)}=\frac{n}{\sigma^2}-\frac{1}{(\sigma^2)^2}\sum_{i=1}^{n}(y_i-\beta_0-\beta_1x_i)^2=0\].

Then \[\hat\beta_1=\frac{n(\displaystyle\sum_{i=1}^{n}x_iY_i)-(\displaystyle\sum_{i=1}^{n}x_i)(\displaystyle\sum_{i=1}^{n}Y_i)}{n\displaystyle\sum_{i=1}^{n}x_i^2-(\displaystyle\sum_{i=1}^{n}x_i)^2}\], \[\hat\beta_0=\frac{\displaystyle\sum_{i=1}^{n}Y_i-b\sum_{i=1}^{n}x_i}{n}=\bar Y-\hat\beta_1\bar x\], \[\sigma^2=\frac{1}{n}\sum_{i=1}^{n}(Y_i-\beta_0-\beta_1x_i)^2=\frac{1}{n}\sum_{i=1}^{n}(Y_i-\hat Y_i)^2\]