# Bridging classical data assimilation and optimal transport: the 3D-Var case

Marc Bocquet, Pierre J Vanderbecken, Alban Farchi, Jeffrey Dumont Le Brazidec, Yelva Roustan

<figure><img src="image_1.png" /></figure>

## To cite this version:

Marc Bocquet, Pierre J Vanderbecken, Alban Farchi, Jeffrey Dumont Le Brazidec, Yelva Roustan. Bridging classical data assimilation and optimal transport: the 3D-Var case. Nonlinear Processes in Geophysics, 2024, 31, pp.335 - 357. 10.5194/npg-31-335-2024. hal-04788094

HAL Id: hal-04788094

https://hal.science/hal-04788094v1

Submitted on 18 Nov 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_3.png" /></figure>

# Bridging classical data assimilation and optimal transport: the 3D-Var case

Marc Bocquet, Pierre J. Vanderbecken, Alban Farchi, Joffrey Dumont Le Brazidec, and Yelva Roustan

CEREA, École des Ponts and EDF R&D, Île-de-France, France

**Correspondence:** Marc Bocquet (marc.bocquet@enpc.fr)

Received: 20 November 2023 – Discussion started: 5 December 2023

Revised: 17 May 2024 – Accepted: 21 May 2024 – Published: 12 July 2024

**Abstract.** Because optimal transport (OT) acts as displacement interpolation in physical space rather than as interpolation in value space, it can avoid double-penalty errors generated by mislocations of geophysical fields. As such, it provides a very attractive metric for non-negative, sharp field comparison – the Wasserstein distance – which could further be used in data assimilation (DA) for the geosciences. However, the algorithmic and numerical implementations of such a distance are not straightforward. Moreover, its theoretical formulation within typical DA problems faces conceptual challenges, resulting in scarce contributions on the topic in the literature.

We formulate the problem in a way that offers a unified view with respect to both classical DA and OT. The resulting *OTDA* framework accounts for both the classical source of prior errors, background and observation, and a Wasserstein barycentre in between states which are pre-images of the background state and observation vector. We show that the hybrid OTDA analysis can be decomposed as a simpler OTDA problem involving a single Wasserstein distance, followed by a Wasserstein barycentre problem that ignores the prior errors and can be seen as a *McCann interpolant*. We also propose a less enlightening but straightforward solution to the full OTDA problem, which includes the derivation of its analysis error covariance matrix. Thanks to these theoretical developments, we are able to extend the classical 3D-Var/BLUE (best linear unbiased estimator) paradigm at the core of most classical DA schemes. The resulting formalism is very flexible and can account for sparse, noisy observations and non-Gaussian error statistics. It is illustrated by simple one- and two-dimensional examples that show the richness of the new types of analysis offered by this unification.

# 1 Introduction

## 1.1 Data assimilation and the double-penalty issue

Geophysical data assimilation (DA) is a set of methods and algorithms at the intersection of Earth sciences, mathematics, and computer science that are designed to enhance our understanding and predictive capability with respect to the complex systems that govern our planet (Carrassi et al., 2018). For example, these systems encompass the atmosphere, ocean, atmospheric chemistry and biogeochemistry, land surfaces, glaciology, hydrology, and climate system as a whole. DA is meant to optimally combine all sources of quantitative information, typically past and present observations, and numerical and statistical models of the system un-

der consideration. DA is critical in forecasting chaotic geofluids by resetting the initial conditions of the flow, estimating physical and statistical parameters of the models, and providing a quantitative reanalysis of the past history of the climate system over decades. Because classical DA is applied to complex and high-dimensional dynamics, the DA algorithms often result from a compromise between the sophistication of the employed mathematical techniques and their numerical scalability and efficiency (Kalnay, 2003; Asch et al., 2016; Evensen et al., 2022). For instance, it is well-known that most DA methods are built around or from an update step – the analysis – where observations and background states are combined, an operation which often relies on Gaussian statistical assumptions.
Here, we would like to focus on one important issue that impacts classical DA, known as the double-penalty error in the geosciences. The double-penalty issue refers to the over-penalisation of errors in both the model and observational data (e.g. Amodei and Stein, 2009) and compromises the balance required for effective DA. It often stems from the mislocation of fields, which is caused by model error in either the forecasting or observation operator. A typical example is given by the slight mislocation of a plume of pollutant resulting in high predicted concentration values at positions where no pollutant is observed, while the model misses the observed concentration peaks (Farchi et al., 2016). This mismatch is heavily penalised due to the use, over the same discretised space, of the root-mean-square error (RMSE) for a point-by-point comparison. Figure 1 shows an exemplar of double-penalty error resulting in the inability to properly evaluate a model and learn from an analysis increment. This double-penalty error, a very common contribution to the representation error (Janjić et al., 2018), is ubiquitous in the geosciences, for example, in numerical weather prediction (in particular for water vapour), in atmospheric chemistry and air quality, in biogeochemistry, and in eddy-resolving ocean forecasting. This especially applies to sharp fields, whereas it may be of less relevance for smoother, larger-scale fields such as temperature.

It has been recognised that, although it can handle amplitude and smoothness mismatch, the weighted Euclidean (Mahalanobis) distance cannot cope with mislocation error; thus, it cannot account for the full distortion between mismatched fields (Hoffman et al., 1995). In the field of precipitation verification, one would alternatively speak of amplitude, structure, and location errors (e.g. Wernli et al., 2008). Hence, even though tuning covariances of Gaussian error distributions as in classical DA, such as increasing the correlation length, might help mitigate the double-penalty error, it is insufficient. In Fig. 1, one might replace the Euclidean norm with a weighted Euclidean one with a large correlation length. This would yield similar norm values for both cases. Unfortunately, it is not difficult to show that, in this limit, this (almost singular) norm can only distinguish between the spatial mean of both fields: it became blunt with no discriminating power. With respect to DA, Fyeux et al. (2018, their Fig. 1) also illustrate why the Euclidean distance cannot properly cope with mislocation error. Note that, if Fyeux et al. (2018) had used a weighted Euclidean distance instead, with the same covariance matrix for the two contributions of the cost function, the resulting analysis state would have been the same and, in particular, independent of the covariance matrix. A similar but two-dimensional illustration is given by Vanderbecken et al. (2023, their Fig. 3).

## 1.2 Nonlocal verification metrics

The issue can be attributed to the use of a local verification metric, meaning that it compares, through the RMSE, values

at the same site, of the same grid cell. Thus, this issue goes beyond DA and pertains to the use of local metrics.

To avoid being impacted by the double-penalty issue stemming from the use of local verification metrics, smarter non-local or multiscale metrics have been proposed. A typical metric of this kind consists of the combination of a displacement map followed by the use of classical norm such as the RMSE (Hoffman et al., 1995; Keil and Craig, 2009). In this vein, effective verification metrics can be based on optical flow-based warping or on deformed meshes, prior to using classical norms (Gilleland et al., 2010a, b). These metrics can also be designed as scale-dependent and possibly multiscale, based on an empirical separation of scales, such as with fuzzy metrics (Ebert, 2008; Amodei and Stein, 2009) or wavelets (Briggs and Levine, 1997). They can be designed to grasp and quantify objects and features, such as lows and highs (Davis et al., 2006a, b; Lack et al., 2010). Metrics with similar capabilities (but not necessarily based on a displacement concept) have been introduced in computer vision, such as the structural similarity index (Zhou et al., 2004), or in the verification of precipitation (Wernli et al., 2008; Skok, 2023; Necker et al., 2023).

One of the most elegant approaches is based on the theory of optimal transport (OT) and the associated Wasserstein distance, which sits on solid mathematical foundations and significant developments; these are the main reasons why we will focus on OT in the following. Examples of the application of OT to the verification of tracer and greenhouse gases models are given in Farchi et al. (2016) and Vanderbecken et al. (2023).

## 1.3 Optimal transport and the Wasserstein distance

Before mentioning applications of the Wasserstein distance in the field of geoscience, let us first give a very brief introduction to the concept and mathematical formulation of OT.

The OT concept stems from an engineering, although rather universal, problem. Gaspard Monge (Monge, 1781) considered the earth mover problem, the goal of which is to efficiently move rubble to an embankment of about the same volume (see Fig. 2). Each displacement of a bit of earth has a known cost, so that the goal is to find the cheapest deterministic map that completely moves the rubble to the embankment. In mathematical terms, the goal is to find the map of minimal cost that transports the origin measure $\rho_0$ to the target measure $\rho_b$; measure here means that both of them are non-negative and are integrable of integral 1. Note that the value 1 is arbitrary here and can be changed to $m > 0$, provided that this is the mass of both $\rho_0$ and $\rho_b$. The cost is defined by a non-negative function $C_{bo}$ of two variables (one for the origin space and the other for the target space). Let us assume a quadratic cost, defined for any couple of points $(x, y)$ of a geometric domain $\Omega$:

$$C_{bo}(x, y) = \|x - y\|_2^2 \quad (1)$$
<figure><img src="image_4.png" /><figcaption>Figure 1. These two panels schematise the computation of the RMSE of two analysis increments. These increments are the difference between the truth (left mesh in between both pairs of the norm delimiters), concentrated here in the red grid cell, and the analysis, located in the green grid cells (right mesh in between both pairs of the norm delimiters). The increment in panel (a) is the outcome of a better analysis that is spatially closer to the truth, compared with that in panel (b); however, both increments yield the same RMSE. Hence, this verification metric is impacted by the double-penalty error and does not help discriminate location errors.</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>Figure 2. Illustration of the earth mover problem introduced by Monge in 1781 (see bulk of paper).</figcaption></figure>

where $\|\cdot\|_2$ is the Euclidean norm. Let us define the set of all admissible differentiable maps $T$ that transport $\rho_o$ to $\rho_b$:

$$ \mathcal{U}_{bo} = \{T : \Omega \mapsto \Omega, \rho_o = |\partial_x T| \rho_b \circ T\}, \quad (2) $$

where $|\partial_x T|$ is the absolute value of the determinant of the Jacobian of $T$, a factor which accounts for the deformation of the measure by the globally mass-conserving $T$. The square of the Wasserstein distance $W_{Cbo}$ is then defined by the following:

$$ W_{Cbo}^2 (\rho_o, \rho_b) = \min_{T \in \mathcal{U}_{bo}} \int_{\Omega} C_{bo}(x, T(x)) \rho_o(x) dx. \quad (3) $$

Here, the purpose is to minimise the total transport cost between $\rho_o$ and $\rho_b$, and the optimal map $T$ is often referred to as the *Monge map*. It can be shown that $W_{Cbo}$ is indeed a proper mathematical distance. The mathematical formulation is deceptively simple, as it is elegant, concise, and easy to grasp, but its theoretical and numerical solutions are far from trivial.

In the 20th century, a breakthrough was made by Leonid Kantorovich, who promoted the Monge problem to a probabilistic formulation. From his point of view, a bit of earth can be split and moved to many sites of the target measure support. Thus, the deterministic map $T$ is replaced with a probabilistic measure $\pi$ defined over $\Omega \times \Omega$. Hereafter, such a $\pi$ is called a transference plan. An admissible transference plan

is integrable and has $\rho_o$ and $\rho_b$ as one-variable marginals; hence, the definition of the admissible set is as follows:

$$ \mathcal{V}_{bo} = \left\{ \pi : \Omega \times \Omega \mapsto \mathbb{R}_+, \begin{array}{l} \rho_o(x) = \int_{\Omega} \pi(x, y) dy, \\ \rho_b(y) = \int_{\Omega} \pi(x, y) dx \end{array} \right\}. \quad (4) $$

As opposed to the deterministic Monge maps, the transference plans offer a symmetrical view of the origin and target space and their measures. An illustration of a discrete transference plan is given in Fig. 3. From this view, the squared Wasserstein distance can be reformulated as follows:

$$ W_{Cbo}^2 (\rho_o, \rho_b) = \min_{\pi \in \mathcal{V}_{bo}} \int_{\Omega \times \Omega} C_{bo}(x, y) \pi(x, y) dx dy. \quad (5) $$

Equations (3) and (5) are the main continuous formulations of OT. In the rest of the paper, we will deal instead with discrete related formulations, which are more tangible and amenable to algorithmic and numerical implementations.

The field has attracted a lot of attention from pure and applied mathematicians as well as computer scientists. A complete introduction to the topic by experts can be found in the stimulating text books by Vilani (2003, 2009) and Peyré and Cuturi (2019). Peyré and Cuturi (2019) provide concrete examples, numerical methods, and a broad coverage of the topic from the perspective of applied mathematicians and computer scientists; hence, their work will be referred to quite often in the rest of the paper.

## 1.4 Nonlocal, multiscale metrics and data assimilation

Let us now go back to DA and narrow our focus to the use of advanced metrics in DA. Accounting for displacement error in DA, and hence relying on nonlocal verification metrics, has been advocated by Hoffman and Grassotti (1996), Ravela et al. (2007), and Plu (2013). Metrics built on a multiscale
<figure><img src="image_6.png" /><figcaption>**Figure 3.** A representation of a discrete transport plan between two discrete origin (blue) and target (red) measures. The black dots represent the value of the transference plan. The radius of the dots is proportional to the values of these measures. This transference plan is checked to be admissible but is not necessarily optimal.</figcaption></figure>

analysis of the fields to achieve a similar goal have been proposed by Ying (2019) and Ying et al. (2023).

The Wasserstein distance and closely related formulations have been advocated in the flow formulation of the analysis (DA update) to seamlessly transport the prior to the posterior (El Moselhy and Marzouk, 2012; Oliver, 2014; Marzouk et al., 2017; Farchi and Bocquet, 2018; Tamang et al., 2020). It can, for instance, be used to adjust the posterior discrete probability density functions (pdfs) in the particle filter. It has similarly been used to assist ensemble DA (Tamang et al., 2021, 2022). Finally, it has also, very recently, been used to compare forecast ensembles for sub-seasonal prediction (Le Coz et al., 2023; Lledó et al., 2023) or precipitation (Duc and Sawada, 2024).

In the context of this paper, it is critical to be aware that the use of OT in practical DA has, thus far, focused on applying OT independently to the pdf of each single scalar variable. Quite often, OT is applied to the pdf of a single random variable for the following two reasons:

- OT in one dimension (the space of the values taken by this random variable), with a quadratic cost, has a very simple solution that only relies on the cumulative distribution functions of the origin and target measures (see e.g. Remark 2.30 in Peyré and Cuturi, 2019), a technique known in statistics as quantile matching.

- Increasing the number of random variables is subject to the curse of dimensionality, necessitating an exponential increase in computational resources when increasing the resolution of the discretised fields.

This is very different from our context and objective where the objects dealt with by OT are (non-negative) physical field states, not the pdf of one of their scalar variables.

## 1.5 Feyeux et al. (2016) proposal

The present paper stands more in the wake of the seminal proposals of Ning et al. (2014), Feyeux (2016), and Feyeux et al. (2018). Their idea is to replace the local metrics of classical variational DA, typically the square of the Euclidean distance (hence related to the $L_2$ norm), with the squared Wasserstein distance. This is intuitively what we are after in order to cope with mislocation errors mentioned in Sect. 1.1 in the context of DA. This should redefine the nature of the DA update step. Let us formalise this idea (Feyeux, 2016).

We will seize this opportunity to introduce some of our notation in the context of discrete DA, which is a widely adopted standpoint in the geosciences. Let us focus on a classical DA 3D-Var cost function (Daley, 1991):

$$G_{\text{cl}}(\mathbf{x}^a) = \|\mathbf{y}^b - \mathbf{x}^a\|_2^2 + \|\mathbf{y}^o - \mathbf{H}\mathbf{x}^a\|_2^2, \quad (6)$$

where $\|\cdot\|_2$ is the Euclidean norm, $\mathbf{y}^b \in \mathbb{R}^{N_b}$ is the first guess, $\mathbf{y}^o \in \mathbb{R}^{N_o}$ is the vector of observations, and $\mathbf{H}$ is the observation operator.<fnref n="1" /> $\mathbf{x}^a \in \mathbb{R}^{N_a}$ is the dummy variable of this optimisation problem whose optimal value corresponds to the DA state analysis. Now, the substitution of the Euclidean norm yields the new 3D-Var cost function:

$$G_w(\mathbf{x}^a) = W_2^2(\mathbf{y}^b, \mathbf{x}^a) + W_2^2(\mathbf{y}^o, \mathbf{H}\mathbf{x}^a), \quad (7)$$

where $W_2$ is some discretisation of the Wasserstein distance based on the cost defined by the square of the Euclidean distance. Note that this 3D-Var case requires balancing two instances of a Wasserstein-based metric. The analysis state is known as a Wasserstein barycentre (abridged W-barycentre in the following).

Feyeux (2016) and Feyeux et al. (2018) explored the optimisation aspects of this DA problem. However, Feyeux (2016) ultimately pointed to a possible inconsistency in the definition of the DA problem formulated in Eq. (7), where the system is only partially observed (non-trivial $\mathbf{H}$). In the case where the system is fully observed, typically when $\mathbf{H}$ is the identity operator, the outcome of the optimisation problem, i.e. the analysis, matches our expectations. However, when the system is partially observed, inconsistencies are observed. Let us see why.

