At present, these methods just return Result<f64, qm:Error>, which means that a lot of the detail of pricing is lost. There are two kinds of things that could be returned:
A recursive breakdown of how the price was calculated. For example, the price of a basket is the weighted sum of the components. If the weights and components were also returned, it would allow the user to show breakdown of the price and also the risks by component, without any further calculation.
Pricer-dependent outputs. For example, a Monte-Carlo pricer could output a convergence graph. Again, this could be summed for risks, showing convergence of the risks as well. Pricers for dynamic indices could show the contribution from fees. (This can be important for recursive dynamic indices, where there may be rules for netting out fees other than at the top level.)
I think this means returning some kind of structure, containing top-level price, recursive price breakdown, and pricer-specific (and maybe model specific) outputs.
At present, these methods just return Result<f64, qm:Error>, which means that a lot of the detail of pricing is lost. There are two kinds of things that could be returned:
I think this means returning some kind of structure, containing top-level price, recursive price breakdown, and pricer-specific (and maybe model specific) outputs.