Class AlphaRiskModels
java.lang.Object
com.quantfinlib.alpha.AlphaRiskModels
Builds a
FactorRiskModel from an AlphaContext panel, with
style factors taken from Factors.
Styles: SIZE (log capitalisation), MOMENTUM
(Factors.momentum(int, int)(momentumLookback, 0)),
LOW_VOL (Factors.lowVolatility(int)) and, when the panel has
fundamentals, VALUE (Factors.value()). Capitalisation is
Fundamentals.marketCap() as of the bar when the panel carries it;
otherwise the trailing capWindow-bar mean dollar volume stands in
as a liquidity-size proxy, which keeps the regression weights and the
size buckets ordered by tradable size.
Period j of the model is the close-to-close return from bar
j − 1 to bar j with exposures and capitalisations taken
at bar j − 1; the forecast row is bar index. Only data up
to close(index) is read, so the model can be rebuilt inside a
backtest without look-ahead.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRisk model specification. -
Method Summary
Modifier and TypeMethodDescriptionstatic FactorRiskModelestimate(AlphaContext ctx, int index, String[] sectors, AlphaRiskModels.Spec spec) Estimates the model on thespec.window()periods ending atindex, forecasting the period after it.
-
Method Details
-
estimate
public static FactorRiskModel estimate(AlphaContext ctx, int index, String[] sectors, AlphaRiskModels.Spec spec) Estimates the model on thespec.window()periods ending atindex, forecasting the period after it.- Parameters:
sectors- sector label per symbol in context order (null = one sector)
-