macrosynergy.learning.forecasting.torch.losses.mcr_loss#

class MultiOutputMCR(skip_validation=True, unbiased=True)[source]#

Bases: Module

Negative mean-concentration risk ratio loss for multi-output regression problems.

Notes

By mean-concentration risk ratio, we refer to the ratio of the mean return within a time period, to the standard deviation of returns within that time period. This differs from a Sharpe ratio in that the Sharpe is a temporal quantity, whereas this statistic is cross-sectional. Maximisation of such a statistic would encourage positive returns at each time period whilst penalising diversity in the cross-sectional return distribution. The goal is to encourage prevent the model from concentrating returns in a small subset of the outputs.

This statistic can be calculated for each sample in a batch, and then averaged over the batch. Neural networks are most naturally formulated as minimization problems, so the negative mean-concentration risk ratio is used as a loss function.

forward(y_pred, y_true)[source]#

Evaluate batch negative mean-concentration risk ratio loss.

Parameters:
  • y_pred (torch.Tensor) – Predicted outputs (signals or portfolio weights).

  • y_true (torch.Tensor) – True outputs (returns).