MaxMoneyness

class pfhedge.features.MaxMoneyness(log=False)[source]

Cumulative maximum of moneyness.

Name:

'max_moneyness'

Examples

>>> from pfhedge.features import MaxMoneyness
>>> from pfhedge.instruments import BrownianStock
>>> from pfhedge.instruments import EuropeanOption
...
>>> _ = torch.manual_seed(42)
>>> derivative = EuropeanOption(BrownianStock(), maturity=5/250, strike=2.0)
>>> derivative.simulate()
>>> derivative.underlier.spot
tensor([[1.0000, 1.0016, 1.0044, 1.0073, 0.9930, 0.9906]])
>>> f = MaxMoneyness().of(derivative)
>>> f.get()
tensor([[[0.5000],
         [0.5008],
         [0.5022],
         [0.5036],
         [0.5036],
         [0.5036]]])