quantlab.portfolio.predefined.expected_return.PredictionExpectedReturn#

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

Bases: ExpectedReturnModel

mu is the prediction as it is, whatever its units.

For a prediction that is not a return (a standardized ensemble score, a rank): risk_aversion, turnover_penalty and the rest weigh against mu in the prediction’s units, so they are not comparable with a Grinold rule’s. Any label scale is taken.

Examples

>>> PredictionExpectedReturn(PredictionExpectedReturnConfig()).expected_returns(
...     np.array([[1.2, -0.4]]), None, np.ones((1, 2), dtype=bool)
... )
array([[ 1.2, -0.4]])
config_cls#

alias of PredictionExpectedReturnConfig

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

The prediction on the candidates, 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.