Package com.quantfinlib.ml
package com.quantfinlib.ml
Statistical learning for markets, all pure Java:
GradientBoostedRegressor (stump boosting),
VolatilityForecaster (forward realized vol +
0-100 risk score), RegimeDetector (2-state
Gaussian Markov-switching model via Baum-Welch EM),
MarketImpactPredictor (learned impact + sweep
probability), IntradayLiquidityForecaster
(session volume profiles) and AnomalyDetector
(quote stuffing, price spikes).-
ClassDescriptionSurveillance anomaly detection over interval-aggregated market activity: Quote stuffing — message-rate spikes (robust z-score) combined with an abnormal order-to-trade ratio: lots of quoting, little trading. Price spikes — interval returns far outside their recent distribution.Gradient-boosted regression over decision stumps (XGBoost-style additive boosting with squared-error loss), implemented in pure Java with no dependencies.Intraday liquidity forecasting: accumulates per-bucket volumes across days into a seasonal profile (e.g. 24 hourly buckets) to predict when liquidity peaks — London open, the London/New York overlap, etc.ML market impact prediction: learns realized impact (bps) from order and book features using gradient-boosted trees, and estimates the probability a marketable order sweeps through the visible top of book.Two-state Gaussian Markov-switching model (hidden Markov model) fitted by Baum-Welch EM with forward-backward scaling: detects calm/turbulent regimes in a return series.Machine Learning Risk Forecasting: predicts forward realized volatility from a return series using gradient-boosted trees over engineered features (multi-horizon realized vol, momentum, and shock magnitude), and maps the forecast to an intuitive 0-100 risk score.