Discriminant score and decision-boundary derivation

The procedural atom for the prof’s most-flagged exam pattern in module 4: “given , , (or ), solve for the decision boundary.” The discriminant score is what you maximize over ; setting and solving gives the boundary. Said twice on the exam-relevance flag list.

Definition (prof’s framing)

“Same exact trick as finding the point that divides the classes in two. You do the same thing, only now in a higher dimension and then you get a line out of it, or a plane, whatever it is.” - L09-classif-3

The discriminant score is what’s left of after dropping every term that doesn’t depend on . It is not a probability or likelihood, but it preserves the , same classification.

Notation & setup

  • : class prior.
  • : class-conditional density (multivariate Gaussian for LDA/QDA).
  • : discriminant score for class . Bigger → class wins.
  • Decision boundary between classes and : locus where .

Formula(s) to know cold

LDA discriminant (1D):

LDA discriminant (multivariate):

QDA discriminant (multivariate):

Decision boundary (binary, classes 0 and 1):

LDA → linear in (a hyperplane). QDA → quadratic in (a conic).

Derivation recipe

The standard play, applied for either LDA or QDA:

  1. Start from Bayes’ rule. (denominator is -independent , drop it).
  2. Take logs. .
  3. Plug in the Gaussian density. (use for LDA).
  4. Drop everything not depending on . The goes. In LDA, also goes (no ); in QDA it stays. The piece: in LDA it has no , drop; in QDA it has , keep (this is where the quadratic comes from).
  5. Expand the surviving cross term: (after dropping the -free piece in LDA).
  6. What’s left is .

For the boundary, set and solve for . For LDA in two classes:

A linear equation in → a hyperplane.

Worked example , the prof’s recurring template

, , , equal priors.

. The cross-term coefficient is .

The intercept terms:

  • .
  • .

Sum: . Equal priors → .

Boundary: , i.e. .

“I didn’t ask for a line. I just equated the two things and then I solved for them and then it became a line. I didn’t tell the math to give me a line.” - L09-classif-3

The prof flubbed this live (claimed two terms cancelled when they didn’t), came back from break to fix it. Lesson:

“When I was doing my PhD, one of my co-authors said he doesn’t make a habit of doing algebra in public. I’ve heard his voice in my head a million times. It’s a bit of a fool to do public algebra , your brain shuts off, you look like an idiot.” - L09-classif-3

Show your work step-by-step on the exam.

Insights & mental models

  • Boundary is a consequence, not a parameter. In logistic regression you fit the boundary’s slope. In LDA/QDA you fit class densities and the boundary falls out from . - L09-classif-3
  • Equal priors, equal , two classes, 1D: boundary at , the midpoint. Verifiable shortcut.
  • Priors literally move the boundary. Increasing by some amount slides the boundary away from class (more area is classified as ). Compute via in the boundary equation.
  • In multivariate LDA, the boundary depends on jointly. Specifically, the boundary’s normal direction is , not just . Σ rotates and rescales.
  • For QDA, the cleanest representation is the compact form , it’s just (squared Mahalanobis distance) + (volume penalty) + (log-prior).

Exam signals

“And that’s often an exam question. Or that would be a typical exam question. So you would, given an LDA setting and here are the values for the parameters , you have the pies, you have the mu’s, and you’d have a value for the standard deviation , and then you would solve for where is the decision point.” - L09-classif-3

“This would be another kind of question that you could ask on an exam , like find the equation for the decision boundary between these two categories. Then you solve for the equation for the line or the plane or whatever it happens to be depending on the dimension of the X’s.” - L09-classif-3

“That would be another question one could ask if I was so inspired , show that this leads to this thing. I don’t know if that’s a very interesting question to ask, but one could ask it.” - L09-classif-3 (re: deriving itself)

CE1 problem 3e is exactly this exam pattern in compulsory form: derive , solve , get , solve for .

Pitfalls

  • Public-algebra slips. The prof himself did one in lecture , write each line carefully on the exam, don’t try to do steps in your head.
  • Forgetting to drop the in LDA. It’s -independent there; drop it. In QDA, it depends on via ; keep it.
  • Mixing with . The discriminant uses the inverse (precision). Don’t drop the inverse.
  • Forgetting the term in QDA. It survives because depends on .
  • Sign error on the prior term. , bigger prior → bigger → more area classified as .
  • Treating the boundary as in 2D. No , it’s that gives the normal direction. Only when (or scalar multiple) do they coincide.

Scope vs ISLP

  • In scope: Discriminant-score derivation from , why LDA is linear and QDA quadratic, decision-boundary derivation, the / / worked example, prior-shift effect.
  • Look up in ISLP: §4.4.1 (1D LDA derivation, eq. 4.18), §4.4.2 (multivariate, eq. 4.24), §4.4.3 (QDA, eq. 4.28). pp. 145–155.
  • Skip in ISLP: Fisher’s eigenvalue derivation (slide deck “Optional”, prof never lectured); detailed naive-Bayes-as-LDA-with-diagonal-Σ algebra (covered abstractly in naive-bayes).

Exercise instances

  • CE1 problem 3e: full procedural application: derive from Bayes’ rule, solve for the boundary in form, plot it.

(All other CE1.3 / Exercise4.2 / Exercise4.6 problems on LDA/QDA implicitly require this derivation as a sub-step , see linear-discriminant-analysis / quadratic-discriminant-analysis for the full per-method exercise lists.)

How it might appear on the exam

  • The flagged pattern (twice): Given , , (or ), derive the boundary equation. Solve in the form (2D) or just the threshold (1D).
  • Discriminant-score derivation: “Show that for LDA, .” Step-by-step: log of , drop -free terms, expand the cross term. Emphasizes why the drops (no ).
  • “Where does the quadratic come from in QDA?”: the contrast question. Walk through what cancels in LDA but doesn’t in QDA.
  • Prior-shift question: “If increases from 0.5 to 0.7, in which direction does the boundary move?” → away from class .
  • Hand-classification: Given and values for a specific test point, pick the larger.