Skip to main content

Module frame

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.
CurveWeights 🔒
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 Scale compares 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.
RiskFrame
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 Period is only semantically so (12M and 1Y compare 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::Bucketed reading reports on: a label and the year fraction it runs to, the last one open-ended.

Functions§

bucket_of 🔒
Which bucket date falls in, measured in years from from.
curve_weights 🔒
∂p/∂q for 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 decimals places: -51606.31 at two is -51,606.31. nan and the infinities print as themselves. A value that rounds to zero prints without a sign, so a -0.00 never 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/∂q for every parameter of the curve under id, or None where 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/∂q for 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.