Core mechanism
The output adjoint reaches every connected active input. Naming those inputs converts a raw gradient vector into a risk report such as timing risk, cross-risk or a model-parameter sensitivity.
Theta was never coded into the vanilla option payoff. It falls out of the same Java adjoint sweep as delta and vega because maturity is a named input.
This exact source runs in TeaVM. Form changes update its Java literals and reset manual edits.
import com.nablatensor.engine.Nabla;
import com.nablatensor.quant.EquityMarket;
import com.nablatensor.quant.MonteCarlo;
import com.nablatensor.quant.Products;
public final class UnaskedGreek {
private UnaskedGreek() {}
public static void main(String[] args) {
EquityMarket market = EquityMarket.of()
.spot(100)
.strike(100)
.vol(20 / 100.0)
.rate(3 / 100.0)
.maturity(1)
.build();
long scenarios = 20000L;
long seed = 42L;
double oneDay = 1.0 / 365.0;
try (MonteCarlo<EquityMarket> pricer = MonteCarlo.of(Products.europeanCall())
.market(market)
.steps(1)
.fp64()
.greeks()
.on("cpu")
.build()) {
Nabla.TypedValuation<EquityMarket> value = pricer.run(scenarios, seed);
double theta = -value.greek(EquityMarket::maturity);
double thetaPerDay = theta / 365.0;
EquityMarket shorter = market.withMaturity(Math.max(1.0e-6, market.maturity() - oneDay));
double thetaBump = pricer.run(shorter, scenarios, seed)
.price() - value.price();
System.out.println("RESULT|" + value.price() + "|" + value.greek(EquityMarket::spot) + "|"
+ value.greek(EquityMarket::vol) + "|" + thetaPerDay + "|" + thetaBump);
System.out.println("INPUTS|" + scenarios + "|" + seed + "|" + pricer.nodes());
}
}
}
A reverse sweep returns the derivative for every recorded input, including an economically useful factor that was not the original reporting target.
The output adjoint reaches every connected active input. Naming those inputs converts a raw gradient vector into a risk report such as timing risk, cross-risk or a model-parameter sensitivity.
Define a deliberate risk-factor schema at recording time, retain labels and units with the input vector, and surface only sensitivities that have a clear economic interpretation and validation route.
An available derivative is not automatically a hedgeable Greek. Liquidity, calibration stability, factor definition and reporting materiality still matter.