quantlab.portfolio.predefined.expected_return.UnscaledZScoreExpectedReturn#

class quantlab.portfolio.predefined.expected_return.UnscaledZScoreExpectedReturn(config)[source]#

Bases: ExpectedReturnModel

mu = z: the prediction’s cross-sectional z-score over the candidates, unscaled.

z is the z-score (ddof=1) of each bar’s prediction over its candidates, 0.0 off them. ZScoreExpectedReturn scales it by ic * median(sigma), which changes from bar to bar; here mu is the z-score itself, so turnover_penalty (and risk_aversion) weigh against it in z units on every bar. No volatility is read.

Examples

>>> UnscaledZScoreExpectedReturn(UnscaledZScoreExpectedReturnConfig()).expected_returns(
...     np.array([[1.0, 2.0, 3.0, 9.0]]), None, np.array([[True, True, True, False]])
... )
array([[-1.,  0.,  1.,  0.]])
config_cls#

alias of UnscaledZScoreExpectedReturnConfig

expected_returns(predictions, sigma, candidates)[source]#

The candidates’ z-score, 0.0 elsewhere; see the class docstring.

needs_sigma = False#

Whether expected_returns reads sigma; a rule prepares none for a model that does not.