I am a bit confused at how can i find the likelihood function and the solutions of likelihood function for a line equation, for example y=3x+15
1 Answers
The equation $y = 0.2x + 4$ is not a statistical model, but a mathematical equation. It doesn't even have parameters (unless you mean that $x$ is a parameter), so there is nothing to optimize. In case you meant $y = \beta_0 + \beta_1 x$, this would still be a deterministic function of the variables, that can be solved by pure algebra, that does not need statistics. Statistical model arises, when there is uncertanity about the data
$$ y = \beta_0 + \beta_1 x \color{red}{+ \varepsilon} $$
Assuming that by linear regression you mean the standard model minimizing the squared error (e.g. with ordinary least squares), then the objective function to minimize is
$$ \operatorname{SSE}(y, \hat y) = \sum_{i=1}^n (y_i - \hat y_i)^2 $$
To obtain a likelihood function, you would need a probability distribution. Usually we maximize the log-likelihood (or minimize the negative log-likelihood), rather then pure likelihood. The distribution that is equivalent to minimizing squared errors would be
$$ \log p(y) \propto \sum_{i=1}^n -\frac{(y_i - \hat y_i)^2}{\sigma^2} $$
where the proportionality ($\propto$) is due the fact, that for optimization we can drop the normalizing constant (the distribution does not have to integrate to one). As you can see, we introduced a new parameter for $\sigma^2$ for the variance of the residuals. If you take $\exp$ of it, to reverse the $\log$ we took, and get rid of the negative sign, this is a normal distribution
$$ p(y) \propto \exp\Big(-\frac{(y-\mu)^2}{2\sigma^2}\Big) $$
So, minimizing sum of squared errors is equivalent to maximizing the Gaussian likelihood. The above is a different way of saying, that the linear regression model assumes normally distributed noise $\varepsilon$ that has mean of zero,
$$\begin{align} y &= \beta_0 + \beta_1 x + \varepsilon \\ \varepsilon &\sim \mathcal{N}(0, \sigma^2) \end{align}$$

- 108,699
- 20
- 212
- 390
-
i wrote it as (1/[σ^2(2π)^n/2)] * exp[( -1/2σ^2)*Σ(yi-4-0.2xi)^2. is it false? – Sarah kenwich Oct 22 '19 at 06:36
-
@Sarahkenwich it is the same, but includes normalizing constant (not needed) and in re-arranged order. – Tim Oct 22 '19 at 06:37
-
in the way i wrote it, do i have to calculate the σ or should i let it as ''σ''? – Sarah kenwich Oct 22 '19 at 06:39
-
if i want for the same equation to justify why the solutions to the likelihood would not be the same if the linea regression model was fitted to two distinct dataset,would be enough if i say that they will not be the same, because evaluation of likelihood function is dependent on the data or do i have to write something more to justify it? thanks in advance – Sarah kenwich Oct 22 '19 at 06:42
-
@Sarahkenwich yes, it depends on data, so different datasets may lead to different results. As about $\sigma^2$, it is just another parameter to find via optimization. – Tim Oct 22 '19 at 06:56
-
thank you so much! can i ask and something else? In the simple linear regression model, ˆb is the sum of independent normally distributed random variables, and why? – Sarah kenwich Oct 22 '19 at 07:06
-
@Sarahkenwich sorry, but I don't understand your last comment. – Tim Oct 22 '19 at 07:22
-
in the linear regression model, can we regard b as the sum of independent distributed random variable? – Sarah kenwich Oct 22 '19 at 08:17
-
@Sarahkenwich sorry but it is not clear for me what you mean by "b" in here. – Tim Oct 22 '19 at 08:21
-
of y=a+bx (linear regression) – Sarah kenwich Oct 22 '19 at 14:14
-
@Sarahkenwich $\beta_1$ (using notation from the above answer) is s *single* random variable. There's nothing to sum about it. – Tim Oct 22 '19 at 14:18
-
@Sarahkenwich $\beta_0$ and $\beta_1$ are parameters. Your comments are not clear for me. Moreover, if you have other questions, please post them as separate questions. Comments are not meant for this. – Tim Oct 22 '19 at 19:24
-
if i want to verify that the values of likelihood function will not be the same what should i write? – Sarah kenwich Oct 23 '19 at 16:08