Concept

Bayesian Classifiers

Bayesian Classifiers are Machine Learning concepts.

naive Bayes

What are Bayesian Classifiers?

A Bayesian classifier assigns a probability to each possible outcome class, such as price up versus price down over the next several bars, by applying Bayes' theorem: the posterior probability of a class is proportional to its prior probability multiplied by the likelihood of the observed features under that class. The most common variant in trading tools is naive Bayes, which assumes the features are conditionally independent given the class, so the joint likelihood factorizes into a product of simple per-feature terms that can be estimated from modest amounts of history.

That independence assumption is almost always false for market inputs, since momentum readings, volume measures, and structure flags move together, yet naive Bayes often still ranks outcomes usefully because the violation inflates confidence more than it scrambles ordering. The practical consequence is that posteriors from a naive model tend to be overconfident, pushed toward 0 or 1, so they are better treated as scores to rank and filter with than as literal odds, a concern shared with logistic signal calibration.

The machinery is refreshingly inspectable. Priors come from class frequencies in the training window, how often the market rose versus fell over the chosen horizon. Likelihoods come from counting: for a discretized feature such as an RSI zone or a delta sign, each bin's frequency under each class is a table entry, while Gaussian naive Bayes fits a mean and variance per feature per class for continuous inputs. Classification then just accumulates log-likelihood ratios feature by feature, which means every input's contribution to the verdict can be printed and audited, a transparency that black-box models never offer.

Practice adds three refinements. Counting tables update incrementally, so the model suits online learning, refreshing bar by bar without refitting; correlated inputs deserve pruning or decorrelation through PCA before they double-count the same evidence; and the overconfident posteriors calibrate well through the standard mapping fixes. On-chart implementations exist precisely because the arithmetic is light, the Library's naive Bayes order-flow study being one example, with the counting tables living in arrays and the class verdict recomputed per bar.

How to identify a Bayesian classifier's construction

Everything reduces to priors, likelihood tables, and a threshold; auditing one means walking those parts.

  1. 1Pin down the label first: which classes the model separates and over what horizon, the label definition that everything downstream answers to.
  2. 2Check the priors: class frequencies from the training window, and whether they update as the window rolls.
  3. 3Inspect the likelihoods: binned frequency tables per feature per class, or per-class Gaussians for continuous features, and how much history estimated them.
  4. 4Follow the accumulation: per-feature log-likelihood ratios summing into a posterior, which makes each input's contribution explicit.
  5. 5Test the output honestly: threshold the posterior, calibrate it if it will be read as a probability, and validate out of sample before trusting either.

How traders use it

  • As a directional scorer: several engineered features, such as oscillator zones or order-flow readings, are fused into one posterior probability of an up or down outcome, traded only above a threshold.
  • As a filter on another system: an existing signal fires only when the classifier's posterior for the favorable class is high enough, suppressing entries the evidence does not support.
  • As an evidence combiner: each feature multiplies the running odds by its historical likelihood ratio, keeping every input's contribution explicit and inspectable.
  • In online form: the counting tables update with each new labeled bar, so the classifier tracks slowly drifting conditions without scheduled refits, at the cost of also absorbing whatever regime noise arrives.
  • With input hygiene: pruning redundant features or decorrelating them first prevents the independence assumption from double-counting one signal heard through several instruments, which is the main source of the model's overconfidence.

Bayesian classifiers vs other learned models

Logistic Signal Calibration: Logistic regression is the discriminative sibling: it learns weights that account for feature correlation, where naive Bayes counts each feature independently. Logistic needs more data and optimization; naive Bayes trains from counts and stays honest about what each input contributed.

Random Forest: A forest captures nonlinear interactions between features, exactly what the naive independence assumption discards, and pays with data hunger and opacity. Naive Bayes is the low-variance, high-bias end of the same spectrum: crude, stable, and inspectable.

kNN Analog Forecasting: kNN stores history and answers by similarity at query time, no training step, no distributional summary. The Bayesian classifier compresses history into priors and likelihood tables and discards the examples. Memory versus summary, with opposite scaling and staleness trade-offs.

Concept family

Machine Learning

32 concepts mapped · 32 in the Library

Bayesian Classifiers FAQ

Turn Bayesian Classifiers into a trading strategy.

Describe your Bayesian Classifiers idea to Quant. It builds the strategy with you and backtests it on real data.