Orthogonal Matching Pursuit
A greedy way to build a sparse model one predictor at a time — at each step add whichever remaining feature best explains what's left unexplained, then refit everything so far before moving on. A simpler, more literal alternative to lasso for picking a small set of signals.
Prerequisites: Ridge and LASSO Regularization
Say you have a hundred candidate signals and want a model using only a handful. The lasso approaches this with a single penalized optimization that pushes some coefficients to zero as a side effect. Orthogonal matching pursuit (OMP) instead builds the sparse model one variable at a time, explicitly, by repeatedly asking "which remaining feature explains the most of what I haven't explained yet?"
The analogy: assembling witnesses one at a time
Reconstructing an event by calling witnesses one by one, you first find whoever's account covers the most of the story. Then you look specifically for whoever best explains the parts the first witness left out — no point in a second witness who repeats the first. You repeat this, re-checking the combined story each time, stopping once enough witnesses explain the whole thing.
The mechanics: pick, project, subtract, repeat
Start with residual . At each step: pick the feature most correlated with the current residual, ; add it to the active set; refit by OLS on all active features; recompute the residual from that refit.
In plain English: at every round OMP finds whatever remaining signal best explains the error the current model still makes, adds it, then redoes the whole regression on everyone selected so far — the refitting keeps the residual uncorrelated with everything already picked, so the algorithm never wastes a pick on redundant information.
Worked example: three rounds of picking
With target and three candidates — momentum, value, volume — round 1 selects momentum (highest raw correlation with ) and refits, leaving residual . Round 2 correlates value and volume with , not : value now wins, even if volume was individually more correlated with raw , because volume largely duplicates what momentum already explains. Refitting on {momentum, value} gives . If a stopping rule caps the model at two features, volume is never included — everything it offered was already captured once value came in.
Step through the trajectory above: each step moves toward whatever direction most reduces the current error, exactly the "explain what's left" logic OMP applies to picking features rather than positions.
What this means in practice
OMP gives a small, explicit, auditable feature set with a clear step-by-step story for each inclusion — useful when you need to explain a signal-selection process to a risk committee. Being greedy, it can't undo an early pick that turns out poor once later features are added, unlike the lasso's full solution path.
Orthogonal matching pursuit builds a sparse model greedily: at each step it adds whichever feature best explains the residual left over from everything picked so far, then refits all selected features jointly — a transparent alternative to the lasso's single penalized optimization.
Because OMP commits to each pick permanently, an early wrong choice locks in a path that later refitting cannot fully repair. Cross-validate the number of steps rather than assuming the greedy order reflects true importance.
Related concepts
Practice in interviews
Further reading
- Pati, Rezaiifar & Krishnaprasad, Orthogonal Matching Pursuit (1993)
- Hastie, Tibshirani & Wainwright, Statistical Learning with Sparsity, ch. 2