  We present a numerically efficient approach for learning a risk-neutral
measure for paths of simulated spot and option prices up to a finite horizon
under convex transaction costs and convex trading constraints. This approach
can then be used to implement a stochastic implied volatility model in the
following two steps: 1. Train a market simulator for option prices, as
discussed for example in our recent; 2. Find a risk-neutral density,
specifically the minimal entropy martingale measure. The resulting model can be
used for risk-neutral pricing, or for Deep Hedging in the case of transaction
costs or trading constraints. To motivate the proposed approach, we also show
that market dynamics are free from "statistical arbitrage" in the absence of
transaction costs if and only if they follow a risk-neutral measure. We
additionally provide a more general characterization in the presence of convex
transaction costs and trading constraints. These results can be seen as an
analogue of the fundamental theorem of asset pricing for statistical arbitrage
under trading frictions and are of independent interest.