Figure 4a considers the DA problem based on Eq. (7), assuming that only half of the domain is observed. We have

<footnote n="1">¹The notation $\mathbf{y}^b$ and $\mathbf{y}^o$ is at variance with the more familiar $\mathbf{x}^b$ and $\mathbf{y}$ notation of DA, respectively. However, this change will prove very useful in the following; it follows the idea that the full information vector is $\mathbf{y} = [(\mathbf{y}^b)^\top, (\mathbf{y}^o)^\top]^\top$, whose components may benefit from homogeneous notation (Talagrand, 1997).</footnote>
solved the corresponding mathematical and numerical problem as raised by Feyeux (2016) and displayed its solution. However, one observes that the mass of the solution concentrates on the observed subdomain and neglects the rest of the domain where the prior mainly concentrates, an outcome suspected by Feyeux (2016). Instead, we would have intuitively preferred a solution close to the one offered by Fig. 4b, whose formulation and numerical solution differ and follow the new approach developed in the present paper (how we obtained this solution will be described in Sect. 2).

The main caveat of Eq. (7) comes from the fact that the system is only partially observed, as well as the requirement that OT is balanced; i.e. the origin and target densities must have the same mass. This mass balance applies to both OT terms in Eq. (7), between $y^b$ and $x^a$ and between $y^o$ and $Hx^a$:

$$m(x^a) = m(y^b), \quad m(Hx^a) = m(y^o). \quad (8)$$

Here, the mass of a vector $x \in \mathbb{R}^N$ is defined by

$$m(x) = 1^T x = \sum_{i=1}^{N} x_i, \quad (9)$$

with $1 \in \mathbb{R}^N$ hereafter defined as the vector of entries 1.

Now, if we further assume, for simplicity, that $y^b$ and $y^o$ have the same mass (which is the case in Fig. 4a), then

$$m(Hx^a) = m(y^o) = m(y^b) = m(x^a). \quad (10)$$

As a result, we obtain $m(Hx^a) = m(x^a)$, which is an undesired prior piece of information as to where to find the mass of $x^a$. Simply put, unless the system is fully observed, this approach amounts to the streetlight effect. This is precisely what happens in Fig. 4a with the undesired concentration of the mass of $x^a$ close to the edge of the observed subdomain.

To overcome this caveat and find a proper alternative to Eq. (7), we need (i) to renounce comparing the fields in observation space (in the observation discrepancy term of the cost function) and (ii) to introduce unbalanced OT (i.e. we need to be able to accommodate states of distinct masses). In the computer science context of pure OT, the latter has been discussed by Chizat et al. (2018). However, our solution differs formally and will be DA-centric.

## 1.6 Objective and outline

The objective of this paper is to lift the objection of Feyeux (2016) and propose a DA framework based on the Wasserstein distance, thereby offering a consistent way to bridge OT and classical DA. The new formalism will be referred to as hybrid OTDA (hybrid optimal transport data assimilation) in the rest of this paper (or OTDA for brevity). We will focus on the definition of a 3D-Var DA problem and how to obtain its analysis state and the associated analysis error covariance matrix.

At least within the perimeter of this paper, some restrictions apply. Firstly, the physical fields considered in the DA problem are non-negative (concentration of tracer, pollutants, water vapour, hydrometeors, chemical and biogeochemical species, etc.). However, as opposed to Feyeux (2016), the methods of this paper do not require the (possibly noisy) background state $y^b$ and observation $y^o$ to be non-negative. We stress once again that the states of our DA problem are physical fields onto which OT is applied and are not meant to be a pdf of a random variable. Secondly, the observation operator $H$ is assumed to be linear. This is only meant for convenience and to obtain a rigorous correspondence between the primal and dual cost functions of the 3D-Var case. Making this assumption is very common in geophysical DA: $H$ can indeed be seen as the tangent linear of a nonlinear observation operator within the inner loop of a 3D-Var or a 4D-Var case (see, for instance, Courtier, 1997).

The outline of the paper is as follows. After the present introduction (Sect. 1), Sect. 2 discloses our main idea and discusses two mathematical paths to solve the underlying optimisation problem; the first path is enlightening but not necessarily practical, whereas the alternative path is direct and robust but hides some of the concepts behind it. Section 3 provides one- and two-dimensional illustrations of a 3D-Var analysis based on the new hybrid OTDA formalism. These illustrations will show the possibilities and flexibility of the new framework. Importantly, Sect. 3 will also depict classical DA as a limit case of the formalism. In Sect. 4, the second-order analysis, i.e. the uncertainty quantification of the OTDA 3D-Var case, is derived, discussed, and illustrated. Conclusions and perspectives are given in Sect. 5.

# 2 The main proposal

## 2.1 Notation and conventions

Non-negative vectors $x$ of size $N$ are called discrete measures; they lie in the orthant $O_N^+ \triangleq \mathbb{R}_+^N$. Although most mathematical OT theories work on normalised discrete measures, yielding probability vectors, this assumption will not be needed in this paper. The open subset of $O_N^+$ of all the positive discrete measures will be denoted as $O_N^{+,*} \triangleq \mathbb{R}_+^{N, *}$.

We will distinguish the observations $y^b \in \mathbb{R}^{N_b}$ and $y^o \in \mathbb{R}^{N_o}$ from the observable states $x^b \in O_{N_b}^+$ and $x^o \in O_{N_o}^+$. $y^b$, which corresponds to the first guess of conventional DA, and $y^o$, which corresponds to the traditional observation vector, are known before solving the 3D-Var problem. These vectors embody all of the information processed in the analysis. By contrast, the observables $x^b$ and $x^o$, which are related to $y^b$ and $y^o$, respectively, through an observation operator (the identity for $y^b$ and $x^b$), are not known a priori. They will be estimated along with the analysis state $x^a \in O_{N_a}^+$. Note that these vectors may well lie in distinct vector spaces of different dimensions; hence, the introduction of as many dimensions as necessary.
<figure><img src="image_7.png" /><figcaption>**Figure 4.** The panels illustrate the analysis of a 3D-Var case that relies on the Wasserstein distance rather than a local metric. The red dots represent the observations, while the dashed blue curve represents the background state. The observations are only focused on the left half of the domain. The solution of the optimisation problem in Eq. (7) is displayed as a solid green curve in panel (a). The solution of the optimisation problem that we will propose in this paper is displayed as a solid green curve in panel (b). The support of the observation is suggested using a wavy grey segment. These states are typically one-dimensional puff pollutant concentrations. They should not be confused with pdfs of a single random variable.</figcaption></figure>

sions $N_b, N_o, N_b$, and $N_o$. $x_i^*$ can be seen as the value taken by $x^*$ at site $r_i^*$, for $\star = b, o$, and $a$ and $i \in [1, N_\star]$. Mind that the distinction between $y^b$ and $x^b$ and the introduction of $x^o$ are novelties of OTDA compared with classical DA.

Like in classical DA, the vectors $y^b$ and $y^o$ are subject to (prior) errors whose statistics are specified by the likelihoods $p(y^b|x^b)$ and $p(y^o|x^o)$, respectively. Up to constants that do not depend on $x^b, x^o, y^b$, and $y^o$, we assume the existence of $\zeta_b$ and $\zeta_o$, such that

$$ \ln p(y^b|x^b) \triangleq -\zeta_b(y^b - x^b) + \text{cst}, \quad (11a) $$

$$ \ln p(y^o|x^o) \triangleq -\zeta_o(y^o - \mathbf{H}x^o) + \text{cst}. \quad (11b) $$

Thus, various error statistics can be considered. These errors are hypothesised to be mutually independent. The observation operator $\mathbf{H}: O_{N_o}^+ \to \mathbb{R}^{N_o}$ used in the definition of $\zeta_o$ is assumed to be linear. This qualification is for convenience and could be lifted if necessary. It is further assumed that $\zeta_b$ and $\zeta_o$ are strictly convex functions. This is, for instance, the case if we choose Gaussian error statistics yielding

$$ \zeta_b(e_b) = \frac{1}{2} \|e_b\|_{\mathbf{B}^{-1}}^2, \quad \zeta_o(e_o) = \frac{1}{2} \|e_o\|_{\mathbf{R}^{-1}}^2. \quad (12) $$

Here, $\|e\|_A = \sqrt{e^\top A e}$. $\mathbf{B}$ is the positive definite background error covariance matrix and $\mathbf{R}$ is the positive definite observation error covariance matrix. Finally, in the following, the $m(\star)$ operator will act not only on vectors but also, more generally, on any tensor, and it will return the sum of all of its entries.

## 2.2 Formalism of discrete optimal transport

To discretise and solve the continuous Kantorovich optimisation problem introduced in Sect. 1.3, we will need two el-

ementary pieces of information about OT. These are not the only techniques that we will leverage, but both represent cornerstones towards a numerical solution to our proposal and, hence, require a proper introduction.

### 2.2.1 The primal cost function

Let us consider two discrete measures $x^b \in O_{N_b}^+$ and $x^o \in O_{N_o}^+$ with the same mass:

$$ m \triangleq m(x^b) = m(x^o). \quad (13) $$

For convenience, $O_{b,o}^+$ will be used as an alias for the set $O_{N_b \times N_o}^+$. A cost matrix $\mathbf{C}_{bo} \in O_{b,o}^+$ is given. The optimisation problem will be formulated using discrete Kantorovich transference plans $\mathbf{P}^{bo} \in O_{b,o}^+$. The optimal discrete transference plan is given by the minimiser of the following optimisation problem:

$$ W_{C_{bo}}(\mathbf{x}^b, \mathbf{x}^o) \triangleq \min_{\mathbf{P}^{bo} \in \mathcal{U}_{bo}(\mathbf{x}^b, \mathbf{x}^o)} \mathrm{Tr}(\mathbf{C}_{bo}^\top \mathbf{P}^{bo}). \quad (14a) $$

Here, the trace sums up the costs attached to each path, and the set of admissible transference plans is defined by

$$ \mathcal{U}_{bo} \triangleq \{ \mathbf{P} \in O_{b,o}^{+} : \mathbf{P} \mathbf{1}_{o} = \mathbf{x}^{b}, \mathbf{P}^{\top} \mathbf{1}_{b} = \mathbf{x}^{o} \}, \quad (14b) $$

which selects the discrete transference plans with the proper marginals. $W_{C_{bo}}$ could be viewed as a discrete equivalent to the square of the Wasserstein distance $W_{C_{bo}}^2$ introduced in Eq. (5).
### 2.2.2 Entropic regularisation

The optimisation problem in Eq. (14) is a linear program that is convex (Peyré and Cuturi, 2019, and references therein). However, it is not generally strictly convex and, hence, does not necessarily exhibit a single minimum. Adding to the difficulty, its cost function (Eq. 14a) is constrained. Entropic regularisation addresses these issues and is used here to lift the constraints and to render the problem strictly convex. In particular, it will force any state vector that is a solution of the problem to be positive. A comprehensive justification is given by Peyré and Cuturi (2019). More precisely, we will use a Kullback-Leibler divergence (KL) regularisation term that is inserted in Eq. (14a),

$$ \mathrm{Tr}(\mathbf{C}_{\mathrm{bo}}^{\top}\mathbf{P}^{\mathrm{bo}}) \rightarrow \mathrm{Tr}(\mathbf{C}_{\mathrm{bo}}^{\top}\mathbf{P}^{\mathrm{bo}}) + \varepsilon\mathcal{K}(\mathbf{P}^{\mathrm{bo}}|\mathbf{v}^{\mathrm{bo}}), \quad (15) $$

which incorporates some prior transference plan $\mathbf{v}^{\mathrm{bo}}$ and does not require $m(\mathbf{P}^{\mathrm{bo}}) = 1$, whereas Peyré and Cuturi (2019) opted for a basic entropy term. The KL term (Boyd and Vandenberghe, 2004) is defined by

$$ \mathcal{K}(\mathbf{p}|\mathbf{q}) \triangleq \sum_{i} p_i \ln \frac{p_i}{q_i} - p_i + q_i. \quad (16) $$

It can be checked that the Hessian of the regularised cost function (Eq. 15) is a diagonal matrix of coefficients $\varepsilon/P_{ij}^{\mathrm{bo}} \ge \varepsilon$ because $0 \le P_{ij}^{\mathrm{bo}} \le 1$, making the problem $\varepsilon$-strongly convex. We choose, for example, $\mathbf{v}^{\mathrm{bo}} = \mathbf{x}^{\mathrm{b}}(\mathbf{x}^{\mathrm{o}})^{\top}/m$ and $\varepsilon > 0$, the latter of which is the regularisation scalar parameter. Note that this particular $\mathbf{v}^{\mathrm{bo}}$ is an admissible transference plan, i.e. it belongs to $\mathcal{U}_{\mathrm{bo}}$, and can be interpreted as a complete statistical decoupling of the transference plan with respect to the origin and target discrete measures. In the limit $\varepsilon \rightarrow 0^+$ of vanishing regularisation, the solution should not depend on the choice of $\mathbf{v}^{\mathrm{bo}}$. However, the convergence to the solution at finite $\varepsilon$ may depend on this choice. The primal cost function augmented with such an entropic regularisation is usually solved numerically with the iterative Sinkhorn algorithm (Sinkhorn, 1964). However, this is not the path followed in this paper, although we have used it as well.

Finally note that the technique to convexify such an optimisation problem with a KL term has been introduced in DA by Bocquet (2009) and Bocquet et al. (2011) following principles of statistical physics.

## 2.3 From classical data assimilation to hybrid optimal transport data assimilation

Figure 5 is a schematic representation of the flow of information in a classical DA update (and in particular 3D-Var), using the notation introduced above. In this case, the observables $\mathbf{x}^{\mathrm{b}}$ and $\mathbf{x}^{\mathrm{o}}$ and the analysis state $\mathbf{x}^{\mathrm{a}}$ are the same by construction; hence, $\mathbf{x}^{\mathrm{b}}$ and $\mathbf{x}^{\mathrm{o}}$ are not needed. This diagram, which could also be seen as a Bayesian network, corresponds

<figure><img src="image_8.png" /><figcaption>**Figure 5.** A diagrammatic representation of the classical 3D-Var update, with the observations $\mathbf{y}^{\mathrm{b}}$ (the first guess) and $\mathbf{y}^{\mathrm{o}}$ (the observation vector), the analysis state $\mathbf{x}^{\mathrm{a}}$, and the observed analysis $\mathbf{H}\mathbf{x}^{\mathrm{a}}$. A double-line arrow represents a deterministic map, whereas a single-line arrow represents a statistical binding between the origin and the target.</figcaption></figure>

to the cost function

$$ L_{\mathrm{cl}}(\mathbf{x}^{\mathrm{a}}) = \zeta_{\mathrm{b}}(\mathbf{y}^{\mathrm{b}} - \mathbf{x}^{\mathrm{a}}) + \zeta_{\mathrm{o}}(\mathbf{y}^{\mathrm{o}} - \mathbf{H}\mathbf{x}^{\mathrm{a}}) \quad (17) $$

to be minimised over $\mathbf{x}^{\mathrm{a}}$. Now let us make use of the observables $\mathbf{x}^{\mathrm{b}}$ and $\mathbf{x}^{\mathrm{o}}$ as new degrees of freedom but bind them by OTs to $\mathbf{x}^{\mathrm{a}}$, using the cost matrices $\mathbf{C}_{\mathrm{ba}}$ and $\mathbf{C}_{\mathrm{oa}}$, respectively.

This yields the diagram in Fig. 6, which corresponds to the cost function

$$ L_{\mathrm{w}}(\mathbf{x}^{\mathrm{a}}) = \min_{\mathbf{x}^{\mathrm{b}} \in \mathcal{O}_{N_{\mathrm{b}}}^{+}, \mathbf{x}^{\mathrm{o}} \in \mathcal{O}_{N_{\mathrm{o}}}^{+}} \left\{ \zeta_{\mathrm{b}}(\mathbf{y}^{\mathrm{b}} - \mathbf{x}^{\mathrm{b}}) + \zeta_{\mathrm{o}}(\mathbf{y}^{\mathrm{o}} - \mathbf{H}\mathbf{x}^{\mathrm{o}}) + W_{\mathrm{C}_{\mathrm{ba}}}(\mathbf{x}^{\mathrm{b}}, \mathbf{x}^{\mathrm{a}}) + W_{\mathrm{C}_{\mathrm{oa}}}(\mathbf{x}^{\mathrm{o}}, \mathbf{x}^{\mathrm{a}}) \right\}. \quad (18) $$

It must be minimised over $\mathbf{x}^{\mathrm{a}}$, yielding an analysis state $\mathbf{x}^{\mathrm{a}}$; this analysis state can also be seen as the W-barycentre between $\mathbf{x}^{\mathrm{b}}$ and $\mathbf{x}^{\mathrm{o}}$. Note that $\mathbf{x}^{\mathrm{b}}$ and $\mathbf{x}^{\mathrm{o}}$ are discrete measures of unknown mass. For the optimisation problem, they lie in $\mathcal{O}_{N_{\mathrm{b}}}^{+}$ and $\mathcal{O}_{N_{\mathrm{o}}}^{+}$, respectively.

