Linear Regression via Least Squares - Linear Algebra
- Find the least-squares solution for the system where and . Answer: We must solve the normal equations . First, calculate the components: . . . The system to solve is . From the first row, , which simplifies to . From the second row, . Substituting into the second equation gives . Then . The solution is .
- A researcher fits a line to data points using least squares. The sum of squared residuals is , and the total sum of squares is . If one additional data point is added that lies exactly on the fitted regression line, what happens to the coefficient of determination ? Answer: increases because the new point has zero residual, improving the overall fit quality When you encounter questions about how additional data points affect regression statistics, focus on how the coefficient of determination responds to changes in both the sum of squared residuals and total sum of squares. Initially, . When you add a point that lies exactly on the original fitted line, that new point has zero residual (perfect prediction), so remains 45. However, increases because you're adding another data point's contribution to the total variability around the overall mean of all points. Since the denominator increases while the numerator stays constant, the fraction decreases, making larger. Option A is wrong because adding one point on the line doesn't create an underdetermined system—you still have more data points than parameters. Option B incorrectly assumes the regression line changes significantly and that any change increases variability, but a point on the original line actually demonstrates perfect fit for that observation. Option C misses the crucial insight that while doesn't change, does increase, so the ratio changes even though the linear relationship appears unchanged. Study tip: Remember that depends on both and . When analyzing how additional data affects , always consider how both components change, not just whether the new point fits well. Points with zero residuals always improve by increasing without increasing .
- Two researchers analyze the same dataset but use different approaches: Researcher A centers the -data by subtracting the mean before fitting , while Researcher B uses the original -values. If the original data has and the least squares line using original data is , what line will Researcher A obtain? Answer: where When you encounter problems about data transformations in regression, the key insight is understanding how centering affects the intercept while leaving the slope unchanged. Let's work through what happens when Researcher A centers the data. The original regression line is with . When we center the x-values by subtracting the mean, we create , so . Substituting this into the original equation: The slope remains 0.8 because centering is just a horizontal shift that doesn't change the relationship's steepness. The intercept becomes 6 because when (meaning , the original mean), we need . Answer A incorrectly keeps the original intercept of 2, missing that centering shifts where the line crosses the y-axis. Answer C gives -2 as the intercept, which would result from subtracting rather than adding the slope adjustment. Answer D not only has the wrong intercept but also incorrectly changes the slope to 0.64, suggesting a misunderstanding that centering affects the relationship's strength. Study tip: Remember that centering data only shifts the intercept—it never changes the slope. The new intercept equals the y-value when the centered variable equals zero (i.e., when the original variable equals its mean).
- Let be the least-squares solution to the system . The vector represents which of the following? Answer: The orthogonal projection of onto the column space of . The least-squares solution is found such that is the vector in the column space of (denoted ) that is closest to . This closest vector is the orthogonal projection of onto . The error vector is , not . The row space is not the correct subspace for the projection of . The solution vector is in the domain , not the codomain where resides.
- To find the best-fit parabola of the form (note the missing linear term) for a set of data points , a linear system is constructed. Which of the following correctly represents the design matrix for this model? Answer: The model equation is . The coefficients to be found are and . For each data point , we get an equation . The columns of the design matrix correspond to the functions of that are multiplied by the coefficients. In this case, they are and . Therefore, the -th row of should be . Choice A is for a linear model . Choice C is for a full quadratic model . Choice D incorrectly includes the dependent variable in the design matrix.
- If the least-squares error for the system is zero, what can be definitively concluded? Answer: The vector is in the column space of . The least-squares error is given by . If this error is zero, it means , or . This implies that there exists a vector such that can be written as a linear combination of the columns of . By definition, this means is in the column space of , and the system was consistent from the start. A non-trivial null space (A) could still exist if there are multiple solutions. The solution (B) is only zero if is zero (and columns of A are LI). The columns of (D) do not need to be orthonormal.
- In a least squares regression with design matrix where and , the projection matrix is . If a new data point is added where is orthogonal to all columns of , how does this affect the original least squares solution ? Answer: remains unchanged because contributes zero information about the existing parameter relationships When you encounter questions about adding data points to least squares regression, focus on how the new information interacts with your existing parameter space. The key insight here is understanding what "orthogonal to all columns of " means geometrically. The least squares solution projects the response vector onto the column space of . When is orthogonal to all columns of , it lies entirely outside this column space. This means cannot be expressed as any linear combination of the existing columns, so it provides no information about the relationships between and the original features. Mathematically, since , we have . The new point adds a residual that's orthogonal to the original fitted values, leaving the projection onto the original column space unchanged. Therefore, remains unchanged, making D correct. Option A incorrectly suggests a scaling effect from sample size, but least squares doesn't normalize by . Option B misunderstands degrees of freedom—orthogonal directions don't affect existing parameter estimates. Option C is wrong because adding a linearly independent vector (which orthogonal is) actually increases rank, not decreases it. Study tip: Remember that in regression, only the component of new data that lies within your existing feature space affects parameter estimates. Orthogonal components contribute only to unexplained variance, not to .
- Let be the least-squares solution to an inconsistent system . If is the corresponding error vector, which of the following statements about is always true? Answer: is orthogonal to the column space of . The fundamental principle of least-squares is that the error vector must be orthogonal to the subspace onto which we are projecting, which is the column space of . This condition, , gives rise to the normal equations. The error vector is only the zero vector if the system is consistent, which it is not. There is no guarantee that is orthogonal to . Since is orthogonal to , it cannot be an element of it (unless it is the zero vector).
- A system is inconsistent. Which of the following best describes the goal of solving the associated normal equations, ? Answer: To find a vector that is an exact solution to a modified system where is replaced by its projection onto . When you encounter an inconsistent system , you're dealing with a fundamental problem: the vector doesn't lie in the column space of , so no exact solution exists. The normal equations provide the best possible alternative by finding the least squares solution. The key insight is understanding what "best possible" means geometrically. Since isn't in , we find the closest vector that is in – this is the orthogonal projection of onto , denoted . The normal equations actually solve the modified system , which has an exact solution because the projection lies in the column space. Option D correctly captures this: we're solving a system where is replaced by its projection onto . Option A is wrong because minimizing isn't the goal – we minimize . Option B misunderstands the objective; we're not trying to satisfy individual equations but rather minimizing the overall residual. Option C is incorrect because the normal equations don't involve orthogonalizing the columns of – that would be a different approach like QR decomposition. Remember: the normal equations always transform an inconsistent system into a consistent one by projecting onto the column space, making exact solution possible.
- Consider finding the least-squares solution to . Let be the best approximation of in the column space of . Which of the following statements is always true? Answer: The vector is orthogonal to . When you encounter least-squares problems, you're working with orthogonal projections. The key insight is understanding the geometric relationship between the original vector , its projection onto the column space of , and the error vector . The fundamental property of orthogonal projection is that the error vector (the difference between the original vector and its projection) is always orthogonal to the projection itself. This is because lies in the column space of , and the least-squares solution minimizes by ensuring the residual is orthogonal to the entire column space. Since is in this column space, must be orthogonal to . This confirms answer D is correct. Let's examine why the other options fail. Option A claims is orthogonal to , but this only occurs in the special case where is entirely outside the column space. Generally, and have a non-zero dot product. Option B suggests equal norms, but with equality only when is already in the column space. Option C incorrectly relates to —there's no required orthogonality between the solution vector and the projection. Remember: in least-squares problems, always think about the orthogonal decomposition , where the projection and error components are perpendicular.
- A researcher collects data points and wants to fit a line using least squares. If the normal equations yield the system , what is the slope of the least squares line? Answer: Solving the normal equations: From the second equation, , so . Substituting into the first equation: . This gives , which simplifies to , so and . Choice B results from arithmetic errors in fraction manipulation. Choice C comes from incorrectly using instead of dividing by 4. Choice D results from sign errors in the substitution.
- In a weighted least squares problem, the objective is to minimize where . If the weights are for data points , what is the effective design matrix in the transformed problem ? Answer: When you encounter weighted least squares problems, the key insight is transforming the weighted problem into a standard least squares form by incorporating the square roots of the weights into both the design matrix and response vector. Starting with the original design matrix for the linear model , you have: To transform this into the standard form , you multiply each row by . With weights , the square roots are . This gives you: This matches answer choice B. Choice A incorrectly uses instead of in the last row. Choice C uses the original weights instead of their square roots ( instead of ). Choice D appears to use in the first row, suggesting confusion about how to apply the transformation. Remember: in weighted least squares transformations, always use the square root of the weights to scale each row of both the design matrix and response vector. This converts the weighted problem into an equivalent unweighted problem that preserves the underlying linear algebra structure.
- What is the slope of the least-squares regression line for the data points , , , and ? Answer: The model is . The matrix system is with and . The normal equations are . We compute and . We must solve . The second row gives . The first row gives , or . Subtracting the two equations: , which simplifies to , so . The slope is .
- Consider two least squares problems: Problem 1 fits to points , and Problem 2 fits to the same points. The normal equations for Problem 1 yield . What is the key difference in the solutions? Answer: Both problems yield identical solutions since they represent the same linear model with reordered parameters When you encounter least squares problems with different parameter orderings, focus on whether the underlying mathematical model actually changes. Both problems are fitting the exact same linear relationship to the same data points—they just use different variable names and orderings. Problem 1 uses (intercept first, slope second) while Problem 2 uses (slope first, intercept second). Since the data points lie perfectly on the line , both problems will find the same line: intercept = 0, slope = 2. The only difference is that Problem 1 gives you while Problem 2 gives you . Choice A is incorrect because both problems have unique solutions—reordering parameters doesn't change the mathematical properties of the system. Choice B misunderstands parameter ordering: the slope value itself doesn't change, only which variable represents it. The numerical conditioning of the normal equations remains the same since you're solving the same geometric problem. Choice D is wrong because identical models fitting identical data must produce identical residuals—the residual sum of squares measures the quality of fit, which is unchanged by parameter relabeling. Choice C correctly recognizes that these represent the same linear model with reordered parameters, yielding identical solutions. Study tip: When comparing least squares formulations, always check if they represent the same underlying model before analyzing differences in conditioning or solution properties.
- A researcher wants to find the best-fit line of the form for the data points , , and . The least-squares solution is found by solving the normal equations . What is the matrix for this problem? Answer: First, construct the design matrix and the observation vector . The -th row of is . So, and . Next, find the transpose . Finally, compute the product : . Choice A is . Choice C results from incorrectly setting up with columns swapped. Choice D is the matrix itself.
- A dataset has design matrix and response vector . If lies in the column space of , and the least squares solution is , what is the relationship between the residual vector and the fitted values ? Answer: and , since is exactly representable in the column space If lies in the column space of , then there exists an exact solution such that . The least squares solution will find this exact solution, making and thus . Choice B describes the general orthogonality property but doesn't account for the special case where is in the column space. Choice C is incorrect because lies in the null space of , not the column space of . Choice D gives an arbitrary relationship that doesn't follow from projection theory.
- The least-squares solution to the system is unique if and only if which condition is met? Answer: The columns of are linearly independent. The least-squares solution is found by solving the normal equations . This system has a unique solution if and only if the matrix is invertible. The matrix is invertible if and only if the columns of are linearly independent. If is square and invertible (B), there is a unique exact solution, which is a special case. Orthogonal columns (C) is a sufficient condition for linear independence, but not a necessary one. If is in (D), an exact solution exists, but it may not be unique if the columns of are linearly dependent.
- Let be a least-squares solution to an inconsistent system . Which of the following conditions is NOT necessarily satisfied by ? Answer: The defining property of the least-squares solution is that the error vector, , is orthogonal to the column space of . This orthogonality condition is expressed as , which is choice A. Choice D is the definition of minimizing the residual norm. Choice C is the geometric interpretation of the result. Choice B, , states that the error vector is in the null space of . This is not generally true; the error vector is in the null space of (the orthogonal complement of the column space of ).
- A least squares regression produces the fitted model with residuals . If the original -values are transformed by , what will be the residuals for the regression of on ? Answer: When you encounter questions about transforming data in regression, the key insight is understanding how linear transformations affect both fitted values and residuals in predictable ways. A residual is the difference between an observed value and its fitted value: . When you transform the response variable by , both the observed values and fitted values get transformed by the same rule. This means and . The new residuals become: . The constant term (-3) cancels out completely, and only the multiplicative factor (2) affects the residuals. Therefore: , , and . Answer C is correct. Answer A incorrectly assumes residuals remain unchanged after transformation. Answer B appears to subtract 3 from each doubled residual, wrongly applying the constant term. Answer D seems to add values nonsensically without following any transformation rule. Remember: when you transform by , residuals get multiplied by only—the constant always cancels out because it affects both observed and fitted values equally.
- Consider the least squares problem for fitting to data points . The design matrix has the property that is singular. What can be concluded about this least squares problem? Answer: The normal equations have infinitely many solutions, indicating the model is overparameterized for this dataset When is singular, the normal equations have either no solution or infinitely many solutions. Since we're fitting 2 parameters to 3 data points with a reasonable model, the system is typically consistent, leading to infinitely many solutions. This indicates linear dependence in the columns of , meaning the model is overparameterized. Choice B is wrong because inconsistency relates to not being in the column space of , which is unlikely here. Choice C confuses singularity with perfect fitting. Choice D overstates the problem - while regularization could help, the standard approach doesn't 'fail completely.'