Skip to content
All library documents

QuantLib Adoption in Industry: Anecdotal Evidence and Tradeoffs

Article Quant Q&A · Author: Jan

Summary

The discussion considers how widely QuantLib is used in banks and funds, while emphasizing that proprietary systems make adoption difficult to measure. Contributors offer differing, experience-based impressions: open-source pricing software can serve as a benchmark or reference implementation, but some institutions favor internal models or commercial libraries that come with support. One contributor also notes documentation and model-development concerns from their own experience with parts of the library.

The evidence consists of personal observations, conversations, and references to possible ways of gauging interest, such as community events and client lists. It is not a systematic survey, and the contributors’ views may reflect their roles, locations, and the software areas they encountered. The practical lesson is to distinguish research or reference use from deployment in a production stack, and to assess documentation, model coverage, support, and integration needs for the intended use rather than infer industry-wide adoption from anecdotes.

Key ideas

  • The proprietary nature of financial systems makes QuantLib adoption hard to quantify.
  • Open-source libraries can provide useful benchmarks or reference implementations.
  • Some institutions prefer internally developed models or supported commercial software.
  • The comments are anecdotal and do not establish an industry-wide adoption rate.
  • Production suitability depends on documentation, model coverage, support, and integration requirements.

Tags

Full text
# Derivative of the Basel Risk-Weight Function with Respect to MoC C


# Derivative of the Basel Risk-Weight Function with Respect to MoC C












I am examining the differentiation of the Basel/CRR risk-weight function with respect to the Margin of Conservatism Category C (MoC C). More specifically, if the conservative PD changes because of MoC C, should the resulting change in the regulatory asset correlation also be included when differentiating the risk weight?

I derive the following expression and obtain numerical agreement with a finite-difference approximation over a PD range of 0.03%–5%. I would appreciate confirmation that the analytical derivation and its application to the grade-level aggregation are correct.

References Tasche, D. (2010), “Estimating discriminatory power and PD curves when the number of defaults is small.”

Wosnitza, J. H. (2026), “Quantification of margin of conservatism category C: Correlations and quantification levels,” Journal of Credit Risk, 22(3), pp. 51–73. DOI: 10.21314/JCR.2026.005

Derivation We differentiate the risk-weight function with respect to Margin of Conservatism Category C.

Define

$$ p:=PD, \qquad m:=\mathrm{MoC}, \qquad q:=\widetilde{PD}=\text{Conservative PD}. $$

Apart from certain factors, the risk-weight function is

$$ RW(q)= LGD \left[ \Phi\left( \frac{ \Phi^{-1}(q) + \sqrt{R(q)}\cdot\Phi^{-1}(\alpha) }{ \sqrt{1-R(q)} } \right) -q \right]. $$

For convenience, define

$$ z(q) := \frac{ \Phi^{-1}(q) + \sqrt{R(q)}\cdot\Phi^{-1}(\alpha) }{ \sqrt{1-R(q)} }. $$

Thus,

$$ RW(q)=LGD\cdot[\Phi(z(q))-q]. $$

Because q affects the risk weight directly and also indirectly through the asset-correlation parameter $R(q)$, the chain rule gives

$$ \frac{dRW(q)}{dm}= \left[ \frac{\partial RW(q)}{\partial q} + \frac{\partial RW(q)}{\partial R} \frac{dR(q)}{dq} \right] \frac{dq}{dm}. \tag{1} $$

(A) Derivative of the conservative PD with respect to MoC C Following Tasche (2010) and Wosnitza (2026), the best-estimate probability of default is

$$ p= LRADR\cdot \frac{dF_D(s)}{dF_{\mathrm{All}}(s)}. $$

The conservative probability of default is defined as

$$ q= \left(LRADR+\beta m\right) \frac{dF_D(s)}{dF_{\mathrm{All}}(s)}, $$

where $\beta$ is a scaling factor.

Using the definition of p, we obtain

$$ q= \left(LRADR+\beta m\right) \frac{p}{LRADR}. $$

Therefore,

