Class MarketImpactPredictor
java.lang.Object
com.quantfinlib.ml.MarketImpactPredictor
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]features(double sizeVsAdv, double spreadBps, double bookImbalance, double volatility) Standard feature vector.fit(double[][] x, double[] realizedImpactBps) Trains on historical (features, realized impact bps) observations.doublepredictImpactBps(double[] features) static doublesweepProbability(long orderQty, long visibleContraDepth) Probability a marketable order oforderQtysweeps beyond the visible contra depth at the touch: logistic in the size/depth ratio, 0.5 exactly when the order equals the visible depth.
-
Constructor Details
-
MarketImpactPredictor
public MarketImpactPredictor()
-
-
Method Details
-
features
public static double[] features(double sizeVsAdv, double spreadBps, double bookImbalance, double volatility) Standard feature vector.- Parameters:
sizeVsAdv- order size / average daily volumespreadBps- quoted spread in bps at arrivalbookImbalance- depth imbalance in [-1, 1] (signed toward the order side)volatility- recent per-period volatility
-
fit
Trains on historical (features, realized impact bps) observations. -
predictImpactBps
public double predictImpactBps(double[] features) -
sweepProbability
public static double sweepProbability(long orderQty, long visibleContraDepth) Probability a marketable order oforderQtysweeps beyond the visible contra depth at the touch: logistic in the size/depth ratio, 0.5 exactly when the order equals the visible depth.
-