skfolio.measures.semi_variance#

skfolio.measures.semi_variance(returns, min_acceptable_return=None)[source]#

Compute the semi-variance (second lower partial moment).

The semi-variance is the variance of the returns below a minimum acceptable return.

Parameters:
returnsndarray of shape (n_observations,)

Vector of returns

min_acceptable_returnfloat, optional

Minimum acceptable return. It is the return target to distinguish “downside” and “upside” returns. The default (None) is to use the mean.

Returns:
valuefloat

Semi-variance.