Docs / quant-risk / com.nablatensor.risk

final class

RiskFactor

A regulatory risk factor: the key a sensitivity is bucketed and weighted by.

The record is deliberately generic — one shape for every FRTB SA / SIMM risk class. Interpretation of name / tenor / tenor2 is per risk class; the typed factory methods below encode the conventions the FRTB SA / SIMM parameter classes expect:

  • GIRR delta: bucket = currency, name = curve id ("OIS", "3M", "INFL", "XCCY"), tenor = vertex in years.
  • GIRR vega: tenor = option maturity, tenor2 = residual maturity of the underlying.
  • CSR delta: bucket = sector/quality bucket id, name = "<issuer>|BOND" or "<issuer>|CDS", tenor = vertex in years.
  • Equity delta: spot has tenor == 0; the repo-rate factor of the same issuer has tenor > 0.
  • Commodity delta: name = "<commodity>|<location>", tenor = maturity in years.
  • FX delta: bucket = name = the currency pair.

Methods

static RiskFactorBuilder of()
RiskClassEnum riskClass()
RiskMeasureEnum measure()
String bucket()
String name()
double tenor()
double tenor2()
boolean equals(Object other)

Risk factors are map keys, so equality follows all fields of the factor.

int hashCode()
static RiskFactor equityDelta(String bucket, String name)
boolean isEquityRepo()

True for an equity repo-rate delta factor (as opposed to spot).

static RiskFactor girrDelta(String ccy, double vertexYears)
static RiskFactor girrInflation(String ccy)
static RiskFactor girrXccyBasis(String ccy)
String csrIssuer()

The issuer part of a CSR factor name ("<issuer>|BOND" -> "<issuer>").

String csrCurve()

The curve part of a CSR factor name ("BOND" / "CDS" / "VOL"); "" if none.

String commodityName()

The commodity part of a commodity factor name ("WTI|HUB" -> "WTI").

String deliveryLocation()

The delivery-location part of a commodity factor name; "" if none.

static RiskFactor fxDelta(String currencyPair)
static RiskFactor fxVega(String currencyPair, double optionMaturityYears)
RiskFactor asCurvature()

The same factor as a curvature factor (measure CURVATURE, tenors preserved).

RiskFactor asCurvatureCurve()

A curvature factor with the tenor collapsed — one curvature factor per curve (GIRR / CSR).