Skip to content

Constrained MLE Formulation

This page provides the mathematical specification of the Risk Bridge statistical model, following the framework established by Cao et al. (2024) and extended by Wang & Chen (2026).


1. Problem Formulation

Let \(X \in \mathbb{R}^p\) denote discrete baseline predictors, \(Y \in \{0, 1\}\) denote the binary outcome of interest, and \(Z \in (0, 1]\) denote an intermediate continuous risk marker.

We partition \(Z\) into \(K+1\) ordered categories \(Z_{\text{cat}} \in \{0, 1, \dots, K\}\) using cutpoints \(0 = c_0 < c_1 < \dots < c_K < c_{K+1} = 1\):

\[ Z_{\text{cat}} = k \iff c_k \le Z < c_{k+1} \]

Target Risk Model

The primary goal is to predict risk in the target population using the logistic model:

\[ P(Y = 1 \mid X, Z_{\text{cat}}; \theta) = \frac{1}{1 + \exp\left(-\left(\alpha + X^\top \beta_X + \beta_Z Z_{\text{cat}}\right)\right)} \]

where \(\theta\) collects the unknown parameters.


2. Joint Likelihood on Source Data

The source cohort provides observations \((X_i, Y_i, Z_i)\). We factor the joint distribution as:

\[ f(Y, Z \mid X; \theta) = P(Y \mid X, Z_{\text{cat}}; \alpha, \beta) \cdot f(Z \mid X; \gamma, \sigma) \]

Truncated-Lognormal Distribution for \(Z \mid X\)

Because \(Z\) is restricted to \((0, 1]\), we model \(Z \mid X\) using a lognormal distribution truncated to the interval \((0, 1]\).

Let \(\tau(X) = \gamma_0 + X^\top \gamma_X\). The conditional density of \(Z \in (0, 1]\) given \(X\) is:

\[ f(z \mid X; \gamma, \sigma) = \frac{\frac{1}{z \sigma \sqrt{2\pi}} \exp\left(-\frac{(\log z - \tau(X))^2}{2\sigma^2}\right)}{\Phi\left(-\frac{\tau(X)}{\sigma}\right)} \]

where \(\Phi(\cdot)\) denotes the standard normal cumulative distribution function.

Negative Log-Likelihood

For an analysis sample of \(n\) subjects, the negative log-likelihood \(\ell(\theta)\) is:

\[ \begin{aligned} \ell(\theta) = &-\sum_{i=1}^n \Big[ Y_i \log p_i(\theta) + (1 - Y_i) \log (1 - p_i(\theta)) \Big] \\ &-\sum_{i=1}^n \left[ -\log z_i - \log \sigma - \frac{1}{2} \log(2\pi) - \frac{(\log z_i - \tau(X_i))^2}{2\sigma^2} - \log \Phi\left(-\frac{\tau(X_i)}{\sigma}\right) \right] \end{aligned} \]

The package implements exact closed-form analytic gradients \(\nabla_\theta \ell(\theta)\) in risk_bridge.likelihood.


3. Reference Calibration Constraints

Let \(\mathcal{D}_{\text{reference}}\) denote a representative external cohort where \(X\) and \(Y\) are observed.

We fit a base model \(\phi(X) = P(Y=1 \mid X)\) on the reference data and partition the predicted risk range into \(K\) risk strata \(\mathcal{S}_1, \dots, \mathcal{S}_K\) (typically defined by quantiles of \(\phi(X)\)).

For each stratum \(\mathcal{S}_k\), the reference cohort provides an external event rate benchmark:

\[ p_k^* = P_{\text{ext}}(Y = 1 \mid X \in \mathcal{S}_k) \]

Model-Implied Risk

Under the joint model parameterized by \(\theta\), the model-implied marginal risk within stratum \(\mathcal{S}_k\) is obtained by integrating over the discrete support of \(X\):

\[ P(Y = 1 \mid X \in \mathcal{S}_k; \theta) = \frac{\sum_{x \in \mathcal{S}_k} P(Y = 1 \mid X = x; \theta) P(X = x)}{\sum_{x \in \mathcal{S}_k} P(X = x)} \]

where the conditional probability marginalizing over \(Z_{\text{cat}}\) is:

\[ P(Y = 1 \mid X = x; \theta) = \sum_{j=0}^K P(Y = 1 \mid X = x, Z_{\text{cat}} = j; \alpha, \beta) \cdot P(Z_{\text{cat}} = j \mid X = x; \gamma, \sigma) \]

Constraint Functions

We define the stratum-specific calibration discrepancy function \(g_k(\theta)\) as:

\[ g_k(\theta) = \sum_{x \in \mathcal{S}_k} P(Y = 1 \mid X = x; \theta) P(X = x) - p_k^* \sum_{x \in \mathcal{S}_k} P(X = x) \]

4. Constrained Optimization Problem

The constrained Maximum Likelihood Estimator (cMLE) \(\hat{\theta}_{\text{cMLE}}\) solves:

\[ \begin{aligned} \min_{\theta} \quad & \ell(\theta) \\ \text{subject to} \quad & -\epsilon \le g_k(\theta) \le \epsilon, \quad k = 1, \dots, K \end{aligned} \]

where \(\epsilon > 0\) is the user-specified calibration tolerance (--calibration-tolerance, default 0.02).

The package implements exact analytic constraint Jacobians \(J_{kj} = \frac{\partial g_k}{\partial \theta_j}\) in risk_bridge.constraints, ensuring rapid, numerically stable convergence in non-linear interior-point algorithms.