quantlab.portfolio.predefined.expected_return.UnscaledZScoreExpectedReturn#
- class quantlab.portfolio.predefined.expected_return.UnscaledZScoreExpectedReturn(config)[source]#
Bases:
ExpectedReturnModelmu = z: the prediction’s cross-sectional z-score over the candidates, unscaled.zis the z-score (ddof=1) of each bar’s prediction over its candidates, 0.0 off them.ZScoreExpectedReturnscales it byic * median(sigma), which changes from bar to bar; heremuis the z-score itself, soturnover_penalty(andrisk_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_returnsreadssigma; a rule prepares none for a model that does not.