Multiple regression
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):

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?
Least-squares estimator ko matrix form mein likho.
Normal equations batao.
mein ones ka column kyun add kiya jaata hai?
Multiple regression kaunsa objective minimise karta hai?
Geometrically, kya hai?
Adjusted , se zyada kyun use karte hain?
Multicollinearity ke under kya problem hoti hai?
ko sums of squares ke zariye define karo.
OLS mein squared (absolute nahi) residuals kyun?
Connections
- Simple Linear Regression — ka special case.
- Ordinary Least Squares — yahan use kiya gaya estimation principle.
- Orthogonal Projection — fitted values ka geometric meaning.
- Multicollinearity & VIF — jab behave nahi karta.
- Gauss–Markov Theorem — kyun OLS assumptions ke under BLUE hai.
- Coefficient of Determination — aur adjusted .
- Matrix Inverse / Positive Semidefinite Matrices — normal equations ki solvability.