Moving from Eq. (17) to Eq. (18) following the principles and guidance of the introductory Sect. 1.4 is empirical, although no more than in Ning et al. (2014) and Feyeux (2016). Showing the merits of this move from Eq. (17) to Eq. (18) is the goal of the present paper. As opposed to Feyeux et al. (2018), it can deal with sparse and noisy observations, i.e. non-trivial $\mathbf{H}$. We will show that classical DA is embedded in this generalisation. Moreover, the merits of the new cost function will be a posteriori qualitatively supported by the outcome of the numerical experiments (to the expert's eyes), which improve over previous formalism's outcomes. We would like to point out that we have also developed a consistent probabilistic and Bayesian formalism fully supporting the introduction of Eq. (18). However, we felt that the derivation was too long and technical for this paper and would not be helpful in the exploration of the direct consequences of Eq. (18).
<figure><img src="image_9.png" /><figcaption>**Figure 6.** A diagrammatic representation of the hybrid OTDA 3D-Var update, with the observations $\mathbf{y}^b$ (the first guess) and $\mathbf{y}^o$ (the observation vector); the observables $\mathbf{x}^b$ and $\mathbf{x}^o$; and $\mathbf{x}^a$, which is the W-barycentre. A double-line arrow represents a deterministic map, a single-line arrow represents a statistical binding between the origin and the target, and a wavy line represents the weaker bindings of $\mathbf{x}^b$ with $\mathbf{x}^a$ and $\mathbf{x}^o$ with $\mathbf{x}^a$ through OTs. This diagram can be seen as an unfolding of that in Fig. 5.</figcaption></figure>

We call Eq. (18) a high-level primal cost function because the metrics $W_{\text{Cba}}$ and $W_{\text{Coa}}$ have not yet been replaced by their transference plan expression, as opposed to, for example, Eq. (14a). Passing to a lower-level primal cost function would require expanding Eq. (18) using Eq. (14a) twice.

In the subsequent two subsections, we will investigate two pathways to solve the optimisation problem in Eq. (18). The first path (Sect. 2.4) unveils some of the key concepts behind its solution and partially disentangles the classical DA part from the W-barycentre part of the full analysis. This approach is enlightening but not necessarily practical. The second path is an alternative which is direct and robust but hides some of the fundamental principles underlying the solution. The busy reader could skip directly to the latter (i.e. Sect. 2.5).

## 2.4 Decomposition of the optimisation problem and effective cost metric

In this section, key ideas behind the minimisation of Eq. (18) are sketched and discussed. The level of mathematical rigour of this section is that of casual methodological DA in the geoscience literature. However, we stress that all of the algorithms discussed here have been successfully numerically tested on various configurations. The solution of Eq. (18) presented in this section is not necessarily robust, but it is enlightening and, hence, worth discussing.

Repeated contravariant indices – meaning the same tensor index is present as the upper and lower index – in tensor expressions will be understood as summed over, following Einstein's convention.

### 2.4.1 Dual formulation of the primal problem

One way, although not the only one, to write the explicit primal problem associated with Eq. (18) is through the use of a gluing transference plan $\mathbf{P}^{\text{boa}} \in \mathcal{O}_{\text{b,o,a}}^{+}$, where $\mathcal{O}_{\text{b,o,a}}^{+} = \mathbb{R}_{+}^{N_b N_o N_a}$ (see pp. 11–12 of Vilani, 2009). $\mathbf{P}^{\text{boa}} \in \mathcal{O}_{\text{b,o,a}}^{+}$ is a 3-tensor whose marginals are $\mathbf{x}^b$, $\mathbf{x}^o$, and $\mathbf{x}^a$ and that glues the transference plans $\mathbf{P}^{\text{ba}}$ between $\mathbf{x}^b$ and $\mathbf{x}^a$ and $\mathbf{P}^{\text{oa}}$ between $\mathbf{x}^o$ and $\mathbf{x}^a$:

$$ \mathcal{L} = \min_{\mathbf{x}^a \in \mathcal{O}_a^+} L_w(\mathbf{x}^a) \quad (19a) $$

$$ \begin{aligned} & = \min_{\mathbf{x}^b \in \mathcal{O}_b^+} \min_{\mathbf{x}^o \in \mathcal{O}_o^+} \min_{\mathbf{x}^a \in \mathcal{O}_a^+} \left[ \zeta_b(\mathbf{y}^b - \mathbf{x}^b) + \zeta_o(\mathbf{y}^o - \mathbf{H}\mathbf{x}^o) \right. \\ & \qquad \left. + \min_{\mathbf{P} \in \mathcal{U}_{\text{boa}}} \left\{ P_{ijk} C_{\text{ba}}^{ik} + P_{ijk} C_{\text{oa}}^{jk} \right\} \right]. \end{aligned} \quad (19b) $$

Here, the admissible set of (glued) transference plans, the set of all 3-tensors of non-negative entries whose marginals are $\mathbf{x}^b$, $\mathbf{x}^o$, and $\mathbf{x}^a$, is defined by

$$ \begin{aligned} \mathcal{U}_{\text{boa}}^{\Delta} = & \{ \mathbf{P} \in \mathcal{O}_{\text{b,o,a}}^{+} : \quad \forall i, P_{ijk} 1_{o}^{i} 1_{a}^{k} = x_{i}^{b}, \\ & \quad \forall j, P_{ijk} 1_{b}^{i} 1_{a}^{k} = x_{j}^{o}, \quad \forall k, P_{ijk} 1_{b}^{i} 1_{o}^{j} = x_{k}^{a} \}. \end{aligned} \quad (19c) $$

Due to the hardly scalable dimensionality of the primal problem, based on either a 3-tensor or a couple of 2-tensors, we wish to derive a dual problem equivalent to the primal one, using Lagrange multipliers to lift the constraints with (as will be checked later) a significantly smaller dimensionality.

This leads to a series of transformations of the problem $\mathcal{L}$, from a Lagrangian to a dual cost function, which is reported in Appendix A for the mathematically inclined reader. The outcome is a dual problem which reads

$$ \mathcal{L}^* = \max_{(f_b, f_o) \in \mathcal{U}_{\text{bo}}^*(\mathbf{C}_{\text{ba}}, \mathbf{C}_{\text{oa}}, \mathbf{H})} \left\{ f_b^\top \mathbf{y}^b + f_o^\top \mathbf{y}^o - \zeta_b^*(f_b) - \zeta_o^*(f_o) \right\}, \quad (20a) $$

where the * symbol refers to dual and where the polyhedron $\mathcal{U}_{\text{bo}}^*(\mathbf{C}_{\text{ba}}, \mathbf{C}_{\text{oa}}, \mathbf{H})$ is defined by

$$ \mathcal{U}_{\text{bo}}^*(\mathbf{C}_{\text{ba}}, \mathbf{C}_{\text{oa}}, \mathbf{H}) = \Delta \left\{ f_b \in \mathbb{R}^{N_b}, f_o \in \mathbb{R}^{N_o} : \forall i, j, k, \ f_b^i + f_o^l H_l^j \le C_{\text{ba}}^{ik} + C_{\text{oa}}^{jk} \right\}. \quad (20b) $$

In Eq. (20), the maps $\zeta_b^*$ and $\zeta_o^*$ are the Legendre–Fenchel transforms of the maps $\zeta_b$ and $\zeta_o$, respectively. Let us recall that the Legendre–Fenchel transform $f \mapsto \zeta^*(f)$ of the map $e \mapsto \zeta(e)$ is defined by $\zeta^*(f) = \sup_e \{f^\top e - \zeta(e)\}$. For instance, in the case of Gaussian error statistics (as in Eq. 12), these transforms are given by

$$ \zeta_b^*(f_b) = \frac{1}{2} \|f_b\|_{\mathbf{B}}^2, \quad \zeta_o^*(f_o) = \frac{1}{2} \|f_o\|_{\mathbf{R}}^2. \quad (21) $$

Note that, in this section, we do not add the entropic regularisation to the cost functions for the sake of conciseness and
because it does not play a role in the key ideas developed in this section; however, it would likely be added and employed in numerical applications.

## 2.4.2 Decomposition of the dual problem

These transformations allow us to trade the primal for the dual problem. Due to the fact that there are $N_a$ constraints indexed by $k \in [[1, N_a]]$ for each $f_b$ and $f_o$ pair in $U_{bo}^*$ and that the tightest of these constraints can account for the others, the problem in Eq. (20) should be equivalent to

$$ \mathcal{L}^* = \max_{(f_b, f_o) \in \mathcal{U}_{bo}^* (C_{bo}, \mathbf{H})} \left\{ f_b^\top \mathbf{y}^b + f_o^\top \mathbf{y}^o - \zeta_b^*(f_b) - \zeta_o^*(f_o) \right\}, \quad (22a) $$

where the polyhedron $U_{bo}^*(C_{bo}, \mathbf{H})$ is defined by

$$ U_{bo}^*(C_{bo}, \mathbf{H}) \triangleq \left\{ \begin{array}{l} f_b \in \mathbb{R}^{N_b}, \quad f_o \in \mathbb{R}^{N_o} : \\ \forall i, j, \quad f_b^i + f_o^l H_l^j \le C_{bo}^{ij} \end{array} \right\} \quad (22b) $$

and the effective cost metric $C_{bo}$ is given (in the absence of entropic regularisation) by

$$ [C_{bo}]_{ij} \triangleq \min_k \{[C_{ba}]_{ik} + [C_{oa}]_{jk}\}. \quad (22c) $$

According to Eq. (22c), this effective cost is given by the cost of the cheapest path(s), which is intuitive. The optimal transference glued plan, $\mathbf{P}$, can be connected to the optimal transference plan $\mathbf{P}^{bo}$ between $\mathbf{x}^b$ and $\mathbf{x}^o$ with the cost $C_{bo}$ in Eq. (22c), by marginalising on the intermediate density, i.e. the W-barycentre,

$$ P_{ij}^{bo} = P_{ijk} 1_a^k. \quad (23) $$

The solution for the analysis state $\mathbf{x}^a$ is given by

$$ x_k^a = P_{ijk} 1_b^i 1_o^j, \quad (24) $$

by the definition of the marginals of the gluing transference plan $\mathbf{P}$ (Eq. 19c). However, we do not have direct access to the optimal gluing $\mathbf{P}$ from the dual problem (Eq. 22). This will be made simpler later on when adding the entropic regularisation to the problem.

For now, let us find an alternative solution bypassing the need for the gluing $\mathbf{P}$ and define the map

$$ \begin{gathered} \kappa^{bo}: [[1, N_b]] \times [[1, N_o]] \mapsto \mathcal{P}([[1, N_a]]) \\ (i, j) \mapsto \kappa_{ij}^{bo} = \arg \min_k (C_{ba}^{ik} + C_{oa}^{jk}), \quad (25) \end{gathered} $$

where $\mathcal{P}(S)$ is defined as the set of all subsets of $S$. The set $\kappa_{ij}^{bo}$ lists all of the indices $k$ that are *relays* to the transport in between the sites corresponding to index $i$ and index $j$. That is why the W-barycentre can be obtained from $\mathbf{P}^{bo}$:

$$ x_k^a = P_{ijk} 1_b^i 1_o^j = \sum_{ij} P_{ij}^{bo} \delta_{k \in \kappa_{ij}^{bo}}. \quad (26) $$

In the next section, we will show how to estimate $\mathbf{P}^{bo}$ using entropic regularisation and, hence, leverage Eq. (26) to compute $\mathbf{x}^a$. $\kappa^{bo}$ is reminiscent of the so-called *McCann interpolant* in OT theory, as it is only related to the OT between $\mathbf{x}^b$ and $\mathbf{x}^o$, bypassing $\mathbf{x}^a$ and, hence, the transference plan $\mathbf{P}^{bo}$. Please refer to Remark 7.1 by Peyré and Cuturi (2019) and to Gangbo and McCann (1996) for a description of the McCann interpolant, even when there is no Monge map. This suggests that the analysis $\mathbf{x}^a$ is not an interpolation of $\mathbf{x}^b$ and $\mathbf{x}^o$ in the space of values, as for classical DA, but along a geodesic in a Riemannian space built on a metric derived from the Wasserstein distance.

Nonetheless, the above derivation shows that we can trade a W-barycentre problem characterised by a couple of OT problems for a single OT problem defined by an effective metric $C_{bo}$. This principle is schematically illustrated in Fig. 7.

This suggests a simpler two-step algorithm, where the steps consist of the following: (i) solving a hybrid OTDA problem but with a single OT problem under an effective cost metric, which yields the analysed observables $\mathbf{x}^b$ and $\mathbf{x}^o$, and (ii) computing the W-barycentre of $\mathbf{x}^b$ and $\mathbf{x}^o$. To avoid making an overly large detour, the derivation of this algorithm is presented in Appendix B.

## 2.4.3 Classical data assimilation as a particular case

The primal problem (Eq. 17) of classical DA reads as follows:

$$ \mathcal{L}_{cl} = \min_{\mathbf{x}^a \in \mathcal{O}_{N_a}^+} \left\{ \zeta_b(\mathbf{y}^b - \mathbf{x}^a) + \zeta_o(\mathbf{y}^o - \mathbf{H}\mathbf{x}^a) \right\}. \quad (27) $$

Let us see how the OTDA formalism in Eq. (22) can account for classical DA. In the context of classical DA, the observable spaces for $\mathbf{x}^b$, $\mathbf{x}^o$, and $\mathbf{x}^a$ are assumed to be the same by construction. Let us then define the cost matrices

$$ [C_{ba}^{\infty}]_{ij} \triangleq [C_{oa}^{\infty}]_{ij} \triangleq \begin{cases} 0 & \text{if } i = j \\ +\infty & \text{if } i \neq j \end{cases}; \quad (28) $$

i.e. it is assumed that the cost of moving masses is as large as it can be. Looking back at Eq. (19) but with these costs, it is clear that, in order to avoid the primal cost function being $+\infty$, the transference plan $P_{ijk}$ must always be 0 unless $i = j = k$. However, this implies, from the definition of $U_{bo}$, that the observables coincide, $\mathbf{x}^b = \mathbf{x}^o = \mathbf{x}^a$, and that their mass is given by $m(\mathbf{P})$. In this limit where the specific cost matrices are equal to $C_{ba}^{\infty}$ and $C_{oa}^{\infty}$, the OTDA primal problem become mathematically equivalent to classical DA. Hence, classical DA is a limit case of OTDA. Note that, from its definition (Eq. 22c), the effective cost $C_{bo}$ obtained from $C_{ba}^{\infty}$ and $C_{oa}^{\infty}$ coincides with $C_{bo}^{\infty} \triangleq C_{ba}^{\infty} = C_{oa}^{\infty}$.

## 2.5 A direct algorithmic solution

The two-step approach of Sect. 2.4 has merit in that it connects to the traditional W-barycentre problem, by first esti-
<figure><img src="image_10.png" /><figcaption>**Figure 7.** Trading a full hybrid OTDA problem, characterised by a W-barycentre defined by the cost metrics $C_{ba}$ and $C_{oa}$, with a simplified hybrid OTDA problem, characterised by a single OT problem defined by an effective cost metric $C_{bo}$.</figcaption></figure>

mating $\mathbf{x}^b$ and $\mathbf{x}^o$, and later computes the W-barycentre in between both states. It also suggests the existence of the effective cost metric of the problem. However, going through its consecutive steps may not be necessary for pure computational purposes. Here, we describe a direct approach that yields the analysis of the OTDA problem. It is less enlightening, but it is practical and will be used in the subsequent illustrations of the present paper.

An alternative formulation to the primal problem in Eq. (19) relies on two transference plans $\mathbf{P}^{ba}$ and $\mathbf{P}^{oa}$ corresponding to the two transports of the underlying W-barycentre problem, instead of the gluing one. Moreover, entropic regularisation is now enforced via $\mathcal{K}(\mathbf{P}^{ba}|\mathbf{v}^{ba})$ and $\mathcal{K}(\mathbf{P}^{oa}|\mathbf{v}^{oa})$. The corresponding optimisation problem reads as follows:

$$ \mathcal{L} = \min_{\mathbf{x}^b \in \mathcal{O}_b^+} \min_{\mathbf{x}^o \in \mathcal{O}_o^+} \min_{\mathbf{x}^a \in \mathcal{O}_a^+} \left[ \begin{aligned} & \zeta_b(\mathbf{y}^b - \mathbf{x}^b) + \zeta_o(\mathbf{y}^o - \mathbf{H}\mathbf{x}^o) \\ & + \min_{\mathbf{P}^{ba} \in \mathcal{U}_{ba}} \min_{\mathbf{P}^{oa} \in \mathcal{U}_{oa}} \left\{ \begin{aligned} & \varepsilon\mathcal{K}(\mathbf{P}^{ba}|\mathbf{v}^{ba}) + \varepsilon\mathcal{K}(\mathbf{P}^{oa}|\mathbf{v}^{oa}) \\ & + P_{ik}^{ba}C_{ba}^{ik} + P_{jk}^{oa}C_{oa}^{jk} \end{aligned} \right\} \end{aligned} \right] \quad (29a) $$

where the admissible sets of the respective transference plans $\mathbf{P}^{ba}$ and $\mathbf{P}^{oa}$ are defined by

$$ \mathcal{U}_{ba} \triangleq \left\{ \mathbf{P} \in \mathcal{O}_{b,a}^{+} : \mathbf{P1}_{a} = \mathbf{x}^{b}, \mathbf{P}^{\top}\mathbf{1}_{b} = \mathbf{x}^{a} \right\}, \quad (29b) $$

$$ \mathcal{U}_{oa} \triangleq \left\{ \mathbf{P} \in \mathcal{O}_{o,a}^{+} : \mathbf{P1}_{a} = \mathbf{x}^{o}, \mathbf{P}^{\top}\mathbf{1}_{b} = \mathbf{x}^{a} \right\}. \quad (29c) $$

Following the same type of derivation as reported in the previous sections and Appendix B, the corresponding dual problem to be minimised is obtained as follows:

$$ \mathcal{J}_{\varepsilon}^{*} = \min_{f_b \in \mathbb{R}^{\mathcal{N}_b}, f_o \in \mathbb{R}^{\mathcal{N}_o}, f_a \in \mathbb{R}^{\mathcal{N}_a}} J_{\varepsilon}^{*}(f_b, f_o, f_a). \quad (30a) $$

Here, discarding the constant $-\varepsilon m(\mathbf{v}^{ba}) - \varepsilon m(\mathbf{v}^{oa})$, the associated regularised Lagrangian is

$$ J_{\varepsilon}^{*}(f_b, f_o, f_a) = \varepsilon Z_{\varepsilon}^{ba}(f_b, f_a) + \varepsilon Z_{\varepsilon}^{oa}(f_o, f_a) \\ + \zeta_{b}^{*}(f_b) + \zeta_{o}^{*}(f_o) - f_{b}^{\top}\mathbf{y}^{b} - f_{o}^{\top}\mathbf{y}^{o}, \quad (30b) $$

with a partition function associated with each transport:

$$ Z_{\varepsilon}^{ba} \triangleq \sum_{ik} P_{ik}^{ba}, \quad (30c) $$

$$ Z_{\varepsilon}^{oa} \triangleq \sum_{jk} P_{jk}^{oa}, \quad (30d) $$

where

$$ P_{ik}^{ba} = \nu_{ik}^{ba} e^{(f_b^i + f_a^k - C_{ba}^{ik})/\varepsilon}, \quad (30e) $$

$$ P_{jk}^{oa} = \nu_{jk}^{oa} e^{(f_o^i H_l^j - f_a^k - C_{oa}^{jk})/\varepsilon}, \quad (30f) $$

It turns out that the optimal $f_a$ can be obtained analytically as a function of $f_b$ and $f_o$, which we checked makes the optimisation numerically more efficient and robust. Indeed, let us introduce $\psi_k \triangleq e^{f_a^k/\varepsilon}$. We could optimise $J_{\varepsilon}^{*}(f_b, f_o, f_a = \varepsilon \ln \psi)$ on $\psi$:

$$ 0 = \partial_{\psi_k} J_{\varepsilon}^{*}(f_b, f_o, f_a) \quad (31a) $$

$$ = \sum_{i} \nu_{ik}^{ba} e^{(f_b^i - C_{ba}^{ik})/\varepsilon} - \frac{1}{\psi_k^2} \sum_{j} \nu_{jk}^{oa} e^{(f_o^i H_l^j - C_{oa}^{jk})/\varepsilon}, \quad (31b) $$

yielding the solution

$$ \psi_k^2 = \frac{Z_{\varepsilon,k}^{oa}}{Z_{\varepsilon,k}^{ba}}, \quad (32a) $$

$$ Z_{\varepsilon,k}^{oa} \triangleq \sum_{j} \nu_{jk}^{oa} e^{(f_b^i H_l^j - C_{oa}^{jk})/\varepsilon}, \quad (32b) $$

$$ Z_{\varepsilon,k}^{ba} \triangleq \sum_{i} \nu_{ik}^{ba} e^{(f_b^i - C_{ba}^{ik})/\varepsilon}. \quad (32c) $$

Up to irrelevant constants, the resulting effective cost function using the optimal $\psi_k$ is

$$ J_{\varepsilon}^{*}(f_b, f_o) = 2\varepsilon \sum_k \sqrt{Z_{\varepsilon,k}^{ba} Z_{\varepsilon,k}^{oa} + \zeta_{b}^{*}(f_b) + \zeta_{o}^{*}(f_o)} \\ - f_{b}^{\top}\mathbf{y}^{b} - f_{o}^{\top}\mathbf{y}^{o}. \quad (33) $$

Now, the optimal W-barycentre $\mathbf{x}^a$ is given by either $x_k^a = P_{ik}^{ba} 1_b^i$ or $x_k^a = P_{jk}^{oa} 1_o^j$, i.e.

$$ x_k^a = \psi_k Z_{\varepsilon,k}^{ba} = \frac{1}{\psi_k} Z_{\varepsilon,k}^{oa}, \quad (34) $$
from which we can infer the $\psi_k$-free expression

$$x_k^a = \sqrt{Z_{\varepsilon,k}^{\text{ba}} Z_{\varepsilon,k}^{\text{oa}}} \quad (35)$$

It is also useful to retrieve the optimal value of $f_a$ and obtain

$$f_a^k = \varepsilon \ln \psi_k = \frac{\varepsilon}{2} \ln \left( \frac{Z_{\varepsilon,k}^{\text{oa}}}{Z_{\varepsilon,k}^{\text{ba}}} \right), \quad (36)$$

so that we can compute the other two analysed observables, $\mathbf{x}^b$ and $\mathbf{x}^o$, using

$$\begin{aligned} x_i^b &= P_{ik}^{\text{ba}} 1_i^k = \sum_k \psi_k v_{ik}^{\text{ba}} e^{(f_b^i - C_{\text{ba}}^{ik})/\varepsilon} \\ &= e^{f_b^i/\varepsilon} \sum_k v_{ik}^{\text{ba}} e^{(f_a^k - C_{\text{ba}}^{ik})/\varepsilon}, \end{aligned} \quad (37a)$$

$$\begin{aligned} x_j^o &= P_{jk}^{\text{oa}} 1_j^k = \sum_k \frac{1}{\psi_k} v_{jk}^{\text{oa}} e^{(f_o^l H_l^j - C_{\text{oa}}^{jk})/\varepsilon} \\ &= e^{(f_o^l H_l^j)/\varepsilon} \sum_k v_{jk}^{\text{oa}} e^{(-f_a^k - C_{\text{oa}}^{jk})/\varepsilon}. \end{aligned} \quad (37b)$$

Note that most of these expressions can be assessed in a robust way in the log domain. For instance, in practice, we use, equivalently to Eqs. (35) and (37),

$$\begin{aligned} \varepsilon \ln x_k^a &= \frac{\varepsilon}{2} \ln \sum_i v_{ik}^{\text{ba}} e^{(f_b^i - C_{\text{ba}}^{ik})/\varepsilon} \\ &\quad + \frac{\varepsilon}{2} \ln \sum_j v_{jk}^{\text{oa}} e^{(f_o^l H_l^j - C_{\text{oa}}^{jk})/\varepsilon}, \end{aligned} \quad (38a)$$

$$\varepsilon \ln x_i^b = f_b^i + \varepsilon \ln \sum_k v_{ik}^{\text{ba}} e^{(f_a^k - C_{\text{ba}}^{ik})/\varepsilon}, \quad (38b)$$

$$\varepsilon \ln x_j^o = f_o^l H_l^j + \varepsilon \ln \sum_k v_{jk}^{\text{oa}} e^{(-f_a^k - C_{\text{oa}}^{jk})/\varepsilon}. \quad (38c)$$

# 3 Numerical illustrations

In this section, we showcase a selection of OTDA 3D-Var analyses. These are meant to stress the versatility of the formalism and the diverse solutions it offers, with significantly more degrees of freedom than in classical DA. The OTDA state analysis is carried out using the process in Sect. 2.5 and its formulas. Unless specifically discussed, entropic regularisation is used with $\varepsilon = 10^{-3}$. The dual cost function in Eq. (33) is minimised using the quasi-Newton method L-BFGS-B (Liu and Nocedal, 1989), which yields the optimal $f_b$ and $f_o$. Then, Eq. (38) is employed to compute $\mathbf{x}^b$, $\mathbf{x}^o$, and $\mathbf{x}^a$.

## 3.1 One-dimensional examples

Considering the case in which the physical space of the fields is one-dimensional, we build bell-shaped observations $\mathbf{y}^b$

and $\mathbf{y}^o$, related to an observable space of size $N_b = N_o = N_a = 10^2$ shared by $\mathbf{x}^b$, $\mathbf{x}^o$, and $\mathbf{x}^a$. As $\mathbf{y}^b$ is a fully observed instance of $\mathbf{x}^b$, we have $\mathcal{N}_b = N_b = 10^2$, while $\mathcal{N}_o$ may differ from $N_o$ depending on the definition of the observation operator $\mathbf{H}$. We choose (Gaussian statistics)

$$\zeta_b(\mathbf{e}_b) = \frac{1}{2\sigma_b^2} \|\mathbf{e}_b\|^2, \quad \zeta_b(\mathbf{e}_o) = \frac{1}{2\sigma_o^2} \|\mathbf{e}_o\|^2. \quad (39)$$

Here, $\sigma_b = \sigma_o = 10^{-2}$. The states are discretised over the interval $[0, 1]$ at sites grid cells $r_i^* = (i - 1/2)/N_*$ for $i \in [[1, N_*]]$, with $\star = b, o$, and a. Unless otherwise specified, the cost metric has a quadratic dependence on the distance between sites, i.e. $[\mathbf{C}_{ba}]_{ik} = |r_i^b - r_k^b|^2$ and $[\mathbf{C}_{oa}]_{jk} = |r_j^o - r_k^o|^2$. This is our reference set-up. The observation operator and the mass of the observations $\mathbf{y}^b$ and $\mathbf{y}^o$ will be specified for each experiment.

We consider four experiments in which we choose to vary key parameters in the OTDA set-up.

### 3.1.1 Varying the imbalance of the observation states

In the first experiment, the system is fully observed with $\mathbf{H} = \mathbf{I}$. We choose $m(\mathbf{y}^b) = 1$ and the mass of $\mathbf{y}^o$ to be in the set $m(\mathbf{y}^o) \in \{0.5, 1, 1.5\}$, with all the other parameters being fixed to the reference. The results are displayed in Fig. 8. Figure 8a corresponds to the case $m(\mathbf{y}^o) = 0.5$. The resulting mass of the analysed observables is then $m(\mathbf{x}^a) = m(\mathbf{x}^b) = m(\mathbf{x}^o) = 0.79$. The adjustment of $\mathbf{x}^b$ compared with $\mathbf{y}^b$ and the adjustment of $\mathbf{x}^o$ compared with $\mathbf{y}^o$, which are required to balance $\mathbf{x}^b$ and $\mathbf{x}^o$, are patent. Figure 8b corresponds to the case $m(\mathbf{y}^o) = 1$. The resulting mass of the analysed observables is then $m(\mathbf{x}^a) = m(\mathbf{x}^b) = m(\mathbf{x}^o) = 1$. No adjustment is required here because $m(\mathbf{y}^o) = m(\mathbf{y}^b)$, and $\mathbf{x}^o$ and $\mathbf{y}^o$ as well as $\mathbf{x}^b$ and $\mathbf{y}^b$ coincide. Finally, the mass of $\mathbf{y}^o$ is set to $m(\mathbf{y}^o) = 1.5$ in Fig. 8c. The resulting mass of the analysed observables is then $m(\mathbf{x}^a) = m(\mathbf{x}^b) = m(\mathbf{x}^o) = 1.34$. The adjustment of $\mathbf{x}^b$ compared with $\mathbf{y}^b$ and the adjustment of $\mathbf{x}^o$ compared with $\mathbf{y}^o$, which are required to balance $\mathbf{x}^b$ and $\mathbf{x}^o$, are visually obvious, but the balancing goes in the opposite direction compared with Fig. 8a, as expected.

### 3.1.2 Varying the sparseness of the observation operator

In this second experiment, with all of the other parameters being fixed to their reference value, only a fraction of the domain is observed, over $[0, 1/4]$, $[0, 1/2]$, and $[0, 3/4]$, where $\mathbf{H} \in \mathcal{O}_{N_o \times N_o}^+$, with $N_o = N_o/4$, $N_o/2$, $3N_o/4$, and $H_l^j = \delta_{l,j}$ for $l \in [[1, N_o]]$ and $j \in [[1, N_o]]$.

The masses of the states that are built to generate $\mathbf{y}^b$ and $\mathbf{y}^o$, before applying any observation operator, are set to 1 and 1.5, respectively. As a result, we have $m(\mathbf{y}^b) = 1$, but $m(\mathbf{y}^o)$ may depart from 1.5 depending on $\mathbf{H}$. The fully observed case corresponds to Fig. 8c. The results are displayed
<figure><img src="image_11.png" /><figcaption>**Figure 8.** A hybrid OTDA 3D-Var analysis with one-dimensional physical states, where only the mass of $y^o$ is varied. Its mass is $m(y^o) = 0.5$ in panel (a), $m(y^o) = 1$ in panel (b), and $m(y^o) = 1.5$ in panel (c). The dashed blue curve corresponds to the first guess $y^b$; the red dots correspond to the observations $y^o$; the analysis state $x^a$ is the solid green curve; and the analysed observables $x^b$ and $x^o$ are blue and red dotted curves, respectively. The support of the observation is underlined by a wavy grey segment. The corresponding classical analysis is also plotted with a dot-dash orange curve. The $x$ axis corresponds to the position in space; the $y$ axis corresponds to the concentration value of the fields.</figcaption></figure>

in Fig. 9. It shows how smooth the OTDA solution can be compared with that of classical DA. However, as in Fig. 9a, OTDA can also handle obviously diverging sources of information, as is the case when the support of $\mathbf{H}$ is $[0, \frac{1}{4}]$ and when $y^o$ and $y^b$ can be seen to be barely consistent. In that case, the OTDA solution is smooth but bimodal.

### 3.1.3 Changing the nature of the cost metric

In this third experiment, we choose the cost metric to be of the form $[\mathbf{C}_{\text{ba}}]_{ik} = |r_i^b - r_k^a|^\alpha$ and $[\mathbf{C}_{\text{oa}}]_{jk} = |r_j^o - r_k^a|^\alpha$. Only half of the domain is observed over $[0, \frac{1}{2}]$, as in the case of Fig. 9b. As the mass of the state used to produce $y^o$ is 1.5, we have a slightly different $m(y^o) = 1.49$, with the rest of the mass being located in the unobserved part of the domain. All of the other parameters follow the reference set-up. The results are displayed in Fig. 10. For Fig. 10a, $\alpha$ is set to 0.5. For Fig. 10b, $\alpha$ is set to 1. For Fig. 10c, the cost metric is piecewise; it is quadratic, i.e. $\alpha = 2$, for pairs of sites separated by less than $10^{-1}$, i.e. $|r_i^b - r_k^a| = |r_j^o - r_k^a| \le 10^{-1}$, whereas the costs are chosen to be infinite for pairs of sites beyond this range. Hence, transport is prohibited beyond a distance of $10^{-1}$. The case of a pure quadratic cost corresponds to Fig. 9b. The impact on the shape of the OTDA analysis is very significant and suggests that one could easily tailor their own cost to suit their specific DA problem.

### 3.1.4 Classical data assimilation as a sub-case of the hybrid optimal transport data assimilation

In the fourth experiment, we would like to numerically check the theoretical prediction of Sect. 2.4.3. Consider again the reference configuration; however, only half of the domain,

over $[0, \frac{1}{2}]$, is observed, $\mathbf{H} \in \mathcal{O}_{\mathcal{N}_o \times \mathcal{N}_o}^+$ with $\mathcal{N}_o = N_o/2$ and $H_l^j = \delta_{l,j}$ for $l \in [[1, \mathcal{N}_o]]$ and $j \in [[1, N_o]]$. Most importantly, the cost metric has a quadratic dependence on the distance between sites, i.e. $[\mathbf{C}_{\text{ba}}]_{ik} = \lambda|r_i^b - r_k^a|^2$ and $[\mathbf{C}_{\text{oa}}]_{jk} = \lambda|r_j^o - r_k^a|^2$. The case $\lambda = 1$ corresponds to Fig. 9b. Figure 11 shows the results corresponding to $\lambda = 10^3$ for panel (a), $\lambda = 10^4$ for panel (b), and $\lambda = 10^6$ for panel (c). When $\lambda$ is increased, the OTDA analysis should tend to the classical DA solution. This is indeed corroborated by Fig. 11 and supports the claim of Sect. 2.4.3. Note that, as opposed to the three earlier experiments, we had to tune $\varepsilon$ here, as the wide range of $\lambda$ has a significant impact on the balance of the key terms of the cost function (transport cost, discrepancy errors, and regularisation).

## 3.2 Two-dimensional examples

Considering the case in which the physical space of the fields is two-dimensional, we perform a couple of 3D-Var analyses on concentration fields (puffs of a pollutant). The states are discretised in the domain $[0, 1]^2$ at sites grid cells $\mathbf{r}_{i,j}^* = ((i - \frac{1}{2})/N_*^x, (j - \frac{1}{2})/N_*^y)$ for $(i, j) \in [[1, N_*^x]] \times [[1, N_*^y]]$, with $\star = b, o$, and a. We choose $N_b^x = N_b^y = N_o^x = N_o^y = N_a^x = N_a^y = 10^2$, such that $N_b = N_o = N_a = 10^4$. Hence, the number of control variables is $3 \times 10^4$. The observation vectors are $\mathbf{y}^b$ and $\mathbf{y}^o$. As $\mathbf{y}^b$ is a fully observed instance of $\mathbf{x}^b$, we have $\mathcal{N}_b = N_b$, while $\mathcal{N}_o$ may differ from $N_o$ depending on the definition of the observation operator $\mathbf{H}$. Moreover, we choose (Gaussian statistics)

$$ \zeta_b(\mathbf{e}_b) = \frac{1}{2\sigma_b^2} \|\mathbf{e}_b\|^2, \quad \zeta_b(\mathbf{e}_o) = \frac{1}{2\sigma_o^2} \|\mathbf{e}_o\|^2. \quad (40) $$
<figure><img src="image_12.png" /><figcaption>**Figure 9.** A hybrid OTDA 3D-Var analysis with one-dimensional physical states, where the observation operator is increasingly sparse. The support of **H** is $[0, 1/4]$ for panel (a), $[0, 1/2]$ for panel (b), and $[0, 3/4]$ for panel (c). See Fig. 8 for a description of the legend.</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>**Figure 10.** A hybrid OTDA 3D-Var analysis with one-dimensional physical states, where the cost metrics are changed. See the bulk of the text for a definition of the three cost metrics. See Fig. 8 for a description of the legend.</figcaption></figure>

Here, $\sigma_b = \sigma_o = 10^{-2}$. The entropic regularisation parameter is set to $\varepsilon = 10^{-3}$.

The first analysis is displayed in Fig. 12. The observation operator **H** is the identity, but its support is restricted to the subdomain $[0, 0.6]^2$. The plumes of pollutants $\mathbf{y}^b$ and $\mathbf{y}^o$ are generated from states formed as combinations of bell-like puffs. The system is unbalanced with $m(\mathbf{y}^b) = 1.35$ and $m(\mathbf{y}^o) = 0.73$. The cost metric has a quadratic dependence on the distance between sites, i.e. $[C_{ba}]_{ik} = \|\mathbf{r}_i^b - \mathbf{r}_k^a\|_2^2$ and $[C_{oa}]_{jk} = \|\mathbf{r}_j^o - \mathbf{r}_k^a\|_2^2$. The OTDA analysis is clearly smoother than the classical solution. The classical solution does not cope very well with the seemingly disagreeing sources of information $\mathbf{y}^b$ and $\mathbf{y}^o$, generating sharp transitions in the classical analysis. If $\mathbf{y}^b$ and $\mathbf{y}^o$ were consistently obtained from a truth perturbed with errors with short-range correlation, i.e. if they were drawn from the true prior distribution and in the absence of mislocation errors, then the classical analysis would be as good as it can be, whereas the OTDA solution may be too safe, i.e. too smooth. However, if one believes that structural errors and, in particular, loca-

tion errors can impact $\mathbf{y}^b$ and $\mathbf{y}^o$, then the classical solution is improper and the OTDA analysis preferable.

The second analysis is displayed in Fig. 13. The support of the observation operator **H** is again contained within the subdomain $[0, 0.6]^2$, but only one of four grid cells is actually observed in this area. The observation states $\mathbf{y}^b$ and $\mathbf{y}^o$ are generated from the same states as for Fig. 12. The system is unbalanced with $m(\mathbf{y}^b) = 1.35$ and $m(\mathbf{y}^o) = 0.18$. The cost metric is defined to be the same as in Fig. 12. The OTDA analysis is even smoother in this case compared with the classical DA analysis. It is much less impacted by the sparseness of the observation operator. The classical solution has to account for the staggered observations in the top left corner of the domain because the first guess in that region is very uncertain. By contrast, the OTDA solution assumes that location errors are possible; hence, it moves around the mass corresponding to these observations so that the structure of the observation operator is not as impactful on the analysis.
<figure><img src="image_14.png" /><figcaption>Figure 11. Scaling up the cost metrics $\lambda C_{ba}$ and $\lambda C_{oa}$ with increasing $\lambda$, the OTDA analysis converges to the classical DA analysis. Panels (a), (b), and (c) correspond to the scaling values $\lambda = 10^3, 10^4$, and $10^6$, respectively. See Fig. 8 for a description of the legend.</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>Figure 12. Two-dimensional concentration maps (plumes) of a hybrid OTDA analysis for the first configuration. The observations $y^b$ and $y^o$; the analysed observables $x^b$ and $x^a$, i.e. the state analysis; $x^o$; and the corresponding classical DA analysis $x_{cl}^a$ are displayed. All fields are rescaled so that their joint maximum is 1. All concentration maps use the same scale. The colour bar represents a unified contrast scale for the diverse field concentrations.</figcaption></figure>

# 4 Uncertainty quantification

In this section, we compute the posterior error covariance matrix $P^a$ associated with the state analysis $x^a$, in order to complete the OTDA 3D-Var analysis description. There are many ways to proceed depending on the chosen regularization and on the targeted degree of generality. Here, for the sake of consistency, we report on the way to derive $P^a$ following the computation of the analysis state $x^a$ proposed in Sect. 2.5.

## 4.1 Mathematical results

Let us denote the compounded vectors of the observations, of the Lagrange multipliers, and of the observables as well

as the compounded observation operator by

$$ 
\begin{aligned}
y &\triangleq \begin{bmatrix} y^b \\ y^o \end{bmatrix}, & f &\triangleq \begin{bmatrix} f_b \\ f_o \end{bmatrix}, \\
x &\triangleq \begin{bmatrix} x^b \\ x^o \end{bmatrix}, & \mathcal{H} &\triangleq \begin{bmatrix} \mathbf{I}_b & \mathbf{0} \\ \mathbf{0} & \mathbf{H} \end{bmatrix},
\end{aligned} 
\quad (41) $$

of size $N_b + N_o$, $N_b + N_o$, $N_b + N_o$, and $(N_b + N_o) \times (N_b + N_o)$, respectively. Similarly, we define the sum of the error statistics by $\zeta(f) \triangleq \zeta_b(f_b) + \zeta_o(f_o)$, whose Legendre-Fenchel transform is $\zeta^*(f) = \zeta_b^*(f_b) + \zeta_o^*(f_o)$. Using this notation, we can recapitulate the key results of Sect. 2.5: the effective dual cost function is
<figure><img src="image_16.png" /><figcaption>Figure 13. Two-dimensional concentrations maps of a hybrid OTDA analysis for the second configuration. The observations $y^b$ and $y^o$; the analysed observables $x^b$ and $x^a$, i.e. the state analysis; $x^o$; and the corresponding classical DA analysis are displayed. Compared to Fig. 12, only **H** has changed. The level sets in panels (c) and (f) are omitted because they are driven by the staggered observation operator.</figcaption></figure>

$$J_{\varepsilon}^{*}(f) \triangleq \varepsilon Z_{\varepsilon}(f) + \zeta^{*}(f) - f^{\top} y, \qquad (42a)$$

$$Z_{\varepsilon}(f) \triangleq 2 \sum_{k} \sqrt{Z_{\varepsilon,k}^{\text{ba}}(f_{\text{b}}) Z_{\varepsilon,k}^{\text{oa}}(f_{\text{o}})}. \qquad (42b)$$

Here, the analysis state reads

$$x_k^a(f) = \sqrt{Z_{\varepsilon,k}^{\text{ba}}(f_b) Z_{\varepsilon,k}^{\text{oa}}(f_o)}, \qquad (43)$$

where the dependence of the analysis state and the partition functions on $f$, $f_b$, and $f_o$ is now emphasised and made explicit.

Any prior source of error in the system stems from the information vector $y$ and hence drives the posterior error in the analysis $x^a$. That is why we are interested in the sensitivity of $x^a$ with respect to $y$, i.e. $\delta x^a = \partial_y x^a \delta y$. Denoting the expectation operator by $\mathbb{E}$, the error covariance matrix is then defined by

$$\mathbf{P}^a = \mathbb{E} \left[ \delta \mathbf{x}^a (\delta \mathbf{x}^a)^{\top} \right], \qquad (44a)$$

$$= (\partial_y \mathbf{x}^a) \mathbb{E} \left[ \delta y \delta y^\top \right] (\partial_y \mathbf{x}^a)^{\top}, \qquad (44b)$$

$$= (\partial_y \mathbf{x}^a) (\partial_f^2 \zeta^*) (\partial_y \mathbf{x}^a)^{\top}, \qquad (44c)$$

from which a matrix factor $X^a$ of $P^a$, i.e. which satisfies $P^a = X^a(X^a)^{\top}$ and whose expressions are usually much shorter than those of $P^a$, can be extracted, up to the multiplication by an orthogonal matrix on the right:

$$X^a = \partial_y \mathbf{x}^a (\partial_f^2 \zeta^*)^{\frac{1}{2}}. \qquad (45)$$

To compute the sensitivity matrix $\partial_y x^a$, we leverage the stationarity of the dual cost function at the minimum:

$$\partial_f J_{\varepsilon}^{*}(f(y), y) = 0. \qquad (46)$$

We resort to the implicit function theorem:

$$0 = d_y \partial_f J_{\varepsilon}^{*}(f(y), y) = \partial_f^2 J_{\varepsilon}^{*} \partial_y f + \partial_f \partial_y J_{\varepsilon}^{*}, \qquad (47)$$

which yields

$$\partial_y f = - \left[ \partial_f^2 J_{\varepsilon}^{*} \right]^{-1} \partial_f \partial_y J_{\varepsilon}^{*} = \left[ \partial_f^2 J_{\varepsilon}^{*} \right]^{-1}, \qquad (48)$$

as $\partial_f \partial_y J_{\varepsilon}^{*} = -I_{bo}$, where $I_{bo}$ is the identity matrix in the compounded observation space $\mathbb{R}^{\mathcal{N}_b+\mathcal{N}_o}$. The sensitivity $\partial_y x^a$ can now be computed using the Leibniz chain rule and Eq. (48):

$$\frac{\partial x^a}{\partial y} = \frac{\partial x^a}{\partial f} \frac{\partial f}{\partial y} = \partial_f x^a \left[ \partial_f^2 J_{\varepsilon}^{*} \right]^{-1}. \qquad (49)$$

Let us now compute the Jacobian and Hessian in the right-hand side of Eq. (49). To that end and in order to externalise the observation operator, we introduce $\hat{Z}_{\varepsilon}$ and $\hat{x}_a$, such that

$$\hat{Z}_{\varepsilon}(\eta = \mathcal{H}^{\top} f) \triangleq Z_{\varepsilon}(f), \quad \hat{x}_a(\eta = \mathcal{H}^{\top} f) \triangleq x^a(f), \qquad (50)$$

and the related Jacobian and Hessians,

$$\Omega_{\text{bo},a} \triangleq \partial_{\eta} \hat{x}_{a}, \qquad (51a)$$

$$\Omega_{\text{bo,bo}} \triangleq \varepsilon \partial_{\eta}^2 \hat{Z}_{\varepsilon}, \qquad (51b)$$

$$\Lambda_{\text{bo,bo}} \triangleq \partial_f^2 \zeta^*. \qquad (51c)$$

$\hat{Z}_{\varepsilon}$ and $\hat{x}_a$ can be shown to exist; they can be read off from the explicit expressions of $Z_{\varepsilon}$ and $x^a$ as functions of $f$.
These Jacobian and Hessians depend on the choice of the regularisation operator and need to be computed analytically, which is simple but tedious; this is not reported here, as it is a regularisation-dependent calculation. The Hessian of the dual cost function Eq. (42a) can then be written as the sum

$$ \partial_f^2 J_{\varepsilon}^* = \Lambda_{bo,bo} + \mathcal{H} \Omega_{bo,bo} \mathcal{H}^{\top}, \quad (52) $$

while the sensitivity matrix now reads

$$ \partial_f x^a = \Omega_{bo,a}^{\top} \mathcal{H}^{\top}. \quad (53) $$

Note that $\Omega_{bo,bo}$ can be interpreted as the covariance matrix of $x$, the compounded observable vector as defined in Eq. (41) (although seen as a random vector), under the assumption that $x^b$ and $x^o$ are connected via the W-barycentre $x^a$ and the optimal transference plans $P^{ba}$ and $P^{oa}$ (all seen as random vectors). Combining Eqs. (52) and (53) with Eq. (45), we finally obtain the expression for a factor $X^a$ of $P^a$:

$$ X^a = \Omega_{bo,a}^{\top} \mathcal{H}^{\top} \left[ \Lambda_{bo,bo} + \mathcal{H} \Omega_{bo,bo} \mathcal{H}^{\top} \right]^{-1} \Lambda_{bo,bo}^{\frac{1}{2}}. \quad (54) $$

Alternatively, we can use the Sherman-Morrison-Woodbury transformation, under the assumption that $\Omega_{bo,bo}$ is invertible:

$$ X^a = \Omega_{bo,a}^{\top} \Omega_{bo,bo}^{-1} \left[ \Omega_{bo,bo}^{-1} + \mathcal{H}^{\top} \Lambda_{bo,bo}^{-1} \mathcal{H} \right]^{-1} \mathcal{H}^{\top} \Lambda_{bo,bo}^{-\frac{1}{2}}. \quad (55) $$

These formulas are similar to the normal equations of classical DA. However, it should be noted that, in Eqs. (54) and (55), all of the prior error statistics are encapsulated in $\Lambda_{bo,bo}$, whereas the impact of OT is encoded in $\Omega_{bo,bo}$. To be concrete, note that, when using Gaussian statistics (Eq. 12), $\Lambda_{bo,bo}$ would simply read

$$ \Lambda_{bo,bo} = \begin{bmatrix} \Lambda_{bb} & \mathbf{0} \\ \mathbf{0} & \Lambda_{oo} \end{bmatrix} = \begin{bmatrix} \mathbf{B} & \mathbf{0} \\ \mathbf{0} & \mathbf{R} \end{bmatrix}. \quad (56) $$

## 4.2 Interpretation

Further, we can perform a block decomposition of $\Omega$ onto the spaces of $x^b$ and $x^o$:

$$ \Omega_{bo,bo} \triangleq \begin{bmatrix} \Omega_{bb} & \Omega_{bo} \\ \Omega_{bo}^{\top} & \Omega_{oo} \end{bmatrix}. \quad (57) $$

It can be shown that $\Omega_{bo}$ is proportional to the optimal transference plan of the effective transport between $x^o$ and $x^b$ and that the blocks of the diagonal are themselves diagonal and depend on the observable states:

$$ \Omega_{bo} = \frac{1}{\varepsilon} \mathbf{P}^{bo}, \quad (58a) $$

$$ \Omega_{bb} = \frac{1}{\varepsilon} \mathrm{diag}(x^b), \quad (58b) $$

$$ \Omega_{oo} = \frac{1}{\varepsilon} \mathrm{diag}(x^o). \quad (58c) $$

For instance, this could be shown by the explicit computation of $\Omega_{bo,bo} = \varepsilon \partial_{\eta}^2 \hat{Z}_{\varepsilon}$.

Let us now examine the impact of OT on the analysis error covariance matrix. We first define

$$ \Delta = \Lambda_{bo,bo}^{-\frac{1}{2}} \mathcal{H} \Omega_{bo,bo}^{\frac{1}{2}}, \quad (59) $$

whose thin singular value decomposition is $\mathbf{U}\mathbf{\Sigma}\mathbf{V}^{\top}$, where $\mathbf{U}$ is an orthogonal matrix of size $(N_b + N_o) \times (N_b + N_o)$, $\mathbf{\Sigma}$ is a rectangular and diagonal matrix of size $(N_b + N_o) \times (N_b + N_o)$, and $\mathbf{V}$ is an orthogonal matrix of size $(N_b + N_o) \times (N_b + N_o)$. Then, we standardise Eq. (54) following, for example, Sect. 2.4.1 in Rodgers (2000):

$$ X^a = \Omega_{bo,a}^{\top} \mathcal{H}^{\top} \left[ \Lambda_{bo,bo} + \mathcal{H} \Omega_{bo,bo} \mathcal{H}^{\top} \right]^{-1} \Lambda_{bo,bo}^{\frac{1}{2}}. \quad (60a) $$

$$ = \Omega_{bo,a}^{\top} \mathcal{H}^{\top} \Lambda_{bo,bo}^{-\frac{1}{2}} \times \left[ \mathbf{I}_{bo} + \Lambda_{bo,bo}^{-\frac{1}{2}} \mathcal{H} \Omega_{bo,bo} \mathcal{H}^{\top} \Lambda_{bo,bo}^{-\frac{1}{2}} \right]^{-1}, \quad (60b) $$

$$ = \Omega_{bo,a}^{\top} \Omega_{bo,bo}^{-\frac{1}{2}} \Delta^{\top} \left[ \mathbf{I}_{bo} + \Delta \Delta^{\top} \right]^{-1}, \quad (60c) $$

$$ = \Omega_{bo,a}^{\top} \Omega_{bo,bo}^{-\frac{1}{2}} \mathbf{V} \mathbf{\Sigma}^{\top} \left[ \mathbf{I}_{bo} + \mathbf{\Sigma} \mathbf{\Sigma}^{\top} \right]^{-1} \mathbf{U}^{\top}. \quad (60d) $$

Defining $\sigma = (\mathbf{\Sigma}\mathbf{\Sigma}^{\top})^{\frac{1}{2}}$, which is a square diagonal of size $(N_b + N_o) \times (N_b + N_o)$, we obtain, up to a multiplication by an irrelevant orthogonal matrix on the right, an equivalent factor for $P^a$:

$$ X^a = \Omega_{bo,a}^{\top} \Omega_{bo,bo}^{-\frac{1}{2}} \mathbf{V} \frac{\sigma}{\mathbf{I}_{bo} + \sigma^2}. \quad (60e) $$

The diagonal values of $\sigma$, denoted $\sigma_i \ge 0$, represent the independent degrees of freedom (dof) values of information that can be extracted from the observations, which, in our case, is the first guess $y^b$ and the traditional observations $y^o$, in contrast to Rodgers (2000), who only considers the dof values from $y^o$. The higher the $\sigma_i$, the more information attached to the dof of index $i$ and the more squeezed the corresponding direction in $X^a$ and $P^a$. From Eq. (59) and, in particular, its transpose, $\Delta^{\top} = \Omega_{bo,bo}^{\frac{1}{2}} \mathcal{H}^{\top} \Lambda_{bo,bo}^{-\frac{1}{2}}$, we can trace the flow of any piece of information. Such information stems from the observation vectors; hence, its flow starts in $\Delta^{\top}$ from $\Lambda_{bo,bo}^{-\frac{1}{2}}$, the square root of the precision matrix $\Lambda_{bo,bo}^{-1}$. It is then transferred from the observation spaces to the observable spaces through $\mathcal{H}^{\top}$. It is finally optimally transported across the space of $x^b$ and $x^o$ by $\Omega_{bo,bo}$, whose off-diagonal block is proportional to the transference plan $P^{bo}$. Hence, OT is not a primary source of uncertainty, as $y^b$ and $y^o$ can be, but moves information in between the observable spaces.

Let us now check the OTDA analysis error covariance matrix $P^a$ in the classical DA limit. To that end, we study Eq. (54) in the classical limit. Similarly to $\Omega_{bb}$ and $\Omega_{oo}$ in Eq. (58a), $\Omega_{aa}$ is defined as the covariance matrix of $x^a$ when only accounting for both OTs, and it can be shown that it reads

$$ \Omega_{aa} = \frac{1}{\varepsilon} \mathrm{diag}(x^a). \quad (61) $$
When the cost tends to $C_{bo}^{\infty}$, following the same arguments as in Sect. 2.4.3, $\mathbf{x}^b$, $\mathbf{x}^o$, and $\mathbf{x}^a$ must merge and, consequently, $\Omega_{bo} = \Omega_{aa} = \Omega_{bb} = \Omega_{oo}$. Hence, in this limit, $\Omega_{bo,bo} = \mathbf{1}_2\Omega_{aa}\mathbf{1}_2^\top$ and $\Omega_{bo,a} = \mathbf{1}_2\Omega_{aa}$, with $\mathbf{1}_2 = [1 \ 1]^\top$. Then, substituting these expressions of $\Omega_{bo,bo}$ and $\Omega_{bo,a}$ into Eq. (54), we get

$$ \mathbf{X}^a = \Omega_{aa} \mathbf{1}_2^\top \mathbf{H}^\top [\Lambda_{bo,bo} + \mathbf{H} \mathbf{1}_2 \Omega_{aa} \mathbf{1}_2^\top \mathbf{H}^\top]^{-1} \Lambda_{bo,bo}^{\frac{1}{2}}, \quad (62a) $$

$$ = \Omega_{aa} \mathbf{1}_2^\top \mathbf{H}^\top [\mathbf{I}_{bo} + \Lambda_{bo,bo}^{-1} \mathbf{H} \mathbf{1}_2 \Omega_{aa} \mathbf{1}_2^\top \mathbf{H}^\top]^{-1} \Lambda_{bo,bo}^{-\frac{1}{2}}, \quad (62b) $$

$$ = \Omega_{aa} [\mathbf{I}_a + \mathbf{1}_2^\top \mathbf{H}^\top \Lambda_{bo,bo}^{-1} \mathbf{H} \mathbf{1}_2 \Omega_{aa}]^{-1} \mathbf{1}_2^\top \mathbf{H}^\top \Lambda_{bo,bo}^{-\frac{1}{2}}, \quad (62c) $$

$$ = [\Omega_{aa}^{-1} + \mathbf{1}_2^\top \mathbf{H}^\top \Lambda_{bo,bo}^{-1} \mathbf{H} \mathbf{1}_2]^{-1} \mathbf{1}_2^\top \mathbf{H}^\top \Lambda_{bo,bo}^{-\frac{1}{2}}. \quad (62d) $$

Here, $\mathbf{I}_a$ is the identity matrix of size $N_a$. From Eq. (62b) to Eq. (62c), we relied on the shift matrix lemma (e.g. Asch et al., 2016). For $\Omega_{aa}^{-1}$ in Eq. (62d) to exist, it must be assumed that $\mathbf{x}^a \in O_{N_a}^{+,*}$; i.e. all the entries of $\mathbf{x}^a$ are positive. This is verified when using entropic regularisation with $\varepsilon > 0$, no matter how small the entries of $\mathbf{x}^a$ are. Moreover, if $\mathbf{x}^a$ has zero entries, $\mathbf{x}^a$ can be represented as the limit of a sequence of positive discrete measures.

Now, as we have

$$ \mathbf{A}^{-1} \triangleq \mathbf{1}_2^\top \mathbf{H}^\top \Lambda_{bo,bo}^{-1} \mathbf{H} \mathbf{1}_2 = \Lambda_{bb}^{-1} + \mathbf{H}^\top \Lambda_{oo}^{-1} \mathbf{H}, \quad (63) $$

we conclude, from Eq. (62d), that the classical limit of the analysis error covariance matrix is

$$ \mathbf{P}^a = \mathbf{X}^a (\mathbf{X}^a)^\top \quad (64a) $$

$$ = [\Omega_{aa}^{-1} + \mathbf{A}^{-1}]^{-1} \mathbf{A}^{-1} [\Omega_{aa}^{-1} + \mathbf{A}^{-1}]^{-1}. \quad (64b) $$

If the limit of $\mathbf{x}^a$ when $\varepsilon \to 0^+$ is in $O_{N_a}^{+,*}$, then $\Omega_{aa}^{-1} = \varepsilon \mathrm{diag}(\mathbf{x}^a)^{-1}$ must vanish. In this case,

$$ \mathbf{P}^a \underset{\varepsilon \to 0^+}{\longrightarrow} \mathbf{A} = (\partial_{f_b}^2 \zeta_b + \mathbf{H}^\top \partial_{f_o}^2 \zeta_o \mathbf{H})^{-1}, \quad (65) $$

which, assuming Gaussian errors, would read $\mathbf{P}^a = (\mathbf{B}^{-1} + \mathbf{H}^\top \mathbf{R}^{-1} \mathbf{H})^{-1}$, as expected from classical DA. However, if some of the entries of $\mathbf{x}^a$ vanish in the limit $\varepsilon \to 0^+$, we suspect that the limit of $\mathbf{P}^a$ will be the classical analysis error covariance matrix $\mathbf{A}$ but with the columns and rows associated with the vanishing entries of $\mathbf{x}^a$ tapered to 0.

## 4.3 Numerical illustration

We consider the one-dimensional example where half of the domain is observed, over $[0, \frac{1}{2}]$. Here, $\mathbf{H} \in O_{N_o \times N_o}$ with $N_o = N_o/2$ and $H_l^j = \delta_{l,j}$ for $l \in [1, N_o]$ and $j \in [1, N_o]$. Further, the observations are unbalanced, $m(\mathbf{y}^b) = 1$ and $m(\mathbf{y}^o) = 1.49$; they have been generated through $\mathcal{H}$ by discrete measures of mass 1 and 1.5, respectively. Moreover, the

cost metric has a quadratic dependence on the distance between sites, i.e. $[C_{ba}]_{ik} = \lambda|r_i^b - r_k^a|^2$ and $[C_{oa}]_{jk} = \lambda|r_j^o - r_k^a|^2$, where $\lambda = 10^3$. We use the results of Sect. 4.1 to compute the analysis error covariance matrix $\mathbf{P}^a$, the transference plan $\mathbf{P}^{bo}$, and the Jacobian $\Omega_{bo,a}$. The numerical results are displayed in Fig. 14. The OTDA analysis state is bimodal, with some mass being left over to the right of the domain to account for the long tail of the first guess, which is far from the observation support. Hence, there is a vanishing field region, roughly [0.6, 0.7], which separates the two components of the analysis state. As expected from OT theory, $\mathbf{P}^{bo}$ seems to converge towards a (non-trivial and barely differentiable) Monge map which, in this discrete context, has two branches, separated by the gap created by the vanishing field region. The analysis error covariance matrix $\mathbf{P}^a$ seems to converge to a diagonal matrix, with the exception of the vanishing field region. Indeed, there seems to be an uncertainty with respect to how much mass should be transferred from the first guess tail [0.7, 1] to the main region [0, 0.6]. This is given away by variance peaks near the edges of the gap and by negative covariances between the two edge points of the gap.

## 5 Conclusions

In this paper, we have introduced a theoretical framework for integrating nonlocal optimal transport (OT) metrics into data assimilation (DA), which we refer to as *hybrid OTDA*. This framework addresses the inconsistencies initially identified by Feyeux et al. (2016) when local metrics in classical DA are replaced with nonlocal ones based on OT.

Our focus has been on defining a 3D-Var approach for hybrid OTDA and deriving the first- and second-order moments of its analysis. The hybrid OTDA 3D-Var method blends classical DA and its background and observation error statistics with a Wasserstein barycentre problem involving the observables associated with the first guess and the observation vector. Importantly, our work demonstrates that classical DA is encompassed within this theoretical framework.

We have shown that this optimisation problem can be decomposed and simplified into a hybrid OTDA problem with a single OT problem based on an effective cost. This first problem yields the estimated $\mathbf{x}^b$ and $\mathbf{x}^o$, followed by a pure W-barycentre problem involving these states, whose solution is known as the McCann interpolant. This W-barycentre computation serves as the final analysis step.

Our proposed method can be applied to sparsely and noisily observed systems, as expected from a robust DA method. It can also accommodate non-trivial error statistics typical of a 3D-Var approach. Furthermore, we have illustrated the method's flexibility in defining cost metrics through various one- and two-dimensional numerical examples. We have empirically checked how the OTDA analysis shifts towards the classical DA analysis, within the OTDA framework.
<figure><img src="image_17.png" /><figcaption>**Figure 14.** Illustration of the second-order analysis of an OTDA 3D-Var. Panel (a) shows the same plot as Fig. 11a but with the addition of shaded regions delineated by plus and minus the standard deviations about the estimates for $x^a, x_{cl}^a, x^b, \text{ and } x^o$. These standard deviations are computed from the diagonal of the diagnosed posterior error covariance matrices associated with $x^a, x_{cl}^a, x^b, \text{ and } x^o$. Panel (b) displays the analysis error covariance matrix $\mathbf{P}^a$. Panel (c) shows the optimal transference plan $\mathbf{P}^{bo}$. Panel (d) shows the a, b block part of the Jacobian matrix $\mathbf{\Omega}_{bo,a}$, which is denoted $\mathbf{\Omega}_{ba}$.</figcaption></figure>

Note that, for now, some limitations apply; mainly, the framework is presently meant for non-negative fields.

While we have looked into several other promising developments regarding our methodology, we have chosen not to report them in this paper. These developments will be the subject of a future publication and include the following:

- the derivation of a Bayesian and probabilistic standpoint on OTDA;

- a generalised formalism enforcing physical regularization, such as smoothness of the field, on the analysis state;

- a stochastic matrix formalism, which is a substitute to using transference plans but could offer more robustness in the presence of entropic regularisation;

- employing cost matrices defined across several spaces, which is useful for realistic application where $x^b$ and $x^o$ lie in very distinct spaces, such as the space of emission of a pollutant and the space of the pollutant concentrations, respectively.

While our primary focus in this paper was on the derivation and understanding of key cost functions within the hybrid OTDA framework, we did not delve much into the numerical challenges, algorithmic complexity, or computing acceleration. For this aspect of the developments, we would rather rely on developments from OT experts, who are continuously improving the efficiency of numerical OT (e.g. Flamary et al., 2021).

In addition to strengthening the developments mentioned above, our future research will explore the application of the hybrid OTDA formalism in a sequential DA framework, as this paper concentrated solely on static analysis. We are also interested in investigating the role played by error statistics and cost metrics $\{\zeta_b, \zeta_o, C_{ba}, C_{oa}\}$ and their balancing in the hybrid OTDA analysis as well as in developing their objective tuning.

## Appendix A: From the primal to the dual cost function for the full problem

This appendix is dedicated to the derivation of the transformation from a Lagrangian variant of the primal problem to
the dual cost function (Eq. 20). It takes the form of the following series of transformations of the problem (from a Lagrangian to a dual cost function):

$$ \begin{aligned} \mathcal{L} = & \min_{\mathbf{x}^b, \mathbf{x}^o} \left[ \max_{f_b} \left\{ (\mathbf{y}^b - \mathbf{x}^b)^\top f_b - \zeta_b^*(f_b) \right\} \right. \\ & \left. + \max_{f_o} \left\{ (\mathbf{y}^o - \mathbf{H}\mathbf{x}^o)^\top f_o - \zeta_o^*(f_o) \right\} \right. \\ & + \min_{\mathbf{P} \in \mathcal{O}_{b,o,a}^+} \left\{ P_{ijk} C_{ba}^{ik} + P_{ijk} C_{oa}^{jk} \right. \\ & \left. + \max_{h_b, h_o} f_a \left\{ h_i^b (x_i^b - P_{ijk} 1_o^i 1_a^k) \right. \right. \\ & \left. \left. + h_j^o (x_j^o - P_{ijk} 1_b^i 1_a^k) \right. \right. \\ & \left. \left. + f_a^k (x_k^a - P_{ijk} 1_b^i 1_o^j) \right\} \right\} \right], \end{aligned} \quad (A1a) $$

$$ \begin{aligned} = & \min_{\mathbf{x}^a, \mathbf{x}^b} \left[ \max_{f_b, f_o} \left\{ (\mathbf{y}^b - \mathbf{x}^b)^\top f_b \right. \right. \\ & \left. \left. - \zeta_b^*(f_b) + (\mathbf{y}^o - \mathbf{H}\mathbf{x}^o)^\top f_o \right. \right. \\ & \left. \left. - \zeta_o^*(f_o) \right\} + \max_{h_b, h_o} \min_{\mathbf{P} \in \mathcal{O}_{b,o,a}^+} \left\{ P_{ijk} C_{ba}^{ik} + P_{ijk} C_{oa}^{jk} \right. \right. \\ & \left. \left. + h_i^b (x_i^b - P_{ijk} 1_o^j 1_a^k) + h_j^o (x_j^o - P_{ijk} 1_b^i 1_a^k) \right. \right. \\ & \left. \left. + f_a^k (x_k^a - P_{ijk} 1_b^i 1_o^j) \right\} \right], \end{aligned} \quad (A1b) $$

$$ \begin{aligned} = & \max_{h_b, h_o} \min_{f_b, f_o} \max_{\mathbf{P} \in \mathcal{O}_{b,o,a}^+} \left[ (\mathbf{y}^b - \mathbf{x}^b)^\top f_b - \zeta_b^*(f_b) \right. \\ & \left. + (\mathbf{y}^o - \mathbf{H}\mathbf{x}^o)^\top f_o - \zeta_o^*(f_o) + P_{ijk} C_{ba}^{ik} + P_{ijk} C_{oa}^{jk} \right. \\ & \left. + h_i^b (x_i^b - P_{ijk} 1_o^j 1_a^k) + h_j^o (x_j^o - P_{ijk} 1_b^i 1_a^k) \right. \\ & \left. + f_a^k (x_k^a - P_{ijk} 1_b^i 1_o^j) \right], \end{aligned} \quad (A1c) $$

$$ = \max_{f_b, f_o} \left\{ f_b^\top \mathbf{y}^b + f_o^\top \mathbf{y}^o - \zeta_b^*(f_b) - \zeta_o^*(f_o) \right. \\ + \min_{h_b, h_o} f_a \mathbf{x}^a \mathbf{x}^b \mathbf{x}^o \mathbf{P} \in \mathcal{O}_{b,o,a}^+ \\ \left. \left[ (h_b - f_b)^\top \mathbf{x}^b + (h_o - \mathbf{H}^\top f_o)^\top \mathbf{x}^o + f_a^\top \mathbf{x}^a \right. \right. \\ \left. + P_{ijk} (C_{ba}^{ik} + C_{oa}^{jk} - h_i^b 1_o^j 1_a^k - h_j^o 1_b^i 1_a^k - f_a^k 1_b^i 1_o^j) \right] \right\}, \quad (A1d) $$

$$ = \max_{f_b, f_o} \left[ f_b^\top \mathbf{y}^b + f_o^\top \mathbf{y}^o - \zeta_b^*(f_b) - \zeta_o^*(f_o) \right. \\ \left. + \min_{\mathbf{P} \in \mathcal{O}_{b,o,a}^+} P_{ijk} (C_{ba}^{ik} + C_{oa}^{jk} - f_b^i 1_o^j 1_a^k - H_i^j f_o^l 1_b^i 1_a^k) \right]. \quad (A1e) $$

In Eq. (A1a), the maps $\zeta_b^*$ and $\zeta_o^*$ are the Legendre-Fenchel transforms of the maps $\zeta_b$ and $\zeta_o$, respectively. From Eq. (A1d) to Eq. (A1e), taking the minimum over the observables $\mathbf{x}^b, \mathbf{x}^o$, and $\mathbf{x}^a$ implies enforcing $h_b = f_b, h_o = \mathbf{H}^\top f_o$, and $f_a = 0$. Hence, we obtain the dual problem which only depends on the Lagrange multipliers:

$$ \mathcal{L}^* = \max_{(f_b, f_o) \in \mathcal{U}_{bo}^*(\mathbf{C}_{ba}, \mathbf{C}_{oa}, \mathbf{H})} \left\{ f_b^\top \mathbf{y}^b + f_o^\top \mathbf{y}^o \right. \\ \left. - \zeta_b^*(f_b) - \zeta_o^*(f_o) \right\}, \quad (A2a) $$

where the * symbol refers to dual and where the polyhedron $\mathcal{U}_{bo}^*(\mathbf{C}_{ba}, \mathbf{C}_{oa}, \mathbf{H})$ is defined by

$$ \mathcal{U}_{bo}^*(\mathbf{C}_{ba}, \mathbf{C}_{oa}, \mathbf{H}) \triangleq \left\{ f_b \in \mathbb{R}^{\mathcal{N}_b}, f_o \in \mathbb{R}^{\mathcal{N}_o} : \forall i, j, k, \quad f_b^i + f_o^l H_l^j \le C_{ba}^{ik} + C_{oa}^{jk} \right\}. \quad (A2b) $$

The inequality constraints of the polyhedron $\mathcal{U}_{bo}^*$ stem from the positivity constraint $P_{ijk} \ge 0$ in Eq. (A1e). Very importantly, we have the coincidence of the minimum of the primal problem with the maximum of the dual problem $\mathcal{L} = \mathcal{L}^*$, a property called strong duality (see Sect. 5.2 in Boyd and Vandenberghe, 2004). Strong duality can, for instance, be achieved if both the primal and dual cost functions are convex, which is the case here.

## Appendix B: Derivation of the two-step hybrid optimal transport data assimilation algorithm

Here, we derive the two-step algorithm elaborated in Sect. 2.4.2. Moreover, entropic regularisation is added to the problem.

### B1 First step: simplified hybrid optimal transport data assimilation problem

The first step of the full OTDA algorithm is a simplified OTDA problem based on a single OT problem driven by the cost $\mathbf{C}_{bo}$. The corresponding high-level primal cost function is

$$ \mathcal{L} = \min_{\mathbf{x}^b \in \mathcal{O}_b^+} \left\{ \zeta_b(\mathbf{y}^b - \mathbf{x}^b) + \zeta_o(\mathbf{y}^o - \mathbf{H}\mathbf{x}^o) \right. \\ \left. + W_{\mathbf{C}_{bo}}(\mathbf{x}^b, \mathbf{x}^o) \right\}. \quad (B1) $$
The associated (lower-level) primal cost function, adding entropic regularisation ($\epsilon > 0$), is then

$$ \mathcal{L}_{\epsilon} = \min_{\mathbf{x}^{\mathrm{b}} \in \mathcal{O}_{\mathrm{b}}^{\mathrm{+}} \mathbf{x}^{\mathrm{o}} \in \mathcal{O}_{\mathrm{o}}^{\mathrm{+}}} \left[ \zeta_{\mathrm{b}}(\mathbf{y}^{\mathrm{b}} - \mathbf{x}^{\mathrm{b}}) + \zeta_{\mathrm{o}}(\mathbf{y}^{\mathrm{o}} - \mathbf{H}\mathbf{x}^{\mathrm{o}}) \right. \\ \left. \qquad + \min_{\mathbf{P} \in \mathcal{U}_{\mathrm{bo}}} \left( \epsilon \mathcal{K}(\mathbf{P}|\mathbf{v}) + P_{ij} C_{\mathrm{bo}}^{ij} \right) \right]. \quad (\mathrm{B}2\mathrm{a}) $$

In this optimisation problem, the admissible set of transference plans, i.e. the set of all 2-tensors of non-negative entries whose marginals are $\mathbf{x}^{\mathrm{b}}$ and $\mathbf{x}^{\mathrm{o}}$, is defined by

$$ \mathcal{U}_{\mathrm{bo}} \triangleq \left\{ \mathbf{P} \in \mathcal{O}_{\mathrm{b},\mathrm{o}}^{+} : \mathbf{P}\mathbf{1}_{\mathrm{o}} = \mathbf{x}^{\mathrm{b}}, \mathbf{P}^{\top}\mathbf{1}_{\mathrm{b}} = \mathbf{x}^{\mathrm{o}} \right\}. \quad (\mathrm{B}2\mathrm{b}) $$

As $\mathbf{x}^{\mathrm{b}}$ and $\mathbf{x}^{\mathrm{o}}$ are not predetermined, the prior transference plan $\mathbf{v}$ cannot be selected from $\mathcal{U}_{\mathrm{bo}}$ a priori. Hence, the simplest choice, which we decided to implement, is to set $v_{ij}$ to a constant, which assumes some statistical prior independence of $\mathbf{x}^{\mathrm{b}}$ and $\mathbf{x}^{\mathrm{o}}$. A derivation of the dual problem equivalent to $\mathcal{L}_{\epsilon}$ can be obtained in the exact same way as in the previous subsection, although it is now less cluttered because there is only one OT to account for, instead of two. The associated Lagrangian is

$$ \mathcal{L}_{\epsilon} = \max_{f_{\mathrm{b}} \in \mathbb{R}^{\mathcal{N}_{\mathrm{b}}}, f_{\mathrm{o}} \in \mathbb{R}^{\mathcal{N}_{\mathrm{o}}}} \left[ f_{\mathrm{b}}^{\top} \mathbf{y}^{\mathrm{b}} + f_{\mathrm{o}}^{\top} \mathbf{y}^{\mathrm{o}} - \zeta_{\mathrm{b}}^{*}(f_{\mathrm{b}}) - \zeta_{\mathrm{o}}^{*}(f_{\mathrm{o}}) \right. \\ \left. + \min_{\mathbf{P} \in \mathcal{O}_{\mathrm{b},\mathrm{o}}^{+}} \left( \epsilon \sum_{ij} \left\{ P_{ij} \ln \frac{P_{ij}}{v_{ij}} - P_{ij} + v_{ij} \right\} \right. \right. \\ \left. \left. + P_{ij} \left\{ C_{\mathrm{bo}}^{ij} - f_{\mathrm{b}}^{i} 1_{\mathrm{o}}^{j} - H_{l}^{j} f_{\mathrm{o}}^{l} 1_{\mathrm{b}}^{i} \right\} \right) \right]. \quad (\mathrm{B}3) $$

Again, the maps $\zeta_{\mathrm{b}}^{*}$ and $\zeta_{\mathrm{o}}^{*}$ are the Legendre–Fenchel transforms of the maps $\zeta_{\mathrm{b}}$ and $\zeta_{\mathrm{o}}$, respectively. The variables $f_{\mathrm{b}}$ and $f_{\mathrm{o}}$ are Lagrange vectors; they are used to enforce the marginals of the transference plan associated with $W_{\mathrm{Cbo}}$. The unconstrained minimisation over $\mathbf{P}$, i.e. the inner minimisation problem in Eq. (B3), is obtained by cancelling the gradient with respect to $\mathbf{P}$, which yields

$$ P_{ij} = v_{ij} e^{\left( \frac{f_{\mathrm{b}}^{i} + f_{\mathrm{o}}^{j} H_{l}^{j} - C_{\mathrm{bo}}^{ij}}{\epsilon} \right)}. \quad (\mathrm{B}4) $$

Substituting this solution into minus the Lagrangian $-\mathcal{L}_{\epsilon}$ gives the regularised dual problem

$$ \mathcal{J}_{\epsilon}^{*} = \min_{f_{\mathrm{b}} \in \mathbb{R}^{\mathcal{N}_{\mathrm{b}}}, f_{\mathrm{o}} \in \mathbb{R}^{\mathcal{N}_{\mathrm{o}}}} J_{\epsilon}^{*}(f_{\mathrm{b}}, f_{\mathrm{o}}), \quad (\mathrm{B}5\mathrm{a}) $$

with the associated Lagrangian

$$ J_{\epsilon}^{*}(f_{\mathrm{b}}, f_{\mathrm{o}}) = \epsilon(Z_{\epsilon} - \mathbf{m}(\mathbf{v})) + \zeta_{\mathrm{b}}^{*}(f_{\mathrm{b}}) + \zeta_{\mathrm{o}}^{*}(f_{\mathrm{o}}) \\ - f_{\mathrm{b}}^{\top} \mathbf{y}^{\mathrm{b}} - f_{\mathrm{o}}^{\top} \mathbf{y}^{\mathrm{o}}, \quad (\mathrm{B}5\mathrm{b}) $$

which relies on the partition function

$$ Z_{\epsilon} = \sum_{ij} P_{ij}. \quad (\mathrm{B}5\mathrm{c}) $$

The notation $\mathcal{J}_{\epsilon}^{*}$ and $J_{\epsilon}^{*}$, rather than $\mathcal{L}_{\epsilon}^{*}$ and $L_{\epsilon}^{*}$, signifies that we work on the opposite of $\mathcal{L}_{\epsilon}^{*}$ and $L_{\epsilon}^{*}$ so as to obtain a dual problem to be minimised rather than maximised. Most importantly, we have, under conditions that will be satisfied in the following, the coincidence of the two minima $\mathcal{J}_{\epsilon}^{*} = -\mathcal{L}_{\epsilon}$, i.e. strong duality. Assuming one can obtain a proper correspondence between the optimal $f_{\mathrm{b}}$ and $f_{\mathrm{o}}$ of the dual problem and $\mathbf{x}^{\mathrm{b}}$ and $\mathbf{x}^{\mathrm{o}}$ of the primal problem, this implies, once again, that the primal problem can be traded for the dual problem.

Even though the regularised optimisation problem is slightly different from the unregularised one, a difference which is controlled by the value of $\epsilon$, the new dual optimisation problem is free, i.e. without constraints. It can be solved as it is, using, for instance, the L-BFGS-B minimiser (Liu and Nocedal, 1989). The advantage of the regularised dual formulation is twofold: (1) the dual cost function is unconstrained (free optimisation), and (2) we will trade a minimisation over $N_{\mathrm{b}} \times N_{\mathrm{o}}$ variables for a minimisation over $N_{\mathrm{b}} + N_{\mathrm{o}}$ variables. This dual formulation can be viewed as a generalised physical-space statistical analysis system (PSAS) formalism (Courtier, 1997), an approach in which classical DA algebra is mostly carried out in observation space.

Once the optimal values for $f_{\mathrm{b}}$ and $f_{\mathrm{o}}$ are obtained, the optimal discrete Kantorovich transference plan $\mathbf{P}$ can be computed using Eq. (B4). As a result, as marginals of this transference plan, the solutions for the observables are

$$ x_{i}^{\mathrm{b}} = P_{ij} 1_{\mathrm{o}}^{j} = \sum_{j} P_{ij}, \quad x_{j}^{\mathrm{o}} = P_{ij} 1_{\mathrm{b}}^{i} = \sum_{i} P_{ij}. \quad (\mathrm{B}6) $$

## B2 Second step: Wasserstein barycentre

Now that we have obtained the observables $\mathbf{x}^{\mathrm{b}}$ and $\mathbf{x}^{\mathrm{o}}$ via Eq. (B6), we would like to compute their W-barycentre. The joint mass $m$ of these observables can be computed as follows:

$$ m = m(\mathbf{x}^{\mathrm{b}}) = m(\mathbf{x}^{\mathrm{o}}). \quad (\mathrm{B}7) $$

The high-level primal cost function of this W-barycentre problem is

$$ J_{\mathrm{w}} = \min_{\mathbf{x}^{\mathrm{a}} \in \mathcal{O}_{\mathrm{Na}}^{+}} \left\{ W_{\mathrm{Cba}}(\mathbf{x}^{\mathrm{b}}, \mathbf{x}^{\mathrm{a}}) + W_{\mathrm{Coa}}(\mathbf{x}^{\mathrm{o}}, \mathbf{x}^{\mathrm{a}}) \right\}. \quad (\mathrm{B}8) $$

We have found and practised several ways to solve this problem. One way is to compute the McCann interpolant. This is theoretically elegant, but Eq. (26) did not leverage regularisation of the W-barycentre problem. Instead, the approach reported here is to use the dual optimisation problem, in conjunction with entropic regularisation at finite $\epsilon > 0$. We leverage our knowledge of the mass $m$ resulting from the first step of the algorithm by enforcing the mass in the cost function, $m(\mathbf{P}) = m$. This seems redundant, but it actually yields, by
construction and very naturally, a numerically efficient algorithm comparable to the ad hoc log-domain scheme proposed in Sect. 4.4 of Peyré and Cuturi (2019).

Again, one way (although not the only way) to write the primal problem is to use a gluing transference plan, a 3-tensor whose marginals are $\mathbf{x}^b, \mathbf{x}^o$, and $\mathbf{x}^a$:

$$L_{\varepsilon} = \min_{\mathbf{x}^a \in \mathcal{O}_{N_a}^{+}} \mathbf{P} \cdot \mathbf{C}_{\text{boa}} + \varepsilon \mathcal{K}(\mathbf{P}|\mathbf{v}) + f_b^{\top} \mathbf{x}^b + f_o^{\top} \mathbf{x}^o, \quad (\text{B9a})$$

where $[C_{\text{boa}}]_{ijk} = C_{ba}^{ik} + C_{oa}^{jk}$, the binary operator denotes the contraction of tensors, and

$$\mathcal{U}_{\text{boa}}(\mathbf{x}^a) \triangleq \left\{ \mathbf{P} \in \mathcal{O}_{b,o,a}^{+} : \begin{array}{l} \forall i, P_{ijk} 1_o^j 1_a^k = x_i^b, \\ \forall j, P_{ijk} 1_b^i 1_a^k = x_j^o, \quad \forall k, P_{ijk} 1_b^i 1_o^j = x_k^a \end{array} \right\}. \quad (\text{B9b})$$

The 3-tensor $\mathbf{v}$ is chosen to be $v_{ijk} = x_i^b x_j^o / (m N_a)$, which is uniform in $k$ and for which $m(\mathbf{v}) = m$. The resulting dual problem is

$$\mathcal{J}^* = \min_{f_b \in \mathbb{R}^{N_b}, f_o \in \mathbb{R}^{N_o}} J^*(f_b, f_o), \quad (\text{B10a})$$

where the associated Lagrangian is

$$J^*(f_b, f_o) = \varepsilon \left( m \ln \frac{Z_{\varepsilon}}{m} + m - m(\mathbf{v}) \right) - f_b^{\top} \mathbf{x}^b - f_o^{\top} \mathbf{x}^o, \quad (\text{B10b})$$

with the partition function

$$Z_{\varepsilon} = \sum_{ijk} v_{ijk} e^{(f_b^i + f_o^i H_l^j - C_{ba}^{ik} - C_{oa}^{jk}) / \varepsilon}. \quad (\text{B10c})$$

This partition function is elegant but impractical because, with high dimensionality, a 3-tensor might be too large to store and compute with. However the partition function in Eq. (B10c) can be simplified by noticing that

$$Z_{\varepsilon} = \sum_{ij} v_{ij} e^{(f_b^i + f_o^i H_l^j - C_{bo}^{ij}) / \varepsilon}, \quad (\text{B11})$$

where we introduced the effective cost metric

$$[C_{\text{bo}}]_{ij} = -\varepsilon \ln \left( \sum_k \frac{v_{ijk}}{v_{ij}} e^{-(C_{ba}^{ik} + C_{oa}^{jk}) / \varepsilon} \right), \quad (\text{B12})$$

which is the regularised cost – known in statistics and machine learning as a soft-plus transform – of Eq. (22c). The 2-tensor $v_{ij}$ plays the same role as that of the first step of the algorithm; we choose it as $v_{ij} = x_i^b x_j^o / m$, for which $m(\mathbf{v}) = m$. The dual problem now only involves 2-tensors and becomes numerically more efficient. Given the optimal $f_b$ and $f_o$, the (glued) optimal transference plan $\mathbf{P}^{\text{boa}}$ is formally given by

$$P_{ijk}^{\text{boa}} = \frac{v_{ijk}}{Z_{\varepsilon}} e^{(f_b^i + f_o^i H_l^j - C_{ba}^{ik} - C_{oa}^{jk}) / \varepsilon}. \quad (\text{B13})$$

The W-barycentre $\mathbf{x}^a$ is then given as a marginal of $\mathbf{P}^{\text{boa}}$:

$$x_k^a = P_{ijk} 1_b^i 1_o^j \quad (\text{B14a})$$

$$= \frac{1}{Z_{\varepsilon}} \sum_{ij} v_{ijk} e^{(f_b^i + f_o^i H_l^j - C_{ba}^{ik} - C_{oa}^{jk}) / \varepsilon}. \quad (\text{B14b})$$

Because of the normalisation of the transference plan to $m$, the entropic regularisation exhibits a $\varepsilon m \ln Z_{\varepsilon}$ instead of $\varepsilon Z_{\varepsilon}$. This systematically enforces normalisation in the computations of the gradients, as well as in the course of the numerical optimisation of the dual cost function, de facto working in the log domain. We experienced more stable computations and the ability to reach smaller $\varepsilon$, compared with the case without normalisation. This completes the solution through the two-step OTDA algorithm.

**Code availability.** The products of this paper are exclusively optimisation problems and methods to solve them; their implementation (code) used in the illustrative sections relies on freely available software to solve the optimisation problems, mainly L-BFGS-B and its implementation in SciPy (https://github.com/scipy/scipy, SciPy, 2024) and the Python Optimal Transport library and its implementation (https://github.com/PythonOT, Optimal Transport, 2024).

**Data availability.** No data sets were used in this article.

**Author contributions.** MB, PJV, and AF developed the methodology. MB implemented the numerics. MB wrote the manuscript. MB, PJV, AF, JDLB, and YR revised the manuscript.

**Competing interests.** The contact author has declared that none of the authors has any competing interests.

**Disclaimer.** Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims made in the text, published maps, institutional affiliations, or any other geographical representation in this paper. While Copernicus Publications makes every effort to include appropriate place names, the final responsibility lies with the authors.

**Acknowledgements.** The authors would like to thank Oliver Talamand (the executive and handling editor) and the two anonymous reviewers for their remarks and suggestions that helped shape the paper. This research has been supported by the ANR-ARGONAUT (PollutAnt and gReenhouse Gases emissiOns moNitoring from spAce at high ResoUTion) national research project (grant no. ANR-19-CE01-0007). CEREA is a member of Institut Pierre-Simon Laplace (IPSL).
**Financial support.** This research has been supported by the Agence Nationale de la Recherche (grant no. ANR-19-CE01-0007).

**Review statement.** This paper was edited by Olivier Talagrand and reviewed by two anonymous referees.

## References

Amodei, M. and Stein, J.: Deterministic and fuzzy verification methods for a hierarchy of numerical models, Meteorol. Appl., 16, 191–203, https://doi.org/10.1002/met.101, 2009.

Asch, M., Bocquet, M., and Nodet, M.: Data Assimilation: Methods, Algorithms, and Applications, Fundamentals of Algorithms, SIAM, Philadelphia, ISBN 978-1-611974-53-9, https://doi.org/10.1137/1.9781611974546, 2016.

Bocquet, M.: Towards optimal choices of control space representation for geophysical data assimilation, Mon. Weather Rev., 137, 2331–2348, https://doi.org/10.1175/2009MWR2789.1, 2009.

Bocquet, M., Wu, L., and Chevallier, F.: Bayesian design of control space for optimal assimilation of observations. I: Consistent multiscale formalism, Q. J. Roy. Meteor. Soc., 137, 1340–1356, https://doi.org/10.1002/qj.837, 2011.

Boyd, S. P. and Vandenberghe, L.: Convex optimization, Cambridge university press, ISBN 978-0521833783, 2004.

Briggs, W. M. and Levine, R. A.: Wavelets and field forecast verification, Mon. Weather Rev., 125, 1329–1341, https://doi.org/1520-0493(1997)125<1329:WAFFV>2.0.CO;2, 1997.

Carrassi, A., Bocquet, M., Bertino, L., and Evensen, G.: Data Assimilation in the Geosciences: An overview on methods, issues, and perspectives, WIREs Clim. Change, 9, e535, https://doi.org/10.1002/wcc.535, 2018.

Chizat, L., Peyré, G., Schmitzer, B., and Vialard, F.-X.: Scaling algorithms for unbalanced optimal transport problems, Math. Comput., 87, 2563–2609, https://doi.org/10.1090/mcom/3303, 2018.

Courtier, P.: Dual formulation of four-dimensional variational assimilation, Q. J. Roy. Meteor. Soc., 123, 2449–2461, https://doi.org/10.1002/qj.49712354414, 1997.

Daley, R.: Atmospheric Data Analysis, Cambridge University Press, New-York, ISBN 9780521458252, 1991.

Davis, C., Brown, B., and Bullock, R.: Object-based verification of precipitation forecasts. Part I: Methodology and application to mesoscale rain areas, Mon. Weather Rev., 134, 772–1784, https://doi.org/10.1175/MWR3146.1, 2006a.

Davis, C., Brown, B., and Bullock, R.: Object-based verification of precipitation forecasts. Part II: Application to convective rain systems, Mon. Weather Rev., 134, 1785–1795, https://doi.org/10.1175/MWR3145.1, 2006b.

Duc, L. and Sawada, Y.: Geometry of rainfall ensemble means: from arithmetic averages to Gaussian-Hellinger barycenters in unbalanced optimal transport, J. Meteor. Soc. Jpn., 102, 35–47, https://doi.org/10.2151/jmsj.2024-003, 2024.

Ebert, E. E.: Fuzzy verification of high-resolution gridded forecasts: a review and proposed framework, Meteorol. Appl., 15, 51–64, https://doi.org/10.1002/met.25, 2008.

El Moselhy, T. A. and Marzouk, Y. M.: Bayesian inference with optimal maps, J. Comp. Phys., 231, 7815–7850, https://doi.org/10.1016/j.jcp.2012.07.022, 2012.

Evensen, G., Vossepoel, F. C., and van Leeuwen, P. J.: Data Assimilation Fundamentals: A Unified Formulation of the State and Parameter Estimation Problem, Springer Textbooks in Earth Sciences, Geography and Environment, Springer Cham, ISBN 978-3-030-96708-6, https://doi.org/10.1007/978-3-030-96709-3, 2022.

Farchi, A. and Bocquet, M.: Review article: Comparison of local particle filters and new implementations, Nonlin. Processes Geo-phys., 25, 765–807, https://doi.org/10.5194/npg-25-765-2018, 2018.

Farchi, A., Bocquet, M., Roustan, Y., Mathieu, A., and Quéré, A.: Using the Wasserstein distance to compare fields of pollutants: application to the radionuclide atmospheric dispersion of the Fukushima-Daiichi accident, Tellus B, 68, 31682, https://doi.org/10.3402/tellusb.v68.31682, 2016.

Feyeux, N.: Transport optimal pour l'assimilation de données images, Ph.D. thesis, Université Grenoble Alpes, https://inria.hal.sciences/tel-01480695 (last access: 7 July 2024), 2016.

Feyeux, N., Vidard, A., and Nodet, M.: Optimal transport for variational data assimilation, Nonlin. Processes Geophys., 25, 55–66, https://doi.org/10.5194/npg-25-55-2018, 2018.

Flamary, R., Courty, N., Gramfort, A., Alaya, M. Z., Boisbunon, A., Chambon, S., Chapel, L., Corenflos, A., K., F., Fournier, N., Gautheron, L., Gayraud, N. T. H., Janati, H., Rakotomamonjy, A., Redko, I., Rolet, A., Schutz, A., Seguy, V., Sutherland, D. J., Tavenard, R., Tong, A., and Vayer, T.: POT: Python Optimal Transport, J. Mach. Learn. Res., 22, 1–8, http://jmlr.org/papers/v22/20-451.html (last access: 7 July 2024), 2021.

Gangbo, W. and McCann, R. J.: The geometry of optimal transportation, Acta Math., 177, 113–1618, https://doi.org/10.1007/BF02392620, 1996.

Gilleland, E., Ahijevych, D. A., Brown, B. G., and Ebert, E. E.: Verifying forecasts spatially, B. Am. Meteorol. Soc., 91, 1365–1373, https://doi.org/10.1175/2010BAMS2819.1, 2010a.

Gilleland, E., Lindström, J., and Lindgren, F.: Analyzing the image warp forecast verification method on precipitation fields from the ICP, Weather Forecast., 25, 1249–1262, https://doi.org/10.1175/2010WAF2222365.1, 2010b.

Hoffman, R. N. and Grassotti, C.: A Technique for Assimilating SSM/I Observations of Marine Atmospheric Storms: Tests with ECMWF Analyses, J. Appl. Meteorol. Clim., 35, 1177–1188, https://doi.org/10.1175/1520-0450(1996)035<1177:ATFASO>2.0.CO;2, 1996.

Hoffman, R. N., Liu, Z., Louis, J.-F., and Grassoti, C.: Distortion representation of forecast errors, Mon. Weather Rev., 123, 2758–2770, https://doi.org/10.1175/1520-0493(1995)123<2758:DROFE>2.0.CO;2, 1995.

Janjić, T., Bormann, N., Bocquet, M., Carton, J. A., Cohn, S. E., Dance, S. L., Losa, S. N., Nichols, N. K., Potthast, R., Waller, J. A., and Weston, P.: On the representation error in data assimilation, Q. J. Roy. Meteor. Soc., 144, 1257–1278, https://doi.org/10.1002/qj.3130, 2018.

Kalnay, E.: Atmospheric Modeling, Data Assimilation and Predictability, Cambridge University Press, Cambridge, ISBN 9780521796293, 2003.
Keil, C. and Craig, G. C.: A displacement and amplitude score employing an optical flow technique, Weather Forecast., 24, 1297–1308, https://doi.org/10.1175/2009WAF2222247.1, 2009.

Lack, S. A., Limpert, G. L., and Fox, N. I.: An object-oriented multiscale verification scheme, Weather Forecast., 25, 79–92, https://doi.org/10.1175/2009WAF2222245.1, 2010.

Le Coz, C., Tantet, A., Flamary, R., and Plougonven, R.: Optimal transport for the multi-model combination of sub-seasonal ensemble forecasts, EGU General Assembly 2023, Vienna, Austria, 24–28 Apr 2023, EGU23-13445, https://doi.org/10.5194/egusphere-egu23-13445, 2023.

Liu, D. C. and Nocedal, J.: On the limited memory BFGS method for large scale optimization, Math. Programm., 45, 503–528, https://doi.org/10.1007/BF01589116, 1989.

Lledó, L., Skok, G., and Haiden, T.: Estimating location errors in precipitation forecasts with the Wasserstein and Attribution distances, EMS Annual Meeting 2023, Bratislava, Slovakia, 4–8 Sep 2023, EMS2023-602, https://doi.org/10.5194/ems2023-602, 2023.

Marzouk, Y., Moselhy, T., Parno, M., and Spantini, A.: An introduction to sampling via measure transport, in: Handbook of Uncertainty Quantification, edited by: Ghanem, R., Higdon, D., and Owhadi, H., chap. 23, Springer International Publishing, Cham, 785–825, https://doi.org/10.1007/978-3-319-12385-1_23, 2017.

Monge, G.: Mémoire sur la théorie des déblais et des remblais, in: Histoire de l'Académie Royale des Sciences de Paris, 666–704, 1781.

Necker, T., Wolfgruber, L., Kugler, L., Weissmann, M., Dorninger, M., and Serafin, S.: The fractions skill score for ensemble forecast verification, Authorea [preprint], https://doi.org/10.22541/au.169169008.89657659/v1, 2023.

Ning, L. and Carli, F. P., Ebtehaj, A. M., Foufoula-Georgiou, E., and Georgiou, T. T.: Coping with model error in variational data assimilation using optimal mass transport, Water Resour. Res., 50, 5817–5830, https://doi.org/10.1002/2013WR014966, 2014.

Oliver, D. S.: Minimization for conditional simulation: Relationship to optimal transport, J. Comp. Phys., 265, 1–15, https://doi.org/10.1016/j.jcp.2014.01.048, 2014.

Optimal Transport: Github [code], https://github.com/PythonOT, last access: 7 July 2024.

Peyré, G. and Cuturi, M.: Computational Optimal Transport: With Applications to Data Science, Foundations and Trends in Machine Learning, 11, 355–607, https://doi.org/10.1561/2200000073, 2019.

Plu, M.: A variational formulation for translation and assimilation of coherent structures, Nonlin. Processes Geophys., 20, 793–801, https://doi.org/10.5194/npg-20-793-2013, 2013.

Ravela, S., Emanuel, K., and McLaughlin, D.: Data assimilation by field alignement, Physica D, 230, 127–145, https://doi.org/10.1016/j.physd.2006.09.035, 2007.

Rodgers, C. D.: Inverse methods for atmospheric sounding, vol. 2, World Scientific, Series on Atmospheric, Oceanic and Planetary Physics, ISBN 978-981-02-2740-1, https://doi.org/10.1142/3171, 2000.

SciPy: SciPy library main repository, Github [code], https://github.com/scipy/scipy, last access: 7 July 2024.

Sinkhorn, R.: A relationship between arbitrary positive matrices and doubly stochastic matrices, Ann. Math. Stat., 35, 876–879, 1964.

Skok, G.: Precipitation attribution distance, Atmos. Res., 295, 106998, https://doi.org/10.1016/j.atmosres.2023.106998, 2023.

Talagrand, O.: Assimilation of Observations, an Introduction, J. Meteor. Soc. Jpn., 75, 191–209, https://doi.org/10.2151/jmsj1965.75.1B_191, 1997.

Tamang, S. K., Ebtehaj, A., Zou, D., and Lerman, G.: Regularized variational data assimilation for bias treatment using the W asserstein metric, Q. J. Roy. Meteor. Soc., 146, 2332–2346, https://doi.org/10.1002/qj.3794, 2020.

Tamang, S. K., Ebtehaj, A., van Leeuwen, P. J., Zou, D., and Lerman, G.: Ensemble Riemannian data assimilation over the Wasserstein space, Nonlin. Processes Geophys., 28, 295–309, https://doi.org/10.5194/npg-28-295-2021, 2021.

Tamang, S. K., Ebtehaj, A., van Leeuwen, P. J., Lerman, G., and Foufoula-Georgiou, E.: Ensemble Riemannian data assimilation: towards large-scale dynamical systems, Nonlin. Processes Geophys., 29, 77–92, https://doi.org/10.5194/npg-29-77-2022, 2022.

Vanderbecken, P. J., Dumont Le Brazidec, J., Farchi, A., Bocquet, M., Roustan, Y., Potier, É., and Broquet, G.: Accounting for meteorological biases in simulated plumes using smarter metrics, Atmos. Meas. Tech., 16, 1745–1766, https://doi.org/10.5194/amt-16-1745-2023, 2023.

Vilani, C.: Topics in Optimal Transportation, vol. 58 of Graduate Studies in Mathematics, American Mathematical Society, Providence, Rhode Island, ISBN 9780821833124, 2003.

Vilani, C.: Optimal Transport: Old and New, vol. 338 of Die Grundlehren der Mathematischen Wissenschaften, Springer-Verlag, Berlin Heidelberg, ISBN 978-3-540-71049-3, 2009.

Wernli, H., Paulat, M., Hagen, M., and Frei, C.: SAL – A Novel Quality Measure for the Verification of Quantitative Precipitation Forecasts, Mon. Weather Rev., 136, 4470–4487, https://doi.org/10.1175/2008MWR2415.1, 2008.

Ying, Y.: A Multiscale Alignment Method for Ensemble Filtering with Displacement Errors, Mon. Weather Rev., 147, 4553–4565, https://doi.org/10.1175/MWR-D-19-0170.1, 2019.

Ying, Y., Anderson, J. L., and Bertino, L.: Improving Vortex Position Accuracy with a New Multiscale Alignment Ensemble Filter, Mon. Weather Rev., 151, 1387–405, https://doi.org/10.1175/MWR-D-22-0140.1, 2023.

Zhou, W., Bovik, A. C., Sheikh, H. R., and Simoncelli, E.: Image quality assessment: from error visibility to structural similarity, IEEE T. Image Process., 13, 600–612, https://doi.org/10.1109/TIP.2003.819861, 2004.