Questions tagged [least-squares]

Refers to a general estimation technique that selects the parameter value to minimize the squared difference between two quantities, such as the observed value of a variable, and the expected value of that observation conditioned on the parameter value. Gaussian linear models are fit by least squares and least squares is the idea underlying the use of mean-squared-error (MSE) as a way of evaluating an estimator.

Overview

Refers to a general estimation technique that selects the parameter value to minimize the squared difference between two quantities, such as the observed value of a variable, and the expected value of that observation conditioned on the parameter value. Gaussian linear models are fit by least squares and least squares is the idea underlying the use of mean-squared-error (MSE) as a way of evaluating an estimator.

Formulation

Given a set of data $(x_1,y_1),...,(x_n,y_n)$ where $x_i \in \mathbb{R}^{p}$ and a vector of coefficients $\beta$, the least squares estimate is the solution to the equation:

$$\widehat{\beta}_{LS} = \underset{\beta} {\text{arg min}} \sum\limits_{i=1}^{n}(y_i - \sum\limits_{j=1}^{p}x_{i,j}\beta_{j})^2 = || {\bf y - X\beta}||^2$$

Using linear algebra, one can find the least squares hyperplane:

$$ {\bf \widehat{\beta} = (X^TX)^{-1}X^{T}y} $$

References

Least squares methods are treated in many introductory statistics resources and textbooks, but there are also advanced resources dedicated only to the subject, for example:

2841 questions
11
votes
3 answers

Why vertical distances?

Why does OLS estimation involve taking vertical deviations of the points to the line rather than horizontal distances?
user333
  • 7,211
8
votes
4 answers

Why do people often run a regression with and without control variables?

I often run regressions from a low-n dataset (~100 observations). Often the results are only significant with the inclusion of control variables. However, I often see journal articles where people (always with a massive number of observations) claim…
5
votes
1 answer

Least Squares Estimation of Poisson Parameter

"Assume independent random variables $Y_i$~$Poisson(λx_i)$. Supposing that $x_i$ are given, fixed constants, obtain the least squares estimator of $λ$ and compute its variance." This kind of a problem is the first one faced by me. The first things…
4
votes
3 answers

Why $(y-Xb)^T(y-Xb)\ne y^Ty-b^TX^Ty$, where $b=(X^TX)^{-1}X^Ty$ is the least squares estimate?

Let $b=(X^TX)^{-1}X^Ty$ be the ordinary least squares estimate. Then the sum of squared residuals is $$\begin{align} (y-Xb)^T(y-Xb)&=y^Ty-y^TXb-b^TX^Ty+b^TX^TXb\\ &=y^Ty-b^TX^Ty. \end{align}$$ The carbohydrate data below is from the book An…
Dan Li
  • 179
4
votes
1 answer

What is the logic behind OLS assumption diagnosis?

From my understanding, the property of OLS regression model is based on the assumption that there exists a set of $β_1$, $β_2$, $β_3$ ... $β_k$ that makes the error $ϵ$ satisfy the OLS assumptions (linear, homoscedasticity, etc.). And our further…
Yuan
  • 503
4
votes
1 answer

Estimating k in d=kv

This example was taken from Mathematical Statistics : A Unified Introduction (ISBN 9780387227696), page 58, under the section 'The Principle of Least Squares'. I think my problem has more to do with algebra but since this is a statistics book, I…
Sara
  • 1,487
4
votes
1 answer

Standard deviation of least-squares standard error

I do a measurement where I collect a set of data and fit it to a linear model using ordinary least squares. From that I get a slope, b and the standard error of it, s. Now I repeat the measurement N times and get N slopes and N standard errors. I…
student1
  • 337
  • 2
  • 11
4
votes
1 answer

Testing Model Assumptions in R

I need to run several tests in R to make sure that the basic linear model assumptions hold for this time series OLS model. I'm very new to this, so I'm unsure in some cases of how to test for these, in others how to correct for them. Here's what I…
Brad G.
  • 199
4
votes
0 answers

Best-fit plane through a set of lines?

A linear model estimates the best fit line from a set of points, often through minimization of the sum of squared residuals. By analogy, is there any established method (possibly implemented in R) for fitting a plane to a set of lines (or segments)…
Rodolphe
  • 1,033
3
votes
2 answers

terms in a simple linear least square model

I'm reading a textbook. In the chapter about least square regression I red that A simple linear least square model can be described as \begin{equation} Y = \alpha + \beta x + e \end{equation} where Y is the mean response, x is an independent…
Nownuri
  • 409
3
votes
2 answers

Sum of squared residuals and MSE

It seems that minimizing the sum of squared residuals (SSR) in linear regression is equivalent to minimizing MSE (both use true value - prediction) and OLS is the best estimator for minimizing SSR. I also read that least squares can sometimes…
user34829
  • 330
  • 1
  • 3
  • 11
3
votes
1 answer

Why are least-squares parameters normally distributed?

I am trying to figure out why the parameter $$\begin{equation*} \hat\beta = (X^TX)^{-1}X^TY \end{equation*}$$ is normally distributed in least-squares prediction. (Where Y is a linear function plus normal noise.) All the examples I've found have…
3
votes
1 answer

linearity assumption Regression

I fail to understand the need for the linearity assumption in the Gauss-Markov theorem and, even worse, I do not understand its meaning. We say that the model should be linear in the coefficients or parameters, implying that regressing $y$ on $x$…
Daniel Pinto
  • 633
  • 6
  • 16
3
votes
0 answers

Derivation of the weighted least squares (WLS) method

I am trying to understand the origin of the weighted least squares estimation. I'll try to describe my thought process: Introduction Let's say that we have the following system: $$ y = Hx + v, $$ where $x \in \mathbb{R}^n$ is some constant vector…
mgulin
  • 31
2
votes
1 answer

How can this inequality be otherwise expressed?

Consider an ordered pair of random variables $(x_i,y_i)$, and the following relationship: $$\frac{\left(\sum_i^n x_i\right)^2}{\sum_i^n x_i y_i}\leq \sum_i^n\frac{x_i}{y_i}$$ Is there some useful way of restating the relationship in terms of…
user9437
1
2 3 4 5 6