QuadraticCVaR

class pfhedge.nn.QuadraticCVaR(lam=10.0)[source]

Creates a criterion that measures the QuadraticCVaR.

\[\rho (X) = \inf_\omega \left\{\omega + \lambda || \min\{0, X + \omega\}||_2\right\}.\]

for \(\lambda\geq1\).

References

Parameters

lam (float, default=10.0) – \(\lambda\). This parameter should satisfy \(\lambda \geq 1\).

Shape:
  • input: \((N, *)\) where

    \(*\) means any number of additional dimensions.

  • target: \((N, *)\)

  • output: \((*)\)

Examples

>>> from pfhedge.nn import QuadraticCVaR
...
>>> loss = QuadraticCVaR(2.0)
>>> input = -torch.arange(10.0)
>>> loss(input)
tensor(7.9750)
>>> loss.cash(input)
tensor(-7.9750)