Docs / nablatensor-quant / com.nablatensor.quant

final class

MultiMetric

Prices several named risk measures off the same market and seed.

The engine tape has a single output, so this builds one MonteCarlo per metric and replays them at a common seed — the metrics are consistent across the same scenarios, and each still gets its full adjoint gradient. It costs N kernels and N replays; a single tape with multiple named outputs (one forward sweep, N reverse seeds) is a planned engine feature that will make this one launch.

try (MultiMetric mm = MultiMetric.market(EquityMarket.atmOneYear()).steps(128)
        .metric("call",    Products.europeanCall())
        .metric("digital",  ExoticProducts.digitalCash(OptionType.CALL, 1.0, 1.0))
        .metric("barrierUO", ExoticProducts.barrier(OptionType.CALL,
                    ExoticProducts.Barrier.UP_OUT, 130.0, 1.0))
        .on("cpu-jit").build()) {

  Map<String, Nabla.TypedValuation<EquityMarket>> r = mm.run(1_000_000, 42L);
  r.get("barrierUO").greek(EquityMarket::spot);
}

Methods

static Builder market(EquityMarket market)
Map<String, Nabla.TypedValuation<EquityMarket>> run(long scenarios, long seed)

Replays every metric at the same seed and scenario count.

java.util.Set<String> names()
void close()