Module frame
Expand description
The risk frame: a risk vector paired with the market that explains it.
A risk pass produces ∂V/∂p per lifted parameter. That vector alone cannot
answer what a desk asks, for two reasons, and the frame supplies both.
A parameter is not a quote. A discount pillar holds a log discount
factor; a unit move in the zero rate it is quoted at sends that parameter
by −τ. So the frame carries the market, which knows each curve’s family and
therefore each parameter’s ∂p/∂q.
A quote is not an instrument. A desk hedges in swaps, not in pillars.
Flipping the vector through the calibration Jacobian each curve was pinned
with turns a pillar ladder into an instrument ladder — one entry per rung of
the ladder that built the curve. That is the Basis::Par reading, and it
is the reason a curve’s provenance is stored beside it.
Both readings are reductions over the same pass. Asking for six of them costs one valuation, because the vector is produced once and each reading is arithmetic over it.
Structs§
- Contribution 🔒
- One labelled contribution, before it is collapsed.
- Curve
Weights 🔒 - One curve’s
∂p/∂q, by position in its flat parameter vector, beside the label each position carries. - Factor
- A custom scale’s multiplier, held as its bit pattern so a
Scalecompares and hashes exactly — which a measure used as a row key must. - Records
- A column-oriented record set: stable names, parallel columns of equal length.
- Risk
Frame - A risk vector, the value it came from, and the market that explains both.
- Scales
- A caller’s default scale per
QuantityKind— what a book reports an unscaled measure in. - Tenor
- A rung’s tenor as a label carries it: ordered by its spelling’s parts, so a
label stays totally ordered where a
Periodis only semantically so (12Mand1Ycompare equal).
Enums§
- Aggregation
- How a basis’s contributions are collapsed into reported rows.
- Basis
- The quote a sensitivity is expressed against.
- Column
- One column of a record set: a name, and values of one type down the column.
- Label
- What distinguishes one row of a reading from another.
- Scale
- The unit a reading is reported in: the per-unit-quote derivative, multiplied by a factor.
Constants§
- BUCKETS 🔒
- The tenor ladder a
Aggregation::Bucketedreading reports on: a label and the year fraction it runs to, the last one open-ended.
Functions§
- bucket_
of 🔒 - Which bucket
datefalls in, measured in years fromfrom. - curve_
weights 🔒 ∂p/∂qfor every free parameter a curve owns, in the order the lift reads them — the walk [Family::parameter_labels] makes, weighted per leaf.- decimals_
for 🔒 - The decimals a numeric column prints: two when its largest finite magnitude is at least a thousand, six otherwise.
- group_
thousands 🔒 - A number with thousands separators at
decimalsplaces:-51606.31at two is-51,606.31.nanand the infinities print as themselves. A value that rounds to zero prints without a sign, so a-0.00never appears. - is_
smile_ 🔒shape - A SABR node’s ρ or ν: the smile’s shape, not a level of vol.
- level_
only 🔒 - A unit weight on the first parameter, the level, and none on the rest.
- own_
curve_ 🔒weights - The move a unit quote move makes in each parameter one curve leaf owns.
- quote_
weights 🔒 ∂p/∂qfor every parameter of the curve underid, orNonewhere the market lifts no rate or credit curve under it.- reading_
records - One reading’s rows as records: the label, the curve and date it carries where it carries them, and the number.
- survival_
weights 🔒 - The same, for the survival set.
- weight_
of 🔒 ∂p/∂qfor one lifted input, from its curve’s weights. A meeting or turn knot names its event, not its position, so it is found by its label. An input no curve owns — a spot, a vol node, a fixing — is read as its own quote.