Professional Documents
Culture Documents
L5 Normal Equations For Regression PDF
L5 Normal Equations For Regression PDF
L5 Normal Equations For Regression PDF
2. Normal Equations
• Normal equations are equations obtained by setting equal to zero the
partial derivatives of the sum of squared errors (least squares);
• The Normal equations give us a method to find the parameters directly.
Normal Equation
Direct (Closed Form) Solution
Intuition: If 1D
(for every )
Solve for
Multi-Variate Regression
Size (feet2) Number of Number of Age of home Price ($1000)
bedrooms floors (years)
1 2104 5 1 45 460
1 1416 3 2 40 232
1 1534 3 2 30 315
1 852 2 1 36 178
Also called
design matrix
Given
Knowing (A symmetric):
Maximum Likelihood
Interpretation to Linear
Regression
Probabilistic Interpretation
• Assume the target prediction is modeled as follows:
• 𝜖(i) is an error term that captures either:
• unmodeled effects such as if there are some features very pertinent to
predicting housing price, but that we’d left out of the regression),
• or random noise.
• Assume that the 𝜖(i) are distributed IID (independently and identically
distributed) according to a Gaussian distribution (also called a Normal
distribution) with mean zero and some variance σ2.
• We can write this assumption as “𝜖(i) ∼ N (0, σ2).” I.e., the density of
𝜖(i) is given by
Likelihood L(θ) =
• The distribution of y(i) given x(i) and parameterized by θ is then given
by:
• Which is the same as minimizing the cost function J(θ) for linear regression
• Note that 𝝈 did not play a factor in the MLE result.