4.9.23 · HinglishProbability Theory & Statistics

Multiple regression

1,777 words8 min readRead in English

4.9.23 · Maths › Probability Theory & Statistics


YEH HAI KYA?

"Partial" kyun? Simple regression mein ek slope ka direct effect aur jo bhi cheez ke saath correlate karti hai, dono ko mix kar deta hai. Model mein kai predictors hone par, sirf ka effect measure karta hai jab baaki predictors ne jo kuch explain kar saka, woh kar liya ho — yahi uska unique contribution hai.


Matrix form — kyun hum notation switch karte hain

equations ek-ek karke likhna bahut mushkil hai. Inhe stack karo.

1's ka column ISSI TARAH intercept ko matrix algebra mein fold karta hai (yeh har row mein se multiply hota hai).


DERIVATION scratch se — normal equations

Goal: ko is tarah choose karo ki sum of squared residuals (vertical gaps) minimum ho:

Squares kyun? Yeh smooth (differentiable) hote hain, bade misses ko zyada penalise karte hain, aur ek unique closed-form answer dete hain.

Step 1 — expand karo. Yeh step kyun? Dono cross terms aur equal scalars hain (ek doosre ke transpose), isliye woh term mein combine ho jaate hain.

Step 2 — vector ke w.r.t. differentiate karo aur zero set karo. aur (symmetric ke liye) use karte hue: Zero kyun set karte hain? Minimum par gradient zero hota hai; convex hai (ek quadratic with PSD Hessian ), isliye yeh stationary point global minimum hai.

Step 3 — normal equations.

Step 4 — solve karo (agar invertible hai, yaani predictors perfectly collinear nahi hain):

Figure — Multiple regression

Fit measure karna: aur adjusted

Problem: koi bhi predictor (chahe random hi ho) add karne par kabhi kam nahi hota. Isliye hum complexity ko penalise karte hain:


Worked Example 1 — chhota 2-predictor fit by hand-logic

Data: exam score predict karo hours studied aur hours slept se.

1 1 6 50
2 2 7 65
3 3 5 70
4 4 8 85

Hum banate hain ek leading 1-column ke saath, (ek matrix) aur form karte hain, phir solve karte hain.

  • 1-column kyun include karte hain? Iske bina hum surface ko origin se force karte hain — jo usually galat hota hai.
  • Linear system kyun solve karte hain, eyeball kyun nahi? 2+ predictors ke saath koi simple ratio nahi hota; predictors information share karte hain, isliye saare slopes jointly solve karne padte hain.

(Neeche ka VERIFY block is exact system ko symbolically solve karta hai.)


Worked Example 2 — partial slope interpret karna

Maano ek fit deta hai jahaan =hours studied, =hours slept.

  • : ek extra ghante ki study 8 points add karti hai, sleep constant rakhte hue. "Holding constant" kyun matter karta hai: agar jo students zyada padhte hain woh zyada sote bhi hain, toh ka sirf par simple regression galti se study ko sleep ka benefit bhi credit kar dega.
  • ke liye predict karo: . Kyun: bas plug in karo; model linear hai isliye yeh ek weighted sum hai.

Common mistakes (Steel-man + fix)


Recall Feynman: ek 12-saal ke bacche ko samjhao

Socho tum guess kar rahe ho ki ek plant kitna lamba badhega yeh dekhke ki use kitna paani aur kitni dhoop mili. Tum kai plants collect karte ho aur in dots mein se best flat "ramp" draw karte ho taaki dots aur ramp ke upar-neeche ki distances smallest hon. Paani direction mein ramp ki steepness batati hai ki plant har cup paani par kitna zyada lamba hota hai — maan ke ki dhoop same rehti hai — aur dhoop direction ki steepness light ke liye wahi kaam karti hai. Multiple regression bas us best ramp ko dhundhne ka maths hai.


Flashcards

Multiple regression mein partial slope kya measure karta hai?
mein change per unit change in jabki baaki saare predictors fixed hon (uska unique contribution).
Least-squares estimator ko matrix form mein likho.
.
Normal equations batao.
.
mein ones ka column kyun add kiya jaata hai?
Intercept estimate karne ke liye; iske bina hyperplane origin se force hota hai.
Multiple regression kaunsa objective minimise karta hai?
Sum of squared residuals .
Geometrically, kya hai?
ka orthogonal projection ke column space par; residual uske perpendicular hota hai.
Adjusted , se zyada kyun use karte hain?
kabhi kam nahi hota jab predictors add kiye jaate hain; adjusted degrees of freedom ke zariye extra parameters ko penalise karta hai.
Multicollinearity ke under kya problem hoti hai?
near-singular ho jaata hai, isliye uska inverse aur coefficient variances explode ho jaate hain → unstable estimates.
ko sums of squares ke zariye define karo.
.
OLS mein squared (absolute nahi) residuals kyun?
Smooth/differentiable, convex, unique closed-form solution deta hai aur orthogonal-projection geometry milti hai.

Connections

Concept Map

generalises to

models

contains

measures

stacked into

column of 1s gives

fit by minimising

differentiate and set to zero

solved gives

requires

assumes errors

Simple regression line

Multiple regression hyperplane

y equals linear combo of predictors

Partial slope beta_j

Unique effect holding others fixed

Matrix form y equals X beta plus eps

Intercept beta_0

Sum of squared residuals

Normal equations

Estimated beta hat

X transpose X invertible

Zero mean constant variance independent

Deep Dive