$$ q= p+\beta m\frac{p}{LRADR}. $$

Differentiating with respect to m gives

$$ \frac{dq}{dm}= \beta\frac{p}{LRADR}. \tag{A} $$

Equivalently, since

$$ \frac{dF_D(s)}{dF_{\mathrm{All}}(s)}= \frac{q}{LRADR+\beta m}, $$

we can write

$$ \frac{dq}{dm}= \beta\frac{q}{LRADR+\beta m}. $$

At m=0, we have q=p, and therefore

$$ \left.\frac{dq}{dm}\right|_{m=0}= \beta\frac{p}{LRADR}. $$

Substituting this result into equation (1) yields

$$ \frac{dRW(q)}{dm}= \left[ \frac{\partial RW(q)}{\partial q} + \frac{\partial RW(q)}{\partial R} \frac{dR(q)}{dq} \right] \beta\frac{p}{LRADR}. $$

(B) Derivative of the asset-correlation parameter Articles 153 and 154 of the CRR define the asset-correlation parameter as a function of the probability of default:

$$ R(q)= a_1 \frac{1-\exp(a_3q)} {1-\exp(a_3)} + a_2 \left[ 1- \frac{1-\exp(a_3q)} {1-\exp(a_3)} \right]. $$

Expanding this expression gives

$$ R(q)= \frac{a_1-a_2}{1-\exp(a_3)} + a_2 + \exp(a_3q) \frac{a_2-a_1}{1-\exp(a_3)}. $$

Therefore,

$$ \frac{dR(q)}{dq}= a_3\exp(a_3q) \frac{a_2-a_1}{1-\exp(a_3)}. \tag{B} $$

Since $a_3<0$, $a_2>a_1$, and $1-\exp(a_3)>0$, it follows that

$$ \frac{dR(q)}{dq}<0. $$

Substituting equation (B) into equation (1), we obtain

$$ \begin{aligned} \frac{dRW(q)}{dm} ={}& \Bigg[ \frac{\partial RW(q)}{\partial q} + \frac{\partial RW(q)}{\partial R} a_3\exp(a_3q) \frac{a_2-a_1}{1-\exp(a_3)} \Bigg] \beta\frac{p}{LRADR}. \end{aligned} \tag{2} $$

Equivalently, factoring out (LGD),

$$ \begin{aligned} \frac{dRW(q)}{dm} ={}& \Bigg[ \frac{1}{LGD} \frac{\partial RW(q)}{\partial q} + \frac{1}{LGD} \frac{\partial RW(q)}{\partial R} a_3\exp(a_3q) \frac{a_2-a_1}{1-\exp(a_3)} \Bigg] \ \cdot LGD\cdot\beta\frac{p}{LRADR}. \end{aligned} \tag{3} $$

(C) Derivative with respect to the asset-correlation parameter The derivative of $z(q)$ with respect to R is

$$ \frac{\partial z(q)}{\partial R}= \frac{ \Phi^{-1}(\alpha) \left[ \sqrt{\frac{1-R(q)}{R(q)}} + \sqrt{\frac{R(q)}{1-R(q)}} \right] + \frac{\Phi^{-1}(q)}{\sqrt{1-R(q)}} }{ 2[1-R(q)] }. $$

Since

$$ RW(q)=LGD[\Phi(z(q))-q], $$

we have

$$ \frac{1}{LGD} \frac{\partial RW(q)}{\partial R}= \phi(z(q)) \frac{\partial z(q)}{\partial R}. $$

Consequently,

$$ \boxed{ \frac{1}{LGD} \frac{\partial RW(q)}{\partial R}= \phi(z(q)) \frac{ \Phi^{-1}(\alpha) \left[ \sqrt{\frac{1-R(q)}{R(q)}} + \sqrt{\frac{R(q)}{1-R(q)}} \right] + \frac{\Phi^{-1}(q)}{\sqrt{1-R(q)}} }{ 2[1-R(q)] }. } \tag{C} $$

(D) Derivative with respect to the conservative PD Holding $R(q)$ fixed, the direct partial derivative of the risk weight with respect to q is

