compare_results
Compare your numbers to the pricing engine's outputs, auto-mapping labels and computing absolute and relative differences for reconciliation.
Instructions
Put the user's numbers next to the engine's (no engine call, no modelling).
Args:
external: {label: number} as the user quoted them, e.g.
{"NPV": 10359.49, "DV01": 415.5, "fair rate": 0.0337}. Labels are
matched case- and punctuation-insensitively to response fields
(npv / premium / PV -> npv; DV01 / PV01 -> dv01;
fair rate -> fair_rate then atm_forward; vol ->
implied_volatility, ...). Give the external numbers in the engine's
units (currency amounts; rates and vols as decimals).
quantra: a pricing tool result (its response is used) or the engine
response object itself. The first priced item is compared.
Returns rows = [{label, mapped_to, quantra_path, external, quantra, abs_diff, rel_diff, topic, topic_uri}] with abs_diff = quantra - external
and rel_diff = abs_diff / |external|; unmapped for labels with no field;
mapping shows the candidates tried. topic is the methodology page
(explain_method) to consult for that metric.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| quantra | Yes | ||
| external | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||