1. Home
  2. Explore
  3. Mathematics
  4. Linear Regression

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Linear Regression

  • 20Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Regression Basics

What is the goal of regression in statistics?

20 questions

  1. 1

    What is the goal of regression in statistics?

    Model answer

    To predict one variable (the explained variable) based on another variable (the explanatory variable).

    Explanation

    Regression aims to model the relationship between variables to enable prediction, often by estimating a function f such that y ≈ f(x).

  2. 2

    What are the common names for the explained variable and the explanatory variable in regression?

    Model answer

    The explained variable is also called the dependent variable or response variable; the explanatory variable is also called the independent variable or predictor.

    Explanation

    These terms are used interchangeably in regression contexts. The explained variable is what we want to predict, and the explanatory variable is what we use to predict.

  3. 3

    What is the difference between univariate regression and multivariate regression?

    Model answer

    Univariate regression has one explanatory variable (x is a scalar), while multivariate regression has two or more explanatory variables (x is a vector in ℝᵖ with p ≥ 2).

    Explanation

    In univariate regression, the model is y = a + bx + ε. In multivariate regression, the model is y = a + b₁x₁ + b₂x₂ + ... + bₚxₚ + ε.

  4. 4

    Why is linear regression considered the simplest non‑trivial function for modeling relationships?

    Model answer

    Because the simplest function that depends on x is a constant (no dependence), and linear functions are the next simplest while still allowing the prediction to vary with x.

    Explanation

    Linear functions are easy to interpret and often provide a good approximation even when the true relationship is nonlinear, making them a common starting point.

  5. 5

    In the linear regression model y = a + bx + ε, what does ε represent?

    Model answer

    ε represents random noise or error, accounting for everything not captured by the linear relationship between x and y, including measurement error and unobserved factors.

    Explanation

    The noise term ε allows for deviations from the exact linear relationship; it is assumed to have certain properties (e.g., mean zero) to make estimation possible.

  6. 6

    How can a nonlinear relationship be transformed into a linear one for regression?

    Model answer

    By applying transformations such as logarithms, exponentials, or squares to the variables. For example, the ideal gas law PV = nRT can be turned into log P = a − log V + log T + ε.

    Explanation

    Variable transformation is domain‑specific and can linearize multiplicative or power‑law relationships, allowing linear regression to be used.

  7. 7

    What is the least squares criterion for finding the best‑fitting line in univariate regression?

    Model answer

    Minimize the expectation of (y − a − bx)², or equivalently minimize the average squared vertical distance from the data points to the line.

    Explanation

    Vertical distances are used because they are mathematically convenient (allowing closed‑form solutions) and correspond to minimizing the sum of squared errors.

  8. 8

    Derive the population least squares solutions for a and b assuming no centering.

    Model answer

    b=Cov(x,y)Var(x)b = \frac{\text{Cov}(x,y)}{\text{Var}(x)}b=Var(x)Cov(x,y)​ and a=E[y]−bE[x]a = \mathbb{E}[y] - b\mathbb{E}[x]a=E[y]−bE[x].

    Explanation

    Minimizing E[(y−a−bx)2]\mathbb{E}[(y - a - bx)^2]E[(y−a−bx)2] gives two equations: a+bE[x]=E[y]a + b\mathbb{E}[x] = \mathbb{E}[y]a+bE[x]=E[y] and E[xy]=aE[x]+bE[x2]\mathbb{E}[xy] = a\mathbb{E}[x] + b\mathbb{E}[x^2]E[xy]=aE[x]+bE[x2]. Solving yields the formulas.

  9. 9

    Why must the variance of x be non‑zero for the least squares solution to exist?

    Model answer

    Because the formula for b involves division by Var(x). If Var(x) = 0, all x values are identical, making it impossible to estimate a slope uniquely.

    Explanation

    Without variation in x, the data provides no information about how y changes with x, so the slope cannot be determined.

  10. 10

    What two conditions does the least squares solution impose on the error term ε = y − (a + bx)?

    Model answer

    The error has zero mean: E[ε]=0\mathbb{E}[ε] = 0E[ε]=0, and zero covariance with x: Cov(x,ε)=0\text{Cov}(x, ε) = 0Cov(x,ε)=0.

    Explanation

    These conditions follow from setting the derivatives of the least squares criterion to zero. They ensure the best linear fit is unbiased in a probabilistic sense.

  11. 11

    Give two common assumptions about the relationship between x and ε that guarantee the two conditions above.

    Model answer

    Either assume x and ε are independent, or assume E[ε∣x]=0\mathbb{E}[ε|x] = 0E[ε∣x]=0 (zero conditional mean).

    Explanation

    Independence implies zero covariance, and zero conditional mean implies both E[ε]=0\mathbb{E}[ε] = 0E[ε]=0 and Cov(x,ε)=0\text{Cov}(x,ε)=0Cov(x,ε)=0. These are standard assumptions in regression modeling.

  12. 12

    To perform inference (e.g., confidence intervals), what additional assumption is often made about ε?

    Model answer

    That ε follows a Gaussian (normal) distribution.

    Explanation

    Normality of errors allows the use of t‑distributions for hypothesis testing and constructing confidence intervals for the regression coefficients.

  13. 13

    How are the sample estimators a^\hat{a}a^ and b^\hat{b}b^ obtained from the population formulas?

    Model answer

    Replace expectations with sample averages: b^=xy‾−xˉyˉx2‾−xˉ2\hat{b} = \frac{\overline{xy} - \bar{x}\bar{y}}{\overline{x^2} - \bar{x}^2}b^=x2−xˉ2xy​−xˉyˉ​​ and a^=yˉ−b^xˉ\hat{a} = \bar{y} - \hat{b}\bar{x}a^=yˉ​−b^xˉ, where xy‾=1n∑xiyi\overline{xy} = \frac{1}{n}\sum x_i y_ixy​=n1​∑xi​yi​, etc.

    Explanation

    This is the method of moments: estimate population moments (expectations) by their sample counterparts. Alternatively, minimize the sum of squared errors directly yields the same formulas.

  14. 14

    In multivariate regression, what is the model in matrix form?

    Model answer

    y=Xβ+ε\mathbf{y} = \mathbf{X}\boldsymbol{\beta} + \boldsymbol{\varepsilon}y=Xβ+ε, where y\mathbf{y}y is an nnn-vector, X\mathbf{X}X is an n×pn \times pn×p matrix (with first column of ones for the intercept), β\boldsymbol{\beta}β is a ppp-vector of coefficients, and ε\boldsymbol{\varepsilon}ε is an nnn-vector of errors.

    Explanation

    Each row of X\mathbf{X}X contains the explanatory variables for one observation, including a 1 for the intercept. The model assumes each yi=xiTβ+εiy_i = \mathbf{x}_i^T \boldsymbol{\beta} + \varepsilon_iyi​=xiT​β+εi​.

  15. 15

    How is the intercept included in the multivariate regression model?

    Model answer

    By adding a column of ones to the design matrix X\mathbf{X}X. The corresponding coefficient is the intercept.

    Explanation

    This allows the model y=β1x1+β2x2+...+βpxpy = \beta_1 x_1 + \beta_2 x_2 + ... + \beta_p x_py=β1​x1​+β2​x2​+...+βp​xp​ to include a constant term when the first variable x1x_1x1​ is always 1.

  16. 16

    What does the condition Cov(x,ε)=0\text{Cov}(\mathbf{x}, \varepsilon) = 0Cov(x,ε)=0 mean in multivariate regression?

    Model answer

    It means that for each coordinate of x\mathbf{x}x, the covariance between that coordinate and ε\varepsilonε is zero.

    Explanation

    This is a vector condition ensuring no linear relationship between any explanatory variable and the error, analogous to the univariate case. Often justified by assuming x\mathbf{x}x and ε\varepsilonε are independent or E[ε∣x]=0\mathbb{E}[\varepsilon|\mathbf{x}]=0E[ε∣x]=0.

  17. 17

    Write the least squares criterion for multivariate regression in matrix form.

    Model answer

    min⁡t∈Rp∥y−Xt∥2\min_{\mathbf{t} \in \mathbb{R}^p} \|\mathbf{y} - \mathbf{X}\mathbf{t}\|^2mint∈Rp​∥y−Xt∥2, where ∥⋅∥\|\cdot\|∥⋅∥ denotes the Euclidean norm (sum of squared components).

    Explanation

    This is the natural extension of the univariate least squares: minimize the sum of squared residuals across all observations. The solution β^\hat{\boldsymbol{\beta}}β^​ can be obtained by solving the normal equations.

  18. 18

    Why is matrix notation used for multivariate regression instead of solving coordinate‑by‑coordinate?

    Model answer

    Because the solution involves all cross‑covariances between explanatory variables, leading to a system of p equations. Matrix notation allows a compact representation and formal solution via matrix inversion.

    Explanation

    The gradient conditions produce a linear system XTXβ=XTy\mathbf{X}^T\mathbf{X}\boldsymbol{\beta} = \mathbf{X}^T\mathbf{y}XTXβ=XTy, which can be expressed as β=(XTX)−1XTy\boldsymbol{\beta} = (\mathbf{X}^T\mathbf{X})^{-1}\mathbf{X}^T\mathbf{y}β=(XTX)−1XTy if the inverse exists.

  19. 19

    What is an alternative to least squares regression that minimizes absolute deviations instead of squared deviations?

    Model answer

    Mean absolute deviation (LAD) regression, which minimizes ∑i=1n∣yi−a−bxi∣\sum_{i=1}^n |y_i - a - bx_i|∑i=1n​∣yi​−a−bxi​∣.

    Explanation

    LAD is less sensitive to outliers than least squares but does not have a closed‑form solution; it must be solved numerically.

  20. 20

    In the context of regression, what does the statement 'statisticians manage to miss all the points' illustrate?

    Model answer

    It illustrates that in scatterplots, data points rarely lie exactly on the fitted regression line; the line is an estimate that minimizes the distance to the points, but most points are off the line.

    Explanation

    The saying humorously points out that even with many data points, the linear model typically does not pass through any of them because of random noise.

1 of 20
Question 1 of 20

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent