EntropicRiskMeasure

class pfhedge.nn.EntropicRiskMeasure(a=1.0)[source]

Creates a criterion that measures the entropic risk measure.

The entropic risk measure of the profit-loss distribution \(\text{pl}\) is given by:

\[\text{loss}(\text{PL}) = \frac{1}{a} \log(- \mathbf{E}[u(\text{PL})]) \,, \quad u(x) = -\exp(-a x) \,.\]

See also

Parameters

a (float, default=1.0) – Risk aversion coefficient of the exponential utility. This parameter should be positive.

Shape:
  • input: \((N, *)\) where \(*\) means any number of additional dimensions.

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

  • output: \((*)\)

Examples

>>> from pfhedge.nn import EntropicRiskMeasure
...
>>> loss = EntropicRiskMeasure()
>>> input = -torch.arange(4.0)
>>> loss(input)
tensor(2.0539)
>>> loss.cash(input)
tensor(-2.0539)