I need to code a least squares routine to fit a line
$$y = m*x$$
into a 2d set of points
$$(x_i,y_i)$$
How can I find the regression line without an interceptor?
I need to code a least squares routine to fit a line
$$y = m*x$$
into a 2d set of points
$$(x_i,y_i)$$
How can I find the regression line without an interceptor?
If I understand your problem, you want to find the regression line without an interceptor, in which case you can use the estimator of $\beta$
$$\hat{\beta} = \frac{\overline{xy}}{\overline{x^2}}$$