$$ \frac{1}{LGD} \frac{\partial RW(q)}{\partial q}= \phi(z(q)) \frac{1} {\sqrt{1-R(q)}\cdot \phi\left(\Phi^{-1}(q)\right)} -1. \tag{D} $$

Substituting equations (B), (C), and (D) into equation (3), we obtain

$$ \begin{aligned} \frac{dRW(q)}{dm} ={}& \Bigg[ \phi(z(q)) \frac{1} {\sqrt{1-R(q)}\cdot \phi\left(\Phi^{-1}(q)\right)} -1 \ &\quad+ \phi(z(q)) \frac{ \Phi^{-1}(\alpha) \left[ \sqrt{\frac{1-R(q)}{R(q)}} + \sqrt{\frac{R(q)}{1-R(q)}} \right] + \frac{\Phi^{-1}(q)}{\sqrt{1-R(q)}} }{ 2[1-R(q)] } \ &\quad\quad\times a_3\exp(a_3q) \frac{a_2-a_1}{1-\exp(a_3)} \Bigg] LGD\cdot\beta\frac{p}{LRADR}. \end{aligned} \tag{4} $$

At (m=0), we have (q=p). Therefore,

$$ \begin{aligned} \left.\frac{dRW}{dm}\right|_{m=0} ={}& \Bigg[ \phi(z(p)) \frac{1} {\sqrt{1-R(p)}\cdot \phi\left(\Phi^{-1}(p)\right)} -1+\phi(z(p)) \frac{ \Phi^{-1}(\alpha) \left[ \sqrt{\frac{1-R(p)}{R(p)}} + \sqrt{\frac{R(p)}{1-R(p)}} \right] + \frac{\Phi^{-1}(p)}{\sqrt{1-R(p)}} }{ 2[1-R(p)] } \ &\quad\quad\times a_3\exp(a_3p) \frac{a_2-a_1}{1-\exp(a_3)} \Bigg] LGD\cdot\beta\frac{p}{LRADR}. \end{aligned} \tag{5} $$

```
PD = transpose(0.03/100 : 0.01/100 : 5/100);
LGD = 1;
%
a1 = 0.03;
a2 = 0.16;
a3 = -35;
%
R = @(PD) a1 * (1 - exp(a3*PD)) / (1 - exp(a3)) + a2 * (1 - (1 - exp(a3*PD))/(1 - exp(a3)));
A = @(PD) (norminv(PD) + sqrt(R(PD)) * norminv(0.999)) ./ sqrt(1 - R(PD));
RW = @(PD) (normcdf(A(PD)) - PD) * LGD;
%
R_Default = (mvncdf(norminv(PD) * ones(1,2), [0, 0], [1, R; R, 1]) - PD^2) / (PD * (1-PD));
%
h = 10^-6;
NumDiff = (RW(PD+h) - RW(PD))/h;
MyDiff = (normpdf(A(PD)) .* 1./sqrt(1 - R(PD)) .* 1./normpdf(norminv(PD)) - 1 + normpdf(A(PD)) .* (norminv(0.999) * (sqrt((1 - R(PD)) ./ R(PD)) + sqrt(R(PD) ./ (1 - R(PD)))) + norminv(PD) ./ sqrt(1 - R(PD))) ./ (2*(1-R(PD))) * a3 .* exp(a3 * PD) * (a2 - a1) / (1 - exp(a3))) * LGD * 1 ; 
%
display(NumDiff)
display(MyDiff)
%
figure
hold on 
plot(100*PD, NumDiff, '-', LineWidth=4, Color="k")
plot(100*PD, MyDiff, '--', LineWidth=2, Color=ones(1,3) * 0.85)
hold off
%
xlabel("Probability of Default", 'FontSize', 16)
xticks(1:5)
xtickformat('percentage')

ax = gca;  
ax.FontSize = 14;

ylabel('$\frac{ d\mathrm{RW(PD)}}{dPD}$', ...  
       'Interpreter', 'latex', 'FontSize', 16);  
```
```

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.