Back to the 2023 paper

Module 2: Linear Models and Bayesian Learning

20237m

What is Linear Regression? Explain in detail using example and list all the assumption to be met before starting with linear regression.

Worked SolutionAI Assisted

Linear Regression:

Model: y=w0+w1x1+...+wdxd+ϵ=wTx+b+ϵy = w_0 + w_1 x_1 + ... + w_d x_d + \epsilon = w^T x + b + \epsilon, with ϵ∼N(0,σ2)\epsilon\sim N(0,\sigma^2). Goal: learn ww minimizing squared loss J(w)=∑(yi−wTxi)2J(w)=\sum (y_i - w^T x_i)^2 or MLE under Gaussian noise.

Closed form: w∗=(XTX)−1XTyw^* = (X^T X)^{-1}X^T y (OLS). Gradient descent also: $w:=w-\eta
abla J$.

Example: Predict house price yy (in lakhs) from size xx (sq ft). Data: (1000,50), (1500,70), (2000,90) → learn y≈0.04x+10y\approx 0.04x +10 → for 1200 sq ft predict 5858L.

Types: Simple (one predictor), Multiple (many), Polynomial (features x2,x3x^2, x^3 but linear in parameters).

Assumptions to be met before Linear Regression:

  1. Linearity: Relationship between XX and YY is linear (check scatter plot, residuals vs fitted).
  2. Independence of errors: Observations independent (no autocorrelation, Durbin-Watson).
  3. Homoscedasticity: Constant variance of residuals Var(ϵ∣X)=σ2Var(\epsilon|X)=\sigma^2 (Breusch-Pagan test).
  4. Normality of residuals: ϵ∼Normal\epsilon \sim Normal for inference (Q-Q plot, Shapiro-Wilk) — not strictly for prediction.
  5. No multicollinearity: Predictors not highly correlated (VIF <5-10).
  6. No autocorrelation and no endogeneity (E[ϵ∣X]=0E[\epsilon|X]=0).
  7. No influential outliers (Cook's distance).
  8. Features not random, measured without error, sample size n≫dn \gg d.

Checks/Remedies: Transform variables (log), remove outliers, ridge if multicollinearity, Weighted LS if heteroscedasticity. Violations bias estimates / invalidate p-values.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.