---
title: 'Probabilistic BH Kick Model: gwModel_kick_prec_flow'
url: https://www.emergentmind.com/topics/gwmodel_kick_prec_flow
type: topic
---

# Probabilistic BH Kick Model: gwModel_kick_prec_flow

gwModel_kick_prec_flow is a probabilistic, data-driven model for the distribution of remnant recoil (“kick”) velocities imparted to binary black holes (BHs) at merger by anisotropic gravitational-wave emission. Designed for binaries with generic (precessing, isotropic) spin vectors, this model leverages normalizing-flow machine learning methods and marginalization over spin-angles to provide accurate predictions for the conditional kick velocity probability density as a function of mass ratio and spin magnitudes. Its performance, efficiency, and stable extrapolation to extreme mass ratios address critical shortcomings in previous analytic and surrogate approaches, establishing gwModel_kick_prec_flow as an essential tool for hierarchical BH assembly and retention studies in dense stellar and galactic environments [2511.11536].

## 1. Problem Context and Motivation

The recoil (“kick”) velocity $v_\text{kick}$ is a fundamental outcome of binary BH mergers, dictating post-merger BH retention versus ejection from clusters and nuclei. Accurate modeling of kick distributions, particularly under precessing spin configurations, is central to population synthesis for globular clusters, active galactic nuclei (AGN) disks, and hierarchical BH growth. Conventional surrogate models based on numerical relativity (NR) or Gaussian process regression (GPR) struggle with the seven-dimensional intrinsic parameter space of precessing binaries—mass ratio $q$ and two spins $\vec{\chi}_1$, $\vec{\chi}_2$—and exhibit poor extrapolation behavior outside well-sampled regions. Analytic models (e.g., HLZ) over-broaden kick predictions, while NR surrogates (e.g., NRSur7dq4Remnant) are computationally expensive and limited in mass ratio coverage.

gwModel_kick_prec_flow overcomes these limitations via:
- Direct modeling of the kick probability density marginalized over isotropic spin-angles.
- Normalizing-flow architecture yielding smooth, non-divergent extrapolation up to $q\sim10^4$.
- Fast evaluation with consistent accuracy across mass ratio and spin parameter space [2511.11536].

## 2. Input Parameterization and Marginalization

Input features are defined to capture the binary’s intrinsic properties most relevant to the kick distribution:
- $x_1 = \log_2(q)$: Logarithmic mass ratio.
- $x_2 = |\chi_1|$: Magnitude of primary spin.
- $x_3 = |\chi_2|$: Magnitude of secondary spin.
- Context vector: $\mathbf{c} = \{x_1, x_2, x_3\}$.
- Target variable: $v$ (kick velocity), standardized to zero mean and unit variance.

Marginalization over spin-orientations is performed analytically using isotropic priors, so the model learns $p(v\,|\,q, |\chi_1|, |\chi_2|)$ averaged over all $(\theta_1, \theta_2, \phi_1, \phi_2)$ spin-angles. Symmetry is imposed by duplicating each sample under exchange of BH labels $(\log_2q \to -\log_2q; |\chi_1| \leftrightarrow |\chi_2|)$, ensuring invariance under $q \leftrightarrow 1/q$.

## 3. Normalizing-Flow Architecture

gwModel_kick_prec_flow utilizes a Masked Autoregressive Flow (MAF) with two flow layers:
- Each layer consists of a MaskedAffineAutoregressiveTransform $\mathcal{T}_i$, preceded by a ReversePermutation $\mathcal{P}_i$.
- Scale and shift networks $(\mu_i, \sigma_i)$ implemented as 8-unit-per-layer MLPs with GELU activations.
- Contextual modulation via linear embedding of $\mathbf{c}$.
- The base density is standard normal: $p_Z(z) = \mathcal{N}(0,1)$.

The overall mapping is $v = f(z;\mathbf{c})$, $z\sim\mathcal{N}(0,1)$. The change-of-variables formula for the log-likelihood is:
\[
\log p(v|\mathbf{c}) = -\frac{1}{2}[z(v;\mathbf{c})]^2 - \frac{1}{2}\log 2\pi + \sum_{\text{layers}} \log \sigma^{-1}_{\text{layer}}[u_{\text{layer}}(v;\mathbf{c})]
\]
where each $\sigma_{\text{layer}}$ arises from the affine-scale output [2511.11536].

## 4. Training Data, Optimization, and Regularization

The training dataset comprises:
- SXS NR precessing spins: 2,866 simulations, $q\in[1,15]$, $|\chi_{1,2}|\in[0.7,1.0]$.
- RIT NR precessing spins: 1,881 simulations, similar parameter ranges.
- Black-hole perturbation-theory (BHPT): 400 samples, $q\in[40,100]$, $|\chi_{1,2}|\in[0,1]$.

Data is split 75%/25% into train/validation after symmetrization and standardized preprocessing. Training proceeds via minimization of negative log-likelihood:
\[
\mathcal{L} = -\mathbb{E}_{(v, \mathbf{c})\sim\text{train}} [\log p(v|\mathbf{c})]
\]
using Adam optimizer (learning rate $1 \times 10^{-3}$, $L_2$ weight decay $1 \times 10^{-4}$, batch size 128), with early stopping at minimum validation loss. Regularization is achieved through shallow flow (two layers) and small weight decay [2511.11536].

## 5. Validation, Performance, and Computational Efficiency

Training and validation losses converge rapidly ($\approx 0.005$ nat/sample in 5,000 steps), with the 1-Wasserstein distance $\approx 0.1$ stabilizing early. Distribution-to-distribution tests (Jensen–Shannon divergence, JSD) yield:
- For $q\in[1,4]$, $|\chi_{1,2}|\in[0,1]$, gwModel_kick_prec_flow vs. NRSur: JSD $<0.1$ for $\gtrsim 90\%$ of points; worst-case $\approx 0.15$ in low-spin regime.
- vs. HLZ analytic: JSD $>0.1$ for $>80\%$ of points, confirming HLZ’s over-broad predictions.
- For $q\in[4,100]$, gwModel vs. HLZ: JSD $>0.1$ in nearly all configurations.

Computational cost on single CPU:
- gwModel_kick_prec_flow: median $0.05$ s for $2,500$-sample distribution ($\sigma\approx 0.002$ s).
- NRSur7dq4Remnant: median $2.7$ s ($\sigma\approx 0.16$ s).
- HLZ analytic: median $0.00024$ s ($\sigma\approx 0.00001$ s).

The model is $\approx 60\times$ faster than NRSur, while maintaining high accuracy and robust behavior under extrapolation up to $q \sim 10^4$; no divergence or oscillatory artifacts are observed [2511.11536].

## 6. Practical Application and Limitations

Typical usage involves standardizing context features and sampling kick velocities via model inversion:
```python
from gwModels import KickPrecFlow
model = KickPrecFlow()         # loads pre-trained NF
v_samples = model.sample(q, chi1, chi2, n_samples=2500)
p_pdf     = model.pdf(v_grid, q, chi1, chi2)
```
Recommended ranges:
- Mass ratio: $q\in[1,200]$ for faithful predictions; smooth extrapolation to $q\sim10^3$.
- Spin magnitudes: $|\chi_{1,2}|\in[0,1]$.

Limitations:
- Only marginal distributions over spin-angles are modeled; pointwise predictions for fixed $(\theta_{1,2}, \phi_{1,2})$ not available.
- Low-spin ($\chi < 0.2$) regions are underrepresented in the dataset.
- For extremely large $q$, the model is not analytically constrained to follow post-Newtonian $\eta^2$ scaling; manual enforcement is possible if needed [2511.11536].

## 7. Astrophysical Impact and Significance

gwModel_kick_prec_flow is integral to studies of BH retention in clusters and hierarchical merger chains. Incorporation into 1,404 detailed star cluster simulations demonstrates its influence by varying BH retention probabilities in low-mass globular clusters. Its speed and coverage make it suitable for population synthesis and rapid semi-analytic modeling in both AGN and cluster contexts, with negligible computational overhead.

*This suggests that probabilistic, accurate modeling of kick distributions using normalizing flows is now a practical standard for astrophysical ensemble studies requiring extreme mass ratio and high-dimensional spin coverage.*

## Table: Summary of Key Features and Performance

| Model Class                 | Domain of Validity           | JSD (vs. NRSur) | Median Eval Time (2,500 samples) |
|-----------------------------|------------------------------|------------------|----------------------------------|
| gwModel_kick_prec_flow      | $q \in [1,200]$, $|\chi| \in [0,1]$ | <0.1 for most cases | 0.05 s                     |
| NRSur7dq4Remnant            | $q \leq 4$                   | Reference        | 2.7 s                      |
| HLZ analytic                | All $q$, less accurate       | >0.1 (vs. NRSur) | 0.00024 s                  |


gwModel_kick_prec_flow is the first publicly available normalizing-flow model for probabilistic kick distributions from precessing BH mergers, combining broad NR and BHPT coverage, high accuracy, and stable extrapolation. It is distributed under the gwModels package as `kick_prec_flow` [2511.11536].

Source: https://www.emergentmind.com/topics/gwmodel_kick_prec_flow