text:
\section{Introduction}
\label{intro}

\subsection{Related literature}

OT formulation dates back to the early work of \cite{monge1781memoire}
, who considered the  problem of finding the optimal way to move given piles of sand to fill up given holes of the same total volume. Monge's problem remained open until the 1940s, when it was revisited and solved by Kantorovich,  in relation to the economic
problem of optimal allocation of resources. We refer to  \cite{villani2009optimal}, \cite{santambrogio2015optimal} for a book-length presentation in mathematics, to \cite{peyre2019computational} for a data science view, and to \cite{panaretos2020invitation} for a statistical perspective.

Within the OT setting, the Wasserstein distance ($W_p, p \geq 1$) is defined as the minimum cost of transferring the probability mass from a source distribution to a target distribution, for a given transfer cost function. Nowadays, OT theory and $W_p$ are of fundamental importance for many scientific areas, including statistics, econometrics, information theory and machine learning. For instance,  in  machine learning, OT based inference is  a popular tool in generative models; see \cite{genevay2018learning}, \cite{arjovsky2017wasserstein} and references therein. Similarly, OT techniques  are widely-applied for problems related to domain adaptation; see \cite{balaji2020robust}. In statistics and econometrics, estimation methods based on  $W_p$ are related to minimum distance estimation (MDE); see \cite{bassetti2006minimum} and  \cite{bernton2019parameter}. MDE is a research area in continuous development and the estimators  based on this technique are called minimum distance estimators. They are linked to M-estimators and may be robust. We refer to \cite{hampel1986robust},  \cite{van2000asymptotic} and  \cite{basu2011statistical} for a book-length statistical  introduction. As far as econometrics is concerned,  we refer to \cite{kitamura1997information} and \cite{hayashi2011econometrics}---see e.g. the Generalized Method of Moments and its information theoretic alternatives.

The extant approaches for MDE are usually defined via Kullback-Leibler (KL) divergence, Cressie-Read power divergence, Jensen-Shannon distance, total variation (TV) distance, Kolmogorov-Sminrov distance, Hellinger distance, to mention a few. Some of those approaches (e.g. Hellinger distance) require kernel density estimation of the underlying probability density function (pdf). Some of others (e.g. KL divergence) have poor performance when the considered distributions do not have a common support.   Compared to other notions of distance or divergence, $W_p$ avoids the mentioned drawbacks, e.g. it can be applied when the considered distributions do not share the same support and inference is conducted in a generative fashion---namely, a sampling mechanism is considered, in which non-linear functions map a low dimensional latent random vector
to a high dimensional space; see \cite{genevay2018learning}.  This explains why $W_p$ is becoming a popular tool in machine learning and statistics; see e.g. \cite{courty2014domain,frogner2015learning,kolouri2017optimal,carriere2017sliced, peyre2019computational,wang2021two} and  \cite{la2022some} for an overview of some recent technology transfers among different research areas.

In spite of their appealing theoretical properties, OT and $W_p$ have two important inference aspects to deal with: (i) implementation cost and (ii) lack of robustness. (i) The computation of the solution to OT problem and of the $W_p$ can be demanding.
To circumvent this problem, \cite{cuturi2013sinkhorn} proposes the use of an  entropy regularized version of the OT problem. The resulting divergence  is called
Sinkhorn divergence; see \cite{amari2018information} for further details.
\cite{genevay2018learning} illustrate the use of this divergence for inference in generative models, via  MDE.
The proposed
estimation method is attractive in terms of performance and
speed of computation. However, the statistical guarantees of the minimum Sinkhorn divergence estimators remain largely unexplored.  (ii) Robustness is becoming a crucial aspect for many complex statistical and machine learning applications. The reason is essentially two-fold. First, large datasets (e.g. records of images or large-scale data collected over the internet) can be cluttered with outlying values (e.g. due to measurement errors or recording device failures). Second,  every statistical model represents only an approximation to reality. Thus, one needs to devise inference procedures that remain informative even in the
presence of small deviations from the assumed statistical
(generative) model. Robust statistics deals with this problem.
We refer to the book of \cite{hampel1986robust} and \cite{ronchetti2009robust} for a book-length discussion on robustness principles. See also
\cite{mukherjee2021outlier} and  \cite{yatracos2022limitations}
for a discussion on the lack of robustness of OT and $W_p$; see also
\cite{ronchetti2022} for a recent review of the robustness aspects of OT, with some  connections to the methodology discussed in this paper.

Other papers have already mentioned the robustness issues of the Wasserstein distance and of OT. See e.g. \cite{alvarez2008trimmed},
\cite{del2022nonparametric} and  \cite{hallin2020center}.
However,
the use of these techniques for the type of statistical and machine learning problems considered in this paper remains largely unexplored.  In the OT literature,
\cite{chizat2017unbalanced}
proposes to deal with outliers via unbalanced OT, namely allowing the source and target distribution to be non-standard probability distributions. Working along the lines of unbalanced OT theory, \cite{balaji2020robust} define a robust optimal transportation (ROBOT) problem, which is based on the solution of a penalized OT problem. Similarly, starting from OT formulation with a regularization term, \cite{mukherjee2021outlier} derive a novel   OT problem.
The resulting robust OT problem is labelled ROBOT, as the one of \cite{balaji2020robust}.
Building on the Minimum Kantorovich Estimator (MKE) of \cite{bassetti2006minimum}, Mukherjee et al. propose a class of estimators  obtained through
minimizing the ROBOT  and illustrate numerically their performance.

\subsection{Our contributions}

We study theoretical, methodological and computational aspects of ROBOT. Our contributions can be summarized as follows.

We prove that the primal ROBOT problem of \cite{mukherjee2021outlier} defines a robust distance. We call this novel distance robust Wasserstein distance. We study its mathematical properties, proving that  it induces a metric space, which we call  {robust Wasserstein space}, whose
separability and completeness are proved.   Moreover, we derive a concentration inequality for the robust Wasserstein distance, starting from inequalities already available in the literature.

These theoretical findings are instrumental to another contribution of this paper: the development of novel inferential theory and methods based on robust Wasserstein distance.  Hinging on convex analysis \citep{rockafellar2009variational} and using the techniques of \cite{bernton2019parameter}, we prove that the minimum robust Wasserstein distance estimators exist (almost surely) and are consistent (at the reference model, possibly misspecified). Numerical experiments show that the robust Wasserstein distance estimators remain reliable even in the presence of local departures from the postulated statistical model. These results complete the methodological investigations already available in the literature on MKE (\cite{bassetti2006minimum} and \cite{bernton2019parameter}) and on ROBOT (\cite{balaji2020robust} and \cite{mukherjee2021outlier}). Indeed, beside the numerical evidence, there are no statistical guarantees on the estimators obtained by the ROBOT problem of \cite{mukherjee2021outlier}. Moreover, the ROBOT of \cite{balaji2020robust} does not defines a metric, thus is not suitable for MDE. In addition to the use of ROBOT for MDE, we illustrate how to apply it in a two-step procedure for inference on the model parameters of  a regression model. This approach reflects a common practice (specially in machine learning, where data pre-processing is widely-applied): in the first step one applies ROBOT to detect and  remove the outliers in the sample; in the second step, one  estimates the model parameters of linear regression model via standard M-estimation---because of space constraints, these results are  available in Appendix \ref{App.ROBOT}, to which we refer for further comments.

Another contribution of our paper is the derivation of the dual form of ROBOT for application to machine learning problems. This result not only completes the theory available in \cite{mukherjee2021outlier}, but also  provides  the stepping stone for the implementation of ROBOT. We explain how our duality  can be applied to define robust Wasserstein Generative Adversarial Networks (RWGAN). Numerical exercises illustrate that RWGAN have better performance than the routinely-applied Wasserstein GAN (WGAN) models; see Algorithm \ref{alg:robust wgan} in Appendix  \ref{app.rwgan} for the computational details. Moreover, we illustrate how to use ROBOT for outlier detection in domain adaptation, another machine learning problem; see  Appendix \ref{Sec.DA} for the algorithm (Algorithm \ref{alg:domain adptation}) and for numerical experiments.

This paper is organized as follows. In Section~\ref{Sec:Preliminaries}, we review classical OT and introduce  ROBOT. Based on ROBOT, we define the robust Wasserstein distance and derive the relevant theoretical properties in Section~\ref{Sec:Theory}. In Section~\ref{Robust Wasserstein estimator}, we define minimum robust Wasserstein distance  estimators and we establish their asymptotics.  Monte Carlo experiments and a real-data example
are given in Section~\ref{Sec:Applications}. Appendices include proofs, algorithms needed to implement our methods, and additional Monte Carlo exercises. The codes to reproduce our results are available at
\url{https://github.com/mayiming24/Robust-optimal-transportation}.

\section{Optimal transport}\label{Sec:Preliminaries}

We recall the fundamental notions of OT as in \cite{villani2009optimal} and of ROBOT, as defined in \cite{mukherjee2021outlier}.  Throughout this paper, $\mathcal{X}$ and $\mathcal{Y}$ denote two  Polish spaces, and
$\mathcal{P}(\mathcal{X})$ represents the set of all  probability measures on $\mathcal{X}$.

\subsection{Classical OT}\label{Optimal transport}

Let $\Pi (\mu,\nu)$  denote the set of all joint probability measures of $\mu \in \mathcal{P(X)}$ and $\nu \in \mathcal{P(Y)}$. Kontorovich's problem aims at finding a joint distribution $\pi   \in \Pi (\mu,\nu)$ which minimizes the expectation of the coupling between $X$ and $Y$ in terms of the cost function $c$. This problem can be formulated as
\begin{equation} \label{equ2}
	\inf \left\lbrace \int_{\mathcal{X\times Y}} c(x,y) d \pi(x,y) : \pi \in \Pi(\mu,\nu) \right\rbrace .
\end{equation}
A solution to Kantorovich's problem (KP) \eqref{equ2} is called an { optimal transport plan}.  Note that Kantorovich's problem is  convex, and the solution to  \eqref{equ2} exists under some mild assumptions on $c$, e.g., lower semicontinuous; see e.g. \citet[Chapter 4]{villani2009optimal}.

KP as in \eqref{equ2} has a dual form, which is related to solving the Kantorovich dual  (KD) problem
$		\sup \left\lbrace \int_{\mathcal{Y}} \phi d\nu - \int_{\mathcal{X}} \psi  d\mu : \phi \in C_{b}(\mathcal{Y}) , \psi \in C_b(\mathcal{X})  \right\rbrace$
s.t. 		$\phi(y) - \psi(x) \leq c(x,y),\enspace \forall(x,y),$
where $C_b(\mathcal{X})$ is the set of bounded continuous functions on $\mathcal{X}$---additional details are available in the Supplementary Material.
According to Th. 5.10 in \cite{villani2009optimal}, if  function $c$ is a lower semicontinuous, there exists a solution to the dual problem such that the solutions to KD and KP coincide  (no duality gap). In this case, the solution takes the form
$	\phi(y) =\inf \limits_{x \in \mathcal{X}} [\psi(x)+c(x, y)]$ {and} $
	\psi(x)=\sup \limits_{y \in \mathcal{Y}}[\phi(y)-c(x, y)]$,
where the functions $\phi$ and $\psi$ are called { $c$-concave} and { $c$-convex}, respectively, and $\phi$ (resp. $\psi$) is called the { $c$-transform} of $\psi$ (resp. $\phi$). A special case is that when $ c$ is a metric on $ \mathcal{X} $, thus OT problem becomes
$	\sup \left\lbrace \int_{\mathcal{X}} \psi d\nu - \int_{\mathcal{X}} \psi  d\mu : \psi \, \text{is 1-Lipschitz continuous}    \right\rbrace.$
This case is commonly known as  Kantorovich-Rubenstein duality.

Let $(\mathcal{X},d)$ denote a complete metric space equipped with a metric $d:\mathcal{X} \times \mathcal{X} \rightarrow \mathbb{R}$, and let $\mu$ and $\nu$ be two probability measures on $\mathcal{X}$.
Solving the optimal transport problem in \eqref{equ2}, with the cost function  $c(x,y) = d^p(x,y)$, introduces a distance, called  Wasserstein distance, between $\mu$ and $\nu$. More specifically, the Wasserstein distance of order $p$ $(p \geq 1)$ is
\begin{align}
	W_p(\mu,\nu)&= \left(\inf  \int_{\mathcal{X\times X}} (d(x,y))^p d \pi(x,y)\right)^{1/p}. \label{equ5}
\end{align}

\textbf{Remark.} The ability to lift the ground distance $d(x,y)$ is one of the perks of $W_p$ and it makes it a suitable tool in statistics and machine learning; see Remark 2.18 in~\cite{peyre2019computational}.  Interestingly, this desirable feature becomes a negative aspect as far as robustness is concerned.  Intuitively, OT embeds the distributions geometry: when the underlying distribution is contaminated by outliers, the marginal constraints force OT to transport outlying values, inducing an undesirable extra cost, which in turns entails large changes in the $W_p$. More in detail,
let $\delta(x_0)$ be  point mass measure centered at $x_0$ (a point in the sample space), and $d(x, y)$ be the ground distance. Then, we consider a
gross-neighbourhood as in \cite{hampel1986robust}, and, for $\varepsilon >0$, we have
$W_p({\rm \mu}, (1-\varepsilon){\rm \mu}+\varepsilon \delta(x_0))   \rightarrow \infty$,
as $x_0 \rightarrow \infty$. Thus, $W_p$ can be arbitrarily inflated by a small number of large observations and it is  sensitive to outliers.  For instance, let us consider $W_p$, with $p=1,2$. In Figure~\ref{fig:1a} and \ref{fig:1b}, we display the scatter plot for two bivariate distributions: the distribution in  panel (b) has some abnormal points (contaminated sample) compared to the distribution in panel (a) (clean sample). Although only a small fraction of the sample data is contaminated, both  Wasserstein distances  have a large increase in the presence of outliers. Anticipating some of the results that we will derive, we compute  also our robust Wasserstein distance $W^{(\lambda)}$ (see \S \ref{Sect_Wl}): its value remains roughly the same in both panels.

\begin{figure}[t!]
	\centering
	\begin{subfigure}[b]{0.35\textwidth}
		\centering
		\includegraphics[width=\textwidth]{OT1.eps}
		\caption{$W_1=3.0073$, $W_2=3.0247$ and $W^{(\lambda)}=2.9324 (\lambda=3)$}
		\label{fig:1a}
	\end{subfigure}
	\begin{subfigure}[b]{0.35\textwidth}
		\centering
		\includegraphics[width=\textwidth]{OT2.eps}
		\caption{$W_1=5.32491$, $W_2 = 6.6215$ and $W^{(\lambda)}=3.3142 (\lambda=3)$}
		\label{fig:1b}
	\end{subfigure}
	\caption{ Wasserstein distance ($W_1$ and $W_2$) and robust Wasserstein distance ($W^{(\lambda)}$) between two bivariate distributions.
 The scatter plot of data in panel (a) represents a sample from the reference model:  cross points (blue) are generated from $ \mathcal{N}\left( \binom{-1}{-1},I_2 \right) $,  points (orange) are generated from $ \mathcal{N}\left( \binom{1}{1},I_2 \right) $; whilst the plot in panel (b) contains some outliers: cross points (blue) are generated from $0.8  \mathcal{N}\left( \binom{-1}{-1},I_2 \right)+0.2\mathcal{N}\left( \binom{-9}{-9},I_2 \right) $, points (orange) are generated from $ \mathcal{N}\left( \binom{1}{1},I_2 \right) $. The marginal distributions are on the $x$- and $y$-axis.}
	\label{fig1}
\end{figure}

\subsection{Robust OT (ROBOT)}

\subsubsection{Primal formulation}

Before introducing $W^{(\lambda)}$, we recall the ROBOT problem as defined in
\cite{mukherjee2021outlier}, who introduce a modified version of Monge-Kantorovich OT problem. Mukherjee et al. work on the notion of unbalanced OT:  they consider
a TV-regularized OT re-formulation
\begin{equation}\label{equ7}
	\begin{array}{ll}
		& \min _{\pi, s}  \iint c(x, y) \pi(x, y) d x d y+\lambda\|s\|_{\mathrm{TV}} \\
		\text {s.t.} & \int \pi(x, y) d y=\mu(x)+s(x) \geq 0 \\
		& \int \pi(x, y) d x=\nu(y) \\
		& \int s(x)dx=0,
	\end{array}
\end{equation}
where $\lambda>0$ is a regularization parameter. In (\ref{equ7}), the original source  measure $\mu$ is modified by adding $s$ (nevertheless, the first and last constraints ensure that $\mu + s$ is still a valid probability measure). Intuitively, having $\mu(x) +s(x)=0$ means that  $x \in {\cal X}$ has strong impact on the OT problem and hence can be labelled as an outlier. The outlier is eliminated from the sample, since the probability measure $\mu+s$ at this point is zero.

\cite{mukherjee2021outlier} prove that a simplified, computationally efficient  formulation equivalent to \eqref{equ7} is available. It  takes the form
\begin{equation} \label{equ8}
	\inf \left\lbrace  \int_{\mathcal{X\times X}} c_{\lambda}(x,y) d \pi(x,y) : \pi \in \Pi(\mu,\nu) \right\rbrace,
\end{equation}
which has a functional form similar to \eqref{equ2}, but the cost function $c$ is replaced by the trimmed cost function
$c_{\lambda}=\min\left\lbrace c, 2\lambda \right\rbrace$
that is bounded from above by $2\lambda$. Following \cite{mukherjee2021outlier}, we call formulations \eqref{equ7} and \eqref{equ8} ROBOT. The proof of the equivalence between \eqref{equ7} and \eqref{equ8} can be found in \cite{mukherjee2021outlier}. We emphasize that \eqref{equ8}  can be solved efficiently by various  optimization algorithms developed for  standard OT, since \eqref{equ8} has the same form as \eqref{equ2}.

\subsubsection{Dual formulation}

Besides the primal form, the dual form of OT is the theoretical basis of some machine learning models \cite{kolouri2017optimal}, including WGAN and domain adaptation problems. In this section, we drive the dual form of the ROBOT, which is not available in the original paper  \cite{mukherjee2021outlier}.

\begin{thm}\label{thm3}
	Let $ \mu,\nu $ be probability measures in $ \mathcal{P(X)} $,
	and set the cost function $c_{\lambda}(x,y)$ as in (\ref{Eqc_l}). Then the {\rm c-transform} of a c-convex function $\psi(x)$ is itself, i.e. $\psi^{c}(x)= \psi(x)$. Moreover, the  dual form of ROBOT is related to the Kantorovich potential $\psi$, which is a solution to
	\begin{equation}
		\sup \left\lbrace \int_{\mathcal{X}} \psi d\mu - \int_{\mathcal{X}} \psi  d\nu : \psi \in C_b(\mathcal{X})  \right\rbrace, \label{Eq_DualROBOT}
	\end{equation}
	where $ \psi $ satisfies  $\vert \psi(x)-\psi(y) \vert \leq d(x,y)$ and $\mathrm{range} (\psi) \leq 2\lambda $.

\end{thm}

Note that the  difference between the dual form of OT and  that of ROBOT is that the latter imposes a restriction on the range of $\psi$. Thanks to this remark, we may think of using the ROBOT in theoretical proofs and inference problems where the dual form of OT is already applied, with the advantage that ROBOT-based inference remains stable and reliable even in the presence of outliers. In the next sections, we illustrate some of these uses.

\section{Robust Wasserstein distance $W^{(\lambda)}$ }\label{Sec:Theory}

We are now ready to define a novel concept of distance based on ROBOT. To begin with, we notice that the modified cost function can be regarded as a metric on $\mathcal{X}$. We will show that this metric defines a novel distance ($W^{(\lambda)}$), which we call robust Wasserstein distance. Similarly to classical Wasserstein distance, $W^{(\lambda)}$ characterizes the weak convergence of probability measures.

\subsection{Key notions}
\label{Sect_Wl}
\vspace{2mm}

Setting $c(x, y) = d(x, y)$, \eqref{equ5} implies that the corresponding minimal cost $W_1(\mu, \nu)$ is a metric between two probability measures $\mu$ and $\nu$. A similar result can be obtained also in the ROBOT setting of~\eqref{equ8}, if the modified cost function takes the form
\begin{equation}
	c_{\lambda}(x,y) := \min \left\lbrace  d(x,y),2\lambda \right\rbrace. \label{Eqc_l}
\end{equation}
\begin{lemma}\label{lemma1}
	Let $d(\cdot,\cdot)$ denote a metric on ${\cal X}$ and $ c(x,y)=d(x,y) $. Then $c_{\lambda}(x, y) $ in (\ref{Eqc_l}) is also a metric on ${\cal X}$.
\end{lemma}

Based on Lemma~\ref{lemma1},  we define the robust Wasserstein distance and prove that it is a metric on $\mathcal{P(X)}$.

\begin{thm}\label{thm1}
	For $c_{\lambda}(x, y), x, y \in {\cal X},$ defined in (\ref{Eqc_l}),
\begin{equation} \label{Eq:Wl}
W^{(\lambda)}(\mu,\nu) :=  \inf \limits_{\pi \in \Pi(\mu,\nu)} \left\lbrace  \int_{\mathcal{X\times X}} c_{\lambda}(x,y) d \pi(x,y) \right\rbrace
\end{equation}
is a metric on $\mathcal{P(X)}$, and we call it robust Wasserstein distance.
\end{thm}

It is worth noting that $W_p$ is well defined  only if probability measures have finite $p$-th order moments. In contrast,  thanks to the boundedness of the $c_\lambda$, our  $W^{(\lambda)}$ in (\ref{Eq:Wl}) can be applied to  all  probability measures, even those with infinite moments of any order.

\begin{definition}[Robust Wasserstein space]\label{def1}
	A robust Wasserstein space is an ordered pair $(\mathcal{P(X)}, W^{(\lambda)})$, where $\mathcal{P(X)}$ is the set of all probability measures on a complete separable metric space $\mathcal{X}$, and $W^{(\lambda)}$ defined in Theorem~\ref{thm1} is a (finite) distance on $\mathcal{P(X)}$.

\end{definition}

\subsection{Some measure theoretic properties}

 It is interesting to connect $W_1$ to $W^{(\lambda)}$, via the characterization of the limiting behavior of $W^{(\lambda)}$ for $\lambda \rightarrow \infty$. Since the robust Wasserstein distance is continuous and  monotonically increasing with respect to $\lambda$, one can prove (via dominated convergence theorem) that its limit coincides with the Wasserstein distance of order $p=1$.

\begin{thm}\label{thm2}
	For any probability measures $\mu$ and $\nu$ in ${\cal P}({\cal X})$, $W^{(\lambda)}$ is continuous and  monotonically non-decreasing with respect to $\lambda \in [0,\infty)$. Moreover, if $ W_1(\mu,\nu)  $ exists, we have

		$\lim_{\lambda \rightarrow \infty} W^{(\lambda)}(\mu,\nu) =W_1(\mu,\nu).$

\end{thm}
Th. \ref{thm2} has a two-fold implication: first,  the  robust Wasserstein distance  cannot be greater than the Wasserstein distance; second,
for large values of the regularization parameter, $W^{(\lambda)}$ and $W_1$ behave similarly.

Another  important property of   $W^{(\lambda)}$ is that weak convergence of probability measures is entirely characterized by convergence in the robust Wasserstein distance.
\begin{thm}\label{thm4}
	Let $\left(\mathcal{X},d \right)$ be a Polish space. Then
	$W^{(\lambda)}$ metrizes the weak convergence in $\mathcal{P({X})}$.
	In other words, if $\left(\mu_{k}\right)_{k \in \mathbb{N}}$ is a
	sequence of measures in $\mathcal{P(X)}$ and $\mu$ is another
	measure in $\mathcal{P(X)}$, then the statements
	$
	\left(\mu_{k}\right)_{k \in \mathbb{N}} \, \, \text{converges
		weakly in} \, \, \mathcal{P(X)} \, \,  \text{to} \,\, \mu
	$
	and $ W^{(\lambda)}\left(\mu_{k}, \mu\right) \rightarrow 0$
	are equivalent.
\end{thm}

The next result follows immediately from Theorem~\ref{thm4}.
\begin{corollary}[Continuity of $ W^{(\lambda)} $]\label{cor1}
	For a Polish space   $ (\mathcal{X },d) $,  suppose that $ \mu_k \, (resp. \, \nu_k) $ converges weakly to $ \mu \, (resp.\, \nu) $ in $ \mathcal{P(X)} $ as $k \rightarrow \infty$. Then
	$W^{(\lambda)}(\mu_k,\nu_k) \rightarrow W^{(\lambda)}(\mu,\nu).$
\end{corollary}

Finally, we  prove the separability and completeness of robust Wasserstein space, when $ \mathcal{X} $ is separable and complete. To this end, we state
\begin{thm}\label{thm5}
	Let $\mathcal{X}$ be a complete separable metric space. Then the space $\mathcal{P(X)}$, metrized by the robust Wasserstein distance $W^{(\lambda)}$, is complete and separable.  Moreover, the set of  finitely supported measures with rational coefficients is dense in $ \mathcal{P(X)} $.
\end{thm}

\subsection{A Sanov's type theorem}

As remarked by \cite{bolley2007quantitative},
using $W_p$ as a distance between probability measures, transportation inequalities state that, given $\alpha>0$, a probability measure $\mu$ on $X$ satisfies $T_p(\alpha)$ if the inequality
$ W_p(\mu,\nu) \leq \sqrt{{2}H(\mu \vert \nu)/{\alpha}}$
holds for any probability measure $\nu$, with $H(\mu \vert \nu)$ being the Kullback-Leibler divergence. Note that since $W	^{(\lambda)} \leq W_1$ (see Theorem~\ref{thm3}), we can immediately claim
that a measure which satisfies a $T_1$ inequality is such that, for $\lambda>0$
$W^{(\lambda)}(\mu,\nu) \leq \sqrt{{2}H(\mu \mid \nu)/{\alpha}}$.
Now, moving along the same lines as in \cite{bolley2007quantitative}, we can also easily obtain a variant of Sanov's theorem.

\begin{thm}\label{thmCI}

Let $\mu$ be a probability measure on $\mathbb{R}^d$, which satisfies a $T_1(\alpha)$ inequality, and $\{X_1,...,X_n\}$ be a random sample of independent variables, all distributed according to $\mu$; let also
$\hat{\mu}_n:= n^{-1} \sum_{i=1}^n \delta_{X_i}$
be the associated empirical measure, where $\delta_x$ is the Dirac distribution with mass on $x \in \mathbb{R}^d$. Then, for any $d^{\prime}>d$ and $\alpha^{\prime}<\alpha$, there exists some constant $n_0$, depending only on $\alpha^{\prime}, d^{\prime}$ and some square-exponential moment of $\mu$, such that for any $\varepsilon>0$ and $n \geq n_0 \max \left(\varepsilon^{-\left(d^{\prime}+2\right)}, 1\right)$, we have
${\rm P}\left[W^{(\lambda)}\left(\mu, \hat{\mu}_n\right)>\varepsilon\right] \leq \mathrm{e}^{- \frac{\lambda^{\prime}}{2} n \varepsilon^2}.$
\end{thm}

We omit the proof, which follows along the lines as the proof of Th. 2.1 in Bolley et al. combined with the remark that $
\mathrm{exp}\{- 0.5 \lambda^{\prime} n \varepsilon^2\} \geq {\rm P}\left[W_1\left(\mu, \hat{\mu}_n\right)>\varepsilon\right] \geq {\rm P} \left[W^{(\lambda)}(\mu,\hat\mu_n)>\varepsilon\right].
$

\section{Minimum $W^{(\lambda)}$  estimation}\label{Robust Wasserstein estimator}

Many applications in statistics and machine learning consider estimation methods based on the minimization (over the parameter space) of a distance between a model distribution (either a density or a distribution function)
and the empirical distribution of the data. We refer to \cite{bassetti2006minimum},  \cite{bernton2019parameter} and \cite{genevay2018learning} for methods based on
$W_p$  or its entropy regularized version.
In this paper, we propose a new class of estimators based on the robust Wasserstein distance. The theoretical properties established in \S~\ref{Sec:Theory} allow us to define a novel inference procedure based on the   minimization of $W^{(\lambda)}$. We prove that the resulting estimators exist and are consistent (at the reference model). Moreover, when compared to the estimators which  minimize  $W_p$, the boundedness of $c_\lambda$ implies that our novel estimators are no longer limited to those random variables having finite $p$-th ($ p\geq 1 $) moments. Thanks to this aspect, we are able to consider a large class of statistical (generative) models: we extend the application of inference procedures based on optimal transportation techniques. Always thanks to the boundedness of $c_\lambda$, our novel estimators resist to outliers.

\subsection{Estimation method}\label{Sec.EstMethod}

Let us consider a probability space $(\Omega, \mathcal{F}, {\rm P})$, with expectation denoted by $\rm {E}$. On this probability space,  we define random variables taking values on $\mathcal{X} \subset \mathbb{R}^d, d \geq 1$ and endowed with the Borel $\sigma$-algebra. We observe $n \in \mathbb{N}$ i.i.d. data points $\{X_1, \ldots, X_n\}$, which are distributed according to $\mu_{\star}^{(n)} \in \mathcal{P}\left(\mathcal{X}^n\right)$. Let
$\hat{\mu}_n=n^{-1} \sum_{i=1}^n \delta_{X_i}$
be the corresponding empirical distribution.  A parametric statistical model  on $ \mathcal{X}^n $ is denoted by  $ \{\mu_{\theta}^{(n)} \}_{\theta \in \Theta} $ and it is a collection of probability distributions indexed by a parameter $\theta$ of dimension $d_{\theta}$.  The parameter space is $ \Theta \subset \mathbb{R}^{d_\theta}, d_{\theta} \geq 1  $, which is equipped with a distance  $\rho_{\Theta}$.  We let  $Z_{1: n}$ represent the observations from  $\mu_{\theta}^{(n)}$. For every $\theta \in$ $\Theta$, the sequence $\left(\hat{\mu}_{\theta, n}\right)_{n \geq 1}$ of random probability measures on $\mathcal{X}$ converges (in some sense) to a distribution $\mu_\theta \in \mathcal{P}(\mathcal{X})$, where $\hat{\mu}_{\theta, n}=n^{-1} \sum_{i=1}^n \delta_{Z_i}$ with $Z_{1: n} \sim \mu_\theta^{(n)}$. Similarly, we will  assume that $\hat{\mu}_n$ converges  (in some sense) to some distribution $\mu_{\star} \in \mathcal{P}(\mathcal{X})$ as $n \rightarrow \infty$.
We say that the model is well-specified if there exists $\theta_\star \in \Theta$ such that $\mu_\star\equiv  \mu_{\theta_\star}$; otherwise, it is misspecified. Parameters are identifiable: $\theta_1 = \theta_2$ is implied by
$\mu_{\theta_1}=\mu_{\theta_2}$.

Our estimation method relies on selecting  a parametric model in $ \{\mu_{\theta}^{(n)} \}_{\theta \in \Theta} $, which is the closest, in robust Wasserstein distance, to the true model $\mu_{\star}$.
 Thus, minimum $W^{(\lambda)}$ estimation refers to the minimization, over the parameter $\theta \in \Theta$, of the robust Wasserstein distance between the empirical distribution $\hat{\mu}_n$ and the reference model distribution $\mu_\theta$. This is similar to the approach described in \cite{bassetti2006minimum} and \cite{bernton2019parameter}, who derive minimum Kantorovich estimators by making use of  $W_p$. More formally, denoted  by $W^{(\lambda)}$  the  Wasserstein distance on $\mathcal{P}(\mathcal{X})$, the associated {\it minimum robust Wasserstein estimator} (MRWE) is defined as
$	\hat{\theta}_n^{\lambda} =\underset{\theta \in \Theta}{\operatorname{argmin}} W^{(\lambda)}\left(\hat{\mu}_n, \mu_\theta\right)$.
When there is no explicit expression for the probability measure characterizing the  parametric model (e.g. in complex generative models, see \cite{genevay2018learning} and \S~\ref{Sec.SimWesti} for some examples), the computation of MRWE can be difficult. To cope with this issue, we propose using the  {\it minimum expected robust Wasserstein estimator} (MERWE)
defined as
\begin{equation}\label{MERWE}
	\hat{\theta}_{n, m}^{\lambda} =\underset{\theta \in \Theta}{\operatorname{argmin}} {\rm E}_m \left[  W^{(\lambda)}\left(\hat{\mu}_n, \hat{\mu}_{\theta, m}\right)\right] .
\end{equation}
where the expectation $ \mathrm{E}_m $  is taken over  the distribution $ \mu^{(m)}_{\theta} $.
To implement the MERWE one can rely on  Monte Carlo methods and approximate numerically
$ {\rm E}_m [W^{(\lambda)}\left(\hat{\mu}_n, \hat{\mu}_{\theta, m}\right)] $. Replacing the robust Wasserstein distance with the classical Wasserstein distance in the definition of the MRWE, one obtains the {minimum  Wasserstein estimator} (MWE) and the minimum expected  Wasserstein estimator (MEWE), studied  in \cite{bernton2019parameter}.

\subsection{Statistical guarantees }

Intuitively, the consistency of the MRWE and MERWE can be conceptualized as follows. We expect that the empirical measure converges to $\mu_\star$, in the sense that $W^{(\lambda)}(\hat{\mu}_n,\mu_\star)\rightarrow 0$ as $n\rightarrow \infty$; see Th. \ref{thm4}. Therefore,
the $\arg \min$ of $W^{(\lambda)}(\hat{\mu}_n,\mu_\star)$ should converge to the $\arg \min$ of $W^{(\lambda)}(\mu_\star,\mu_{\theta} )$, which is denoted by $\theta_\star$,
assuming its existence and unicity. The same can be said for the minimum of the MERWE, provided that $m\rightarrow \infty$. If the reference parametric model is correctly specified (e.g. no data contamination), $\theta_\star$ is the limiting object of interest and it is
the minimizer of $W^{(\lambda)}(\mu_\star,\mu_{\theta} )$. In the case of model misspecification (e.g. wrong parametric form of $\mu_\theta$ and/or presence of data contamination), $\theta_\star$ is not necessarily the parameter that minimizes the KL divergence between the empirical measure and the measure characterizing the reference model. We emphasize that this is at odd with the standard misspecification theory (see e.g. \cite{white1982maximum}) and it is due to the fact that we replace the KL divergence (which yields non robust estimators) with our novel robust Wasserstein distance.

To formalize these arguments,
we introduce the following set of assumptions, which are standard in the literature on MKE; see \cite{bernton2019parameter}.

\begin{Assumption}\label{asum1}
	The data-generating process is such that $W^{(\lambda)}\left(\hat{\mu}_n, \mu_{\star}\right) \rightarrow 0, {\rm P}$-almost surely as $n \rightarrow \infty$.
\end{Assumption}

\begin{Assumption}\label{asum2}
	The map $\theta \mapsto \mu_\theta$ is continuous in the sense that $\rho_{\Theta}\left(\theta_n, \theta\right) \rightarrow 0$ implies that $\mu_{\theta_n} $ convergences to $ \mu_\theta$ weakly as $n \rightarrow \infty$.
\end{Assumption}

\begin{Assumption}\label{asum3}
 For some $\varepsilon>0$,
$B_{\star}(\varepsilon)=\left\{\theta \in \Theta: W^{(\lambda)}\left(\mu_{\star}, \mu_\theta\right) \leq \varepsilon_{\star}+\varepsilon\right\}$, with  $\varepsilon_{\star}=\inf _{\theta \in \Theta} W^{(\lambda)}\left(\mu_{\star}, \mu_\theta\right)$,  is a  bounded set.
\end{Assumption}

Then we state the following
\begin{thm}[Existence of MRWE]\label{thm6}
	Under Assumptions~\ref{asum1},\ref{asum2} and \ref{asum3}, there exists a set ${\cal A} \subset \Omega$ with ${\rm P}({\cal A})=1$ such that, for all $\omega \in {\cal A}$,
	$
	\inf_{\theta \in \Theta} W^{(\lambda)}\left(\hat{\mu}_n(\omega), \mu_\theta\right) \rightarrow \inf _{\theta \in \Theta} W^{(\lambda)}\left(\mu_{\star}, \mu_\theta\right)
	$
	and there exists $n(\omega)$ such that, for all $n \geq n(\omega)$, the sets $\operatorname{argmin}_{\theta \in \Theta} W^{(\lambda)}\left(\hat{\mu}_n(\omega), \mu_\theta\right)$ are non-empty and form a bounded sequence with
	$
	\limsup _{n \rightarrow \infty} \underset{\theta \in \Theta}{\operatorname{argmin}} W^{(\lambda)}\left(\hat{\mu}_n(\omega), \mu_\theta\right) \subset \underset{\theta \in \Theta}{\operatorname{argmin}} W^{(\lambda)}\left(\mu_{\star}, \mu_\theta\right) .
	$
\end{thm}
To prove Th.~\ref{thm6} we need to show that  the sequence of functions $\theta \mapsto W^{(\lambda)}\left(\hat{\mu}_n(\omega), \mu_\theta\right)$ epi-converges (see Definition~\ref{def.EpiConverge} in Appendix~\ref{App:proof}) to $\theta \mapsto W^{(\lambda)}\left(\mu_{\star}, \mu_\theta\right)$. The result follows from \cite{rockafellar2009variational}.

\textbf{Remark}. Th.~\ref{thm6} generalizes the results of \cite{bassetti2006minimum} and \cite{bernton2019parameter}, where the model is assumed to be well
specified (\cite{bassetti2006minimum}) and moments of order $p\geq 1$ are needed (\cite{bernton2019parameter}).
We believe that Th.~\ref{thm6} can be applied also to time series, but a careful theoretical analysis of the time series setting deserves a separate paper. Our educated guess is that one can deal with short- and long-memory processes, moving along the lines of  \cite{felix2022}, who work in the frequency domain.

Moving along the same lines as in Th. 2.1 in \cite{bernton2019parameter}, we may
prove the measurability of MRWE; see Th. \ref{thm7} in Appendix A.
These  results  for the MRWE provide the stepping stone to derive similar  theorems for the MERWE $\hat{\theta}_{n, m}^{\lambda}$. To this end, the following assumptions are needed.

\begin{Assumption}\label{asum4}
	For any $m \geq 1$, if $\rho_{\Theta}\left(\theta_n, \theta\right) \rightarrow 0$, then $\mu_{\theta_n}^{(m)}$ converges to $\mu_\theta^{(m)}$ weakly as $n \rightarrow \infty$.
\end{Assumption}

\begin{Assumption}\label{asum5}
	If $\rho_{\Theta}\left(\theta_n, \theta\right) \rightarrow 0$, then ${\rm E}_n W^{(\lambda)}\left(\mu_{\theta_n}, \hat{\mu}_{\theta_n, n}\right) \rightarrow 0$ as $n \rightarrow \infty$.
\end{Assumption}

\begin{thm}[Existence of MERWE]\label{thm8}
	Under Assumptions~\ref{asum1},\ref{asum2},\ref{asum3},\ref{asum4} and \ref{asum5}, there exists a set ${\cal A} \subset \Omega$ with ${\rm P}({\cal A})=1$ such that, for all $\omega \in {\cal A}$, $$
	\inf _{\theta \in \Theta} {\rm E}_{m(n)}\left[  W^{(\lambda)}\left(\hat{\mu}_n(\omega), \hat{\mu}_{\theta, m(n)}\right)\right]  \rightarrow \inf _{\theta \in \Theta} W^{(\lambda)}\left(\mu_{\star}, \mu_\theta\right) $$
	and there exists $n(\omega)$ such that, for all $n \geq n(\omega)$, the sets
	$\operatorname{argmin}_{\theta \in \Theta} W^{(\lambda)}\left(\hat{\mu}_n(\omega), \hat{\mu}_{\theta, m(n)}\right)$
	are non-empty and form a bounded sequence with
	$$
	\limsup _{n \rightarrow \infty} \underset{\theta \in \Theta}{\operatorname{argmin}} {\rm E}_{m(n)} \left[ W^{(\lambda)}\left(\hat{\mu}_n(\omega), \hat{\mu}_{\theta, m(n)}\right)\right]  \subset \underset{\theta \in \Theta}{\operatorname{argmin}} W^{(\lambda)}\left(\mu_{\star}, \mu_\theta\right).
	$$
\end{thm}
For a generic function $f$, let us define
$\varepsilon\text{-}\operatorname{argmin}_x f := \left\{x: f(x) \leq \varepsilon+\inf _x f\right\}$. Then, we state the following

\begin{thm}[Measurability of MERWE]\label{thm9}
	Suppose that $\Theta$ is a $\sigma$-compact Borel measurable subset of  $\mathbb{R}^{d_\theta}$. Under Assumption~\ref{asum4}, for any $n \geq 1$ and $m \geq 1$ and $\varepsilon>0$, there exists a Borel measurable function $\hat{\theta}_{n, m}: \Omega \rightarrow \Theta$ that satisfies $\hat{\theta}_{n, m}^{\lambda} (\omega) \in \operatorname{argmin}_{\theta \in \Theta} {\rm E}_m\left[  W^{(\lambda)} \left(\hat{\mu}_n(\omega), \hat{\mu}_{\theta, m}\right)\right] ,$   { if this set is non-empty}. Otherwise,  $\hat{\theta}_{n, m}^{\lambda} (\omega) \in \varepsilon\text{-}\operatorname{argmin}_{\theta \in \Theta} {\rm E}_m\left[  W^{(\lambda)}\left(\hat{\mu}_n(\omega), \hat{\mu}_{\theta, m}\right)\right].$

\end{thm}

Considering the case where the data and $n$ are fixed, the next result shows that the MERWE converges to the MRWE, as $m \rightarrow \infty$. In the next assumption,  the observed empirical distribution is kept fix and $\varepsilon_n=\inf _{\theta \in \Theta} W^{(\lambda)}\left(\hat{\mu}_n, \mu_\theta\right)$.

\begin{Assumption}\label{asum6}
	For some $\varepsilon>0$, the set $B_n(\varepsilon)=\left\{\theta \in \Theta: W^{(\lambda)}\left(\hat{\mu}_n, \mu_\theta\right) \leq \varepsilon_n+\varepsilon\right\}$ is bounded.
\end{Assumption}

\begin{thm}[MERWE converges to MRWE as $ m \rightarrow  \infty $]\label{thm10}
	Under Assumptions~\ref{asum2},\ref{asum4},\ref{asum5} and \ref{asum6},
	$$
	\inf _{\theta \in \Theta} {\rm E}_m\left[  W^{(\lambda)}\left(\hat{\mu}_n, \hat{\mu}_{\theta, m}\right) \right]  \rightarrow \inf _{\theta \in \Theta} W^{(\lambda)}\left(\hat{\mu}_n, \mu_\theta\right),
	$$
	and there exists a $\tilde{m}$ such that, for all $m \geq \tilde{m}$, the sets $\operatorname{argmin}_{\theta \in \Theta} {\rm E}_m W^{(\lambda)}\left(\hat{\mu}_n, \hat{\mu}_{\theta, m}\right)$ are non-empty and form a bounded sequence with
	$$
	\limsup _{m \rightarrow \infty} \underset{\theta \in \Theta}{\operatorname{argmin}} {\rm E}_m \left[ W^{(\lambda)}\left(\hat{\mu}_n, \hat{\mu}_{\theta, m}\right)\right]  \subset \underset{\theta \in \Theta}{\operatorname{argmin}} W^{(\lambda)}\left(\hat{\mu}_n, \mu_\theta\right).
	$$
\end{thm}

\section{Numerical experiments}\label{Sec:Applications}

\subsection{Sensitivity to outliers}

The sensitive curve is an empirical tool
that illustrates the stability of statistical functionals; see
\cite{tukey1977exploratory} and \cite{hampel1986robust} for a book-length presentation.
We consider a similar tool to study the sensitivity of $W_1$ and $W^{(\lambda)}$ in  finite samples, both interpreted as functions of the empirical measure. More in detail,
we fix the standard normal distribution as a reference model (for this distribution both $W^{(\lambda)}$ and $W_1$ are well-defined) and we use it to generate a  sample of size  $n=1000$.  We denote the resulting sample $ \mathbf{X}_{n}:=(X_1, \ldots, X_{n})$, whose empirical measure is $\hat{\mu}_{n}$. Then, we replace $X_n $ with a value $ x \in \mathbb{R} $  and  form a new set of sample points, denoted by $ \mathbf{X}_{n}(x)$,  whose empirical measure is $\hat{\mu}^{(x)}_{n}$.
We let $ T_n $ represent the  robust Wasserstein distance between an $ n $-dimensional sample and $ \mathbf{X}_{n} $.   So, $ T_{n}(\mathbf{X}_{n})  $ is the empirical robust Wasserstein distance between $ \mathbf{X}_{n} $ and its self, thus it is equal to $0$, while  $ T_{n}(\mathbf{X}_{n}(x)) $ is the empirical robust Wasserstein distance between $ \mathbf{X}_{n}(x) $ and $ \mathbf{X}_{n} $. Finally, for different values of $x$ and $\lambda$,  we  compute $\Delta(x,W^{(\lambda)})=n\left[T_n\left(X_1, \ldots, X_{n-1}, x\right)-T_{n}\left(X_1, \ldots, X_{n}\right)\right]=n W^{(\lambda)}(\hat{\mu}_{n},\hat{\mu}^{(x)}_{n}).$  A similar procedure  is applied to obtain  $\Delta(x,W_1)$ for $W_1$. Since both $W^{(\lambda)}$ and $W_1$ do not admit a closed form expression, we approximate them numerically. We display the results in Figure~\ref{fig:SCofWasserstein}.
For each value of $\lambda$, the plots illustrate that $\Delta(x,W^{(\lambda)})$ first grows and then remains flat (at the value of $2\lambda$) even for very large values of $\vert x \vert$. In contrast, for $\vert x \vert \to \infty$, $\Delta(x,W_1)$ diverges, in line with the evidence from (and the comments on) Figure \ref{fig1}.
In addition, we notice that as $ \lambda \rightarrow \infty $, the plot of  $\Delta(x,W_1)$ becomes more and more similar to the one of $\Delta(x,W^{(\lambda)})$: this aspect is in line with Th. \ref{thm2} and it  is reminiscent of the behavior of the Huber loss function (\cite{huber1992robust}) for location estimation, which converges to the quadratic loss (maximum likelihood estimation), as the  constant tuning  the robustness goes to infinity. However, an important remark is order: the cost $c_\lambda$ yields, in the language of robust statistics, the so-called ``hard rejection'': it bounds the influence of outlying values (to be contrasted with the behavior of Huber loss, which downweights outliers to preserve efficiency at the reference model); see  \cite{ronchetti2022} for a similar comment.

\begin{figure}[htbp]
	\centering
	\includegraphics[scale=0.2]{SC_0.eps}
	\caption{The continuous line represents $\Delta(x,W_1)$. The dashed (red), dot-dashed (blue) and dotted (green) line represents $\Delta(x,W^{(\lambda)})$ with $ \lambda=3,4, 5 $ respectively. }
	\label{fig:SCofWasserstein}
\end{figure}

\subsection{Estimation of location}

Let us consider problem of inference on univariate location models. We study the robustness of MERWE, comparing its performance to the one of MEWE, under different degrees of data contamination and for different underlying data generating models.
Before delving into the numerical exercise,
let us give some numerical details. To this end, we recall that the MERWE aims at minimizing the function
$\theta \mapsto {\rm{E}}_{m}\left[  W^{(\lambda)}\left(\hat{\mu}_n, \hat{\mu}_{\theta, m}\right) \right].$  With the same notation as in Section~\ref{Sec.EstMethod}, suppose we generate $k$ replications $Z_{1: m}^{(i)}, i = 1, \ldots, k,$ independently from a reference model $\mu_{\theta}^{(m)}$, and let $\hat{\mu}_{\theta, m}^{(i)}$ denote the empirical probability measure of $Z_{1: m}^{(i)}$. Then the loss function $L_{\text{MERWE}} = k^{-1} \sum_{i=1}^k W^{(\lambda)}\left(\hat{\mu}_n, \hat{\mu}_{\theta, m}^{(i)}\right)$ is a natural estimator of ${\rm E}_m [ W^{(\lambda)}\left(\hat{\mu}_n, \hat{\mu}_{\theta, m}\right)]$, since the former converges almost surely to the latter as $k \rightarrow \infty$.
We note that  the algorithmic complexity in $m$ is super-linear  while the complexity in $ k $ is linear. The incremental cost of increasing $ k $ is typically lower than that one of increasing $ m $.
In our numerical experiments, we obtained the estimator (the minimizer of $L_{\text{MERWE}}$) using   $\mathsf{optimize}$ in $ \mathsf{R} $.

\subsubsection{Finite moments}\label{Sec.SimWesti}

We consider a reference model which is the sum of log-normal random variables. For a given $L \geq 1$, $\gamma \in \mathbb{R}$ and $\sigma>0$, we have $X = \sum_{l=1}^L \exp \left(Z_{l}\right),$
where $Z_1, \ldots, Z_L$ are sampled from $\mathcal{N}\left(\gamma, \sigma^2\right)$ independently.
Suppose we are interested in estimating the location parameter $\gamma$. We investigate the performance of  MERWE and MEWE, under different scenarios: namely,
in presence of outliers, for different sample sizes and  contamination values. Specifically, we consider the model
$ X_i^{(n)} = \sum_{l=1}^L \exp(Z_{i_l}^{(n)}), l=1, \ldots, L, i = 1, \ldots, n,$
where $Z_{i_l}^{(n)} \sim \mathcal{N}(\gamma,\sigma)$ for $i = 1, \ldots, n_1$ (clean part of the sample) and $Z_{i_l}^{(n)} \sim \mathcal{N}(\gamma + \eta,\sigma)$ for $i = n_1+1, \ldots, n$ (contaminated part of the sample). Therefore, in each sample, there are $n-n_1$ outliers of size $\eta$. In our simulation experiments, we set $ L=10 $, $\gamma = 0$ and $ \sigma=1 $. To implement the MERWE and MEWE of $\gamma$, we choose $m=1000 $, $k=20$ and $\lambda = 5$.

The bias and MSE, based on $1000$ replications, of the estimators are displayed in Table~\ref{tab:Estimator}, for various sample sizes $n$, different contamination size $\eta$ and proportion of contamination $\varepsilon$.
The table illustrates the superior performance (both in terms of bias and MSE) of the MERWE with respect to the MEWE. In small samples ($n=100$), the MERWE has smaller bias and MSE than the MEWE, in all settings.  Similar results are available in moderate and large sample size $(n=200$ and $n=1000$). Interestingly, for $n=1000$, MERWE and MEWE have similar performance when $ \varepsilon=0 $ (no contamination), whilst the MERWE still has smaller MSE for $\varepsilon>0$. This implies that the MERWE maintains good efficiency with respect to MEWE at the reference model. Therefore, in the location setting described here, the use of the MERWE and ROBOT should be preferred instead of the MEWE and OT: robustness is gained with a small MSE loss at the reference model, while preserving the computational aspects and the geometric interpretability of standard $W_1$ minimization.

\begin{table}[htbp]
	\centering
	\scalebox{0.62}[0.62]{
		\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
			\hline
			\multicolumn{1}{|c|}{\multirow{3}[6]{*}{SETTINGS}} & \multicolumn{4}{c|}{n=100}    & \multicolumn{4}{c|}{n=200}   & \multicolumn{4}{c|}{n=1000} \bigstrut\\
			\cline{2-13}          & \multicolumn{2}{c|}{BIAS} & \multicolumn{2}{c|}{MSE} & \multicolumn{2}{c|}{BIAS} & \multicolumn{2}{c|}{MSE} & \multicolumn{2}{c|}{BIAS} & \multicolumn{2}{c|}{MSE} \bigstrut\\
			\cline{2-13}          & \multicolumn{1}{c|}{MERWE} & \multicolumn{1}{c|}{MEWE} & \multicolumn{1}{c|}{MERWE} & \multicolumn{1}{c|}{MEWE} & \multicolumn{1}{c|}{MERWE} & \multicolumn{1}{c|}{MEWE} & \multicolumn{1}{c|}{MERWE} & \multicolumn{1}{c|}{MEWE} & \multicolumn{1}{c|}{MERWE} & \multicolumn{1}{c|}{MEWE} & \multicolumn{1}{c|}{MERWE} & \multicolumn{1}{c|}{MEWE} \bigstrut\\
			\hline
			$ \varepsilon=0.1,\eta=1 $ &   0.0494  & 0.0924 & 0.0032 & 0.0097 &0.0419 & 0.0928 & 0.0024 & 0.0118  & 0.0369 & 0.0856 & 0.0016 & 0.0076  \bigstrut\\
			\hline
			$ \varepsilon=0.1,\eta=4  $&  0.0352 & 0.0898 & 0.0018 & 0.0120& 0.0290 & 0.0968 & 0.0013 & 0.0151   & 0.0136 & 0.0989 & 0.0003 & 0.0179 \bigstrut\\
			\hline
			$ \varepsilon=0.2,\eta=1 $ &0.0713  & 0.1574 & 0.0075 & 0.0283  &  0.0864 & 0.1776 & 0.0085 & 0.0334  &  0.0811 & 0.1720 & 0.0069& 0.0306 \bigstrut\\
			\hline
			$ \varepsilon=0.2,\eta=4 $ & 0.0464  &0.2041 & 0.0030& 0.0454 & 0.0345 & 0.2027 & 0.0018 & 0.0426 & 0.0171 & 0.1946 & 0.0004 & 0.0384\bigstrut\\
			\hline
			$ \varepsilon=0 $  & 0.0361  & 0.0343 & 0.0018 & 0.0018 & 0.0220 & 0.0219 &  0.0008 &  0.0007 &  0.0124 & 0.0102 & 0.0003 & 0.0002 \bigstrut\\
			\hline
		\end{tabular}%
	}
	\caption{The biases and MSEs of the MERWE and MEWE of $\gamma$ for various values of $n$, $\varepsilon$ and $\eta$. $ \varepsilon=0 $ means that we  use the data without outliers. Simulation setting: $ L=10 $, $\gamma = 0$, $ \sigma=1 $, $m=1000 $, $k=20$ and $\lambda = 5$.}

\label{tab:Estimator}%
\end{table}%

\subsubsection{Infinite moments}

\cite{yatracos2022limitations} recently illustrates that minimum Wasserstein distance estimators do not perform well for heavy-tailed distributions and suggests to avoid the use of minimum Wasserstein distance inference when the underlying distribution has infinite $ p $-th moment, with $p\geq 1$.
The theoretical developments of \S \ref{Sect_Wl} show that our MERWE does not suffer from the same criticism. In the next MC experiment, we illustrate  the good performance of MERWE when the data generating process does not admit finite first moment. We consider the problem of estimating the location parameters for a symmetric $\alpha$-stable distribution; see  e.g. \cite{samorodnitsky2017stable} for a book-length presentation.   A stable distribution is characterized by four parameter $ (\alpha,\beta,\gamma,\delta) $: $ \alpha $ is the index parameter, $ \beta $ is the skewness parameter, $ \gamma $ is the scale parameter and $ \delta $ is the location parameter. It is worth noting that stable distributions have undefined variance for $ \alpha <2 $, and undefined mean for $ \alpha \leq 1 $. We consider three parameters setting: (1) $ (\alpha,\beta,\gamma,\delta) = (0.5,0,1,0) $, which represents a heavy-tailed distribution without defined mean; (2)  $ (\alpha,\beta,\gamma,\delta) = (1,0,1,0) $ which is the standard Cauchy distribution, having undefined moment of order $ p \geq 1$; (3) $ (\alpha,\beta,\gamma,\delta) = (1.1,0,1,0) $ representing a distribution having a finite mean.
In each MC experiment, we estimate the location parameter, while the other parameters are supposed to be known. As in scenario of finite moments, we also consider the contaminated  data, where $ 1-\varepsilon $ proportion of $n$ observations is generated from $\alpha$-stable distribution with parameter $ (\alpha,\beta,\gamma,\delta) $ and the other $ \varepsilon $ proportion (outliers) comes from the distribution with parameter $ (\alpha,\beta,\gamma,\delta+\eta)  $  ($ \eta $ is the size of outliers).
We set $ m=1000$, $n =100$ and $k=20$ and repeat the experiment 1000 times  for each distribution and estimator, and we set $ \lambda=5 $ for MERWE.  We display the results in Table~\ref{tab:locationofheavytail}.
For the stable distributions, the  MEWE has larger bias and MSE than the ones yielded by the MERWE. This aspect is particularly evident for the distributions with undefined first moment, namely the Cauchy distribution and the stable distribution with $\alpha = 0.5$. These experiments, complementing the ones available in \cite{yatracos2022limitations}, illustrate that while MEWE (which is not well-defined in the considered setting) entails large bias and MSE values, MERWE is well-defined and performs well even for stable distributions with infinite moments.

\begin{table}[htbp]
	\centering
	\scalebox{0.62}[0.62]{
		\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
			\hline
			\multicolumn{1}{|c|}{\multirow{3}[6]{*}{SETTINGS}} & \multicolumn{4}{c|}{Cauchy}    & \multicolumn{4}{c|}{Stable ($ \alpha = 0.5 $)}   & \multicolumn{4}{c|}{Stable ($ \alpha=1.1 $)} \bigstrut\\
			\cline{2-13}          & \multicolumn{2}{c|}{BIAS} & \multicolumn{2}{c|}{MSE} & \multicolumn{2}{c|}{BIAS} & \multicolumn{2}{c|}{MSE} & \multicolumn{2}{c|}{BIAS} & \multicolumn{2}{c|}{MSE} \bigstrut\\
			\cline{2-13}          & \multicolumn{1}{c|}{MERWE} & \multicolumn{1}{c|}{MEWE} & \multicolumn{1}{c|}{MERWE} & \multicolumn{1}{c|}{MEWE} & \multicolumn{1}{c|}{MERWE} & \multicolumn{1}{c|}{MEWE} & \multicolumn{1}{c|}{MERWE} & \multicolumn{1}{c|}{MEWE} & \multicolumn{1}{c|}{MERWE} & \multicolumn{1}{c|}{MEWE} & \multicolumn{1}{c|}{MERWE} & \multicolumn{1}{c|}{MEWE} \bigstrut\\
			\hline
			$ \varepsilon=0.1,\eta=1 $ &    0.0844   &1.5311     & 0.0105     & 3.6278  &0.0879     & 3.1789     &  0.0114    & 13.7305  & 0.0896    & 0.6580     &  0.0114     & 1.0298  \bigstrut\\
			\hline
			$ \varepsilon=0.1,\eta=4  $&  0.2053    &  1.5291     & 0.0474      & 3.6560   & 0.1635     & 3.1738      & 0.0340     &13.7061   & 0.2069     &  0.7457     & 0.0476      & 1.0508 \bigstrut\\
			\hline
			$ \varepsilon=0.2,\eta=1 $ &0.1809     &   1.5021     &0.0376      &3.6016  &  0.1707      & 3.155      & 0.0365      &12.8389  &  0.1812     &  0.6755     &  0.0376     & 0.9418 \bigstrut\\
			\hline
			$ \varepsilon=0.2,\eta=4 $ & 0.4591     & 1.8200      &  0.2236    & 4.6906  & 0.3837       & 3.140      & 0.1659      &  12.7133 & 0.4849      &1.0722       &0.2445       & 1.8017 \bigstrut\\
			\hline
			$ \varepsilon=0 $  & 0.0459  &  1.5507     &  0.0034     &  3.7400  & 0.0447    &  3.1183     & 0.0034    &  12.6004 &  0.0419      & 0.6128      & 0.0026      &0.8939  \bigstrut\\
			\hline
		\end{tabular}%
	}
	\caption{The biases and MSEs of the MERWE and MEWE of location parameter for different distributions. Simulation setting:  $m=1000 $, $k=20$ and $\lambda = 5$.}
	\label{tab:locationofheavytail}
\end{table}%

\subsection{Generative Adversarial Networks (GAN)} \label{Sect_DA}

We propose two  RWGAN deep learning models: both approaches are based on ROBOT. The first one is  derived directly from the dual form in Th.~\ref{thm3}, while the second one is derived from~\eqref{equ7}.  We compare these two methods with routinely-applied  Wasserstein GAN (WGAN) and with the robust WGAN introduced by \cite{balaji2020robust}'. Our numerical exercises are based on Monte Carlo experiments (see Section \ref{GAN1})
and  on a real data analysis (see Section \ref{GAN2}).

\subsubsection{Robust GAN: sketch of the methodology} \label{GAN0}

GAN is a deep learning method, first proposed by \cite{goodfellow2014generative}. It is one of the most popular machine learning approaches for unsupervised learning on complex distributions; see e.g. \cite{lecun2016rl}.
GAN includes a generator and a discriminator that are both neural networks and the procedure is based on mutual game learning between them.
The  generator creates fake samples as well as possible to deceive the discriminator, while the discriminator needs to be more and more powerful to detect the fake samples. The ultimate goal of this procedure is to produce a generator with a great ability to produce high-quality samples just like the original sample.

To illustrate the connections with the ROBOT, let us consider the following GAN architecture; more details are available in the Supplementary Material (Appendix \ref{app.rwgan}). Let $ {X} \sim {\rm P_r} $ and  ${Z} \sim {\rm P}_z$, where $\rm P_r$ and ${\rm  P}_z$ denote the distribution of the reference sample and of a random sample which is the input for the generator. Then, denote by
$ G_{\theta} $ the function applied by generator (it transforms $Z$ to create fake samples, which are the output of a statistical model ${\rm P}_\theta$, indexed by the finite dimensional parameter $ \theta $) and by
$D_{\vartheta}$ the function applied by the discriminator (it is indexed by a finite dimensional  parameter $ \vartheta $, which outputs the estimate of the probability that the sample is true).
The objective function is
\begin{equation}\label{eq:GAN}
	\min_{\theta} \max_{\vartheta}	\left\lbrace {\rm E}[\log D_{\vartheta}({X})]+{\rm E}[\log (1-D_{\vartheta}(G_{\theta}{(Z)}))]\right\rbrace ,
\end{equation}
where $D_{\vartheta}(X)$ represents the probability that $X$ came from the data rather than $P_\theta$. The GAN mechanism trains $D_{\vartheta}$ to maximize the probability of assigning the correct label to both training examples and fake samples. Simultaneously, it trains $G_{\theta}$ to minimize $\log(1-D(G(z)))$.
In other words,
we would like to train $ G_{\theta} $ such that $\mathrm{P_\theta}$ is very close (in some distance or divergence) to $\mathrm{P_r} $.

Despite its popularity, GAN has some inference issues. For instance, during the training, the generator may collapse to a setting where it always produces the same samples or
fast vanishing gradient. Thus, training GANs is  a delicate and unstable numerical and inferential task;  see  \cite{arjovsky2017wasserstein}.
To overcome these problems, Arjovsky et al.  propose the so-called Wasserstein GAN (WGAN) based on Wasserstein distance. The main idea is still based on mutual learning, but rather
than using a discriminator to predict the probability of generated images as being real or fake, the WGAN replaces  $D_{\vartheta}$ with a function $ f_{\xi} $ (it corresponds to $ \psi $ in Kantorovich-Rubenstein duality), indexed by parameter $ \xi $, which is called ``a critic'', namely a function that evaluates the realness or fakeness of a given sample. In mathematical form, the WGAN objective function is
\begin{equation}\label{equ11}
	\min_{\theta} \sup _{\|f_{\xi}\|_L \leq 1} \left\lbrace  {\rm E}[f_{\xi}({X})]-{\rm E}[f_{\xi}(G_{\theta}({Z}))] \right\rbrace ,
\end{equation}
Also in this new formulation, the task  $ G_{\theta} $ is still to train $ G_{\theta} $ such that $\mathrm{P_\theta}$ is very close (now, in Wasserstein distance) to $\mathrm{P_r} $.
 \cite{arjovsky2017wasserstein} explain how the WGAN is connected to minimum distance estimation.

 Following the results in  Arjovsky et al., we remark that \eqref{equ11} has  the same form as the  Kantorovich-Rubenstein duality.  Therefore,  we apply our dual form  of ROBOT in Th.~\ref{thm3} to the WGAN to obtain a new objective function
\begin{equation}\label{equ12}
	\min_{\theta}\sup _{\|f_{\xi}\|_L \leq 1,{\rm range}(f_{\xi})\leq 2\lambda } \left\lbrace  {\rm E}[f_{\xi}({X})]-{\rm E}[f_{\xi}(G_{\theta}({Z}))] \right\rbrace.
\end{equation}
The central idea is to train a RWGAN by minimizing the robust Wasserstein distance (actually, using the dual form) between real and generative data.
To this end, we  define a novel RWGAN model based on  \eqref{equ12}. The algorithm for training this RWGAN model is very similar to the one for WGAN available in \cite{arjovsky2017wasserstein}, to which we refer for the implementation.  We label this robust GAN model  as RWGAN-1.  Besides this model, we propose another approach derived from~\eqref{equ7}, where we use a new neural network to  represent  the modified distribution and add a penalty term to \eqref{equ11}
in order to control modification. Because of space constraint, the
details of this procedure are provided in Algorithm \ref{alg:robust wgan} in Appendix~\ref{app.rwgan}. We label this new RWGAN model as RWGAN-2. Different from \cite{balaji2020robust}'s robust GAN, which uses $\chi_2$-divergence to constrain the modification of distribution, our RWGAN-2 does this by  making use of the TV.
In the sequel, we will write RWGAN-B for the robust GAN of \cite{balaji2020robust}.

\textbf{Remark.} The RWGAN-1 is less computationally complex than RWGAN-2 and RWGAN-B. Indeed,  RWGAN-2 and RWGAN-B make use of some  regularized terms, thus an additional neural network is needed to represent the modification of the distribution. In contrast, RWGAN-1 has a simpler structure: for its implementation, it requires only a small modification of the activation function in the generator network; we refer to Appendix \ref{app.rwgan}.

\subsubsectio
	{Synthetic data} \label{GAN1} We investigate, via simulated data, the robustness of  RWGAN-1 and RWGAN-2. We consider reference samples generated from  a  simple model, where $ n $  points, including $ n- n_1 $ outliers,
	\begin{equation}\label{true model}
		\begin{array}{cc}
			& X_{i_{1}}^{(n)} \sim \mathrm{U}(0,1),X_{i_{2}}^{(n)} =  X_{i_{1}}^{(n)} + 1,\\
			& {X}_i^{(n)}=(X_{i_{1}}^{(n)},X_{i_{2}}^{(n)} ), i = 1, 2, \ldots, n_1,\\
			& {X}_i^{(n)}=(X_{i_{1}}^{(n)},X_{i_{2}}^{(n)}+\eta) , i =  n_1 +1, n_1 +2, \ldots,n,
		\end{array}
	\end{equation}
	with $ \eta $ representing the size of outliers. We set $ n=1000 $ and try four different settings by changing values of  $\varepsilon = (n- n_1)/n$ and $\eta$. As it is common in the GAN literature, our generative adversarial  models are obtained using the \texttt{Python} library \texttt{Pytorch}; see Appendix \ref{app.rwgan}.    We display the results in Figure~\ref{syndata},  where we compare WGAN, RWGAN-1, RWGAN-2   and RWGAN-B. To measure the distance between the data simulated by the generator  and the input data, we report the Wasserstein distance of order 1.  The plots reveal that WGAN  is greatly affected by outliers. Differently, RWGAN-2 and RWGAN-B  are able to generate data roughly consistent with the uncontaminated distribution in most  of the settings. Nevertheless, they still produce  some obvious abnormal points, especially when the proportion and size of outliers increase.

	In a very different way, RWGAN-1 performs better than its competitors and generates data that fit nicely to the uncontaminated distribution, even when the proportion and size of outliers are large.

	\begin{figure}[http]
		\centering

		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{WGAN_01_2.eps}
			\caption{ $ W^1= $  0.5864 }
			\label{a}
		\end{subfigure}
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{RWGAN1_01_2.eps}
			\caption{$ W^1= $  0.0514 }
			\label{b}
		\end{subfigure}
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{RWGAN2_01_2.eps}
			\caption{$ W^1= $ 0.1560}
			\label{c}
		\end{subfigure}
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{RWGAN3_01_2.eps}
			\caption{ $ W^1= $  0.1771 }
			\label{d}
		\end{subfigure}
		\\

		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{WGAN_01_3.eps}
			\caption{$ W^1= $  0.5229}
			\label{e}
		\end{subfigure}
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{RWGAN1_01_3.eps}
			\caption{$ W^1= $ 0.0495 }
			\label{f}
		\end{subfigure}
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{RWGAN2_01_3.eps}
			\caption{ $ W^1= $ 0.2312 }
			\label{g}
		\end{subfigure}
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{RWGAN3_01_3.eps}
			\caption{ $ W^1= $  0.1803 }
			\label{h}
		\end{subfigure}
		\\

		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{WGAN_02_2.eps}
			\caption{ $ W^1= $ 0.5646}
			\label{i}
		\end{subfigure}
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{RWGAN1_02_2.eps}
			\caption{ $ W^1= $ 0.0470 }
			\label{j}
		\end{subfigure}
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{RWGAN2_02_2.eps}
			\caption{ $ W^1= $ 0.2938 }
			\label{k}
		\end{subfigure}
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{RWGAN3_02_2.eps}
			\caption{ $ W^1= $ 0.3229 }
			\label{l}
		\end{subfigure}
		\\
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{WGAN_02_3.eps}
			\caption{ $ W^1= $ 0.6518 }
			\label{m}
		\end{subfigure}
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{RWGAN1_02_3.eps}
			\caption{ $ W^1= $ 0.0471 }
			\label{n}
		\end{subfigure}
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{RWGAN2_02_3.eps}
			\caption{ $ W^1= $ 0.3954}
			\label{o}
		\end{subfigure}
		\begin{subfigure}[b]{0.24\textwidth}
			\centering
			\includegraphics[width=\textwidth]{RWGAN3_02_3.eps}
			\caption{ $ W^1= $ 0.4674}
			\label{p}
		\end{subfigure}
		\caption{Blue triangles: 200 data points sampled from the reference distribution (uncontaminated observations). Red squares: 200 data points generated from  WGAN (1st column), RWGAN-1 (2nd column), RWGAN-2  (3rd column) and RWGAN-B  (4th column). Empirical Wasserstein distance of order $ p=1 $ between blue and red points is also provided.  (1st row: $\varepsilon = 0.1$,$\eta= 2$; 2nd row: $\varepsilon = 0.1$,$\eta= 3$; 3rd row: $\varepsilon = 0.2$,$\eta= 2$; 4th row: $\varepsilon = 0.2$,$\eta= 3$).}

	\label{syndata}
\end{figure}

\subsubsection{Fashion-MNIST data example} \label{GAN2}

We illustrate the performance of  the RWGAN-1 and RWGAN-2 through comparing them with the WGAN and RWGAN-B in analysing the Fashion-MNIST dataset, which contains 70,000  grayscale images  of apparels, including T-shirt, jeans, pullover, skirt, coat, etc.
Each image is of $28\times 28$ pixels, and each pixel gets value from 0 to 255, indicating the darkness or lightness. We regard 60,000 images  as normal images and take the negative effect \footnote{A negative image is a total inversion, in which light areas appear dark and vice versa. In Fashion-MNIST dataset, for each pixel of a negative image, it takes 255 minus the value of the pixel corresponding to the normal picture.} of the remaining 10,000 images, which are considered as outliers. Then combine these two types of image in the reference sample. Figures~\ref{normal pic} and~\ref{pic as outlier} show normal and negative images, respectively.
Our goal is to obtain a generator which can produce images of the same style as Figure \ref{normal pic}, even if it is trained on sample containing normal images and outliers. An explanation of how generator works is available in  Appendix \ref{app.rwgan}.  In Figures \ref{fig:wgan}, \ref{fig:rgan1} , \ref{fig:rgan2} and \ref{fig:rganB} we display images generated by the WGAN, RWGAN-1, RWGAN-2 and RWGAN-B, respectively. We see that WGAN produces an  image with many obvious negative pictures. Most pictures generated by RWGAN-B  have the correct style,  but a few negative pictures  are  also generated. Images generated by RWGAN-1 and RWGAN-2  have the correct style and do not contain any negative picture.

\begin{figure}[http]
	\centering
	\begin{subfigure}[b]{0.25\textwidth}
		\centering
		\includegraphics[width=\textwidth]{400.eps}
		\caption{ normal picture }
		\label{normal pic}
	\end{subfigure}
	\begin{subfigure}[b]{0.25\textwidth}
		\centering
		\includegraphics[width=\textwidth]{0.eps}
		\caption{picture as an outlier}
		\label{pic as outlier}
	\end{subfigure}
	\caption{Style of  clean reference sample images and  outlier images. Panel (a) contains pictures that are regarded as the right style. Panel (b)  contains  negative pictures (outliers).}

\end{figure}

\begin{figure}[http]
	\centering
	\begin{subfigure}[b]{0.24\textwidth}
		\centering
		\includegraphics[width=\textwidth]{wgan.eps}
		\caption{WGAN}
		\label{fig:wgan}
	\end{subfigure}
	\begin{subfigure}[b]{0.24\textwidth}
		\centering
		\includegraphics[width=\textwidth]{robustgan1.eps}
		\caption{RWGAN-1}
		\label{fig:rgan1}
	\end{subfigure}
	\begin{subfigure}[b]{0.24\textwidth}
		\centering
		\includegraphics[width=\textwidth]{robustgan2.eps}
		\caption{RWGAN-2}
		\label{fig:rgan2}
	\end{subfigure}
	\begin{subfigure}[b]{0.24\textwidth}
		\centering
		\includegraphics[width=\textwidth]{RWGAN_Balaji.eps}
		\caption{RWGAN-B}
		\label{fig:rganB}
	\end{subfigure}
	\caption{Images generated by WGAN ((a)), RWGAN-1  ((b)), RWGAN-2  ((c)) and RWGAN-B ((d)).}

\end{figure}

\bigskip
\begin{center}
{\large\bf SUPPLEMENTARY MATERIAL}
\end{center}

All proofs of the theoretical results are collected in Appendix~\ref{App:proof}. Appendix~\ref{App.MCresults}, as a compliment to Section~\ref{Sec:Applications}, provides more details and additional  numerical results of a few applications of ROBOT in statistical estimation and machine learning tasks. Specifically,
in Appendix~\ref{App.ROBOT}, we illustrate how ROBOT can be applied to detect outliers in the context of parametric estimation in a linear regression model. In Appendix~\ref{app.rwgan}, we provide more details about implementation of RWGAN defined in Section~\ref{Sect_DA}. Appendix~\ref{Sec.choice} discusses, via Monte Carlo experiments, how $\lambda$ should be chosen. In Appendix~\ref{Sec.DA}, we consider an application of ROBOT to robust domain adaptation.
Moreover, Appendix~\ref{App.OT}, as a supplementary to Section~\ref{Optimal transport}, provides some key theoretical results of optimal transport.

\bibliographystyle{chicago}

redpajama_set_name: RedPajamaArXiv


PROVIDENCE, R.I (WPRI) — In a series of four tweets Friday afternoon, House Speaker Nicholas Mattiello called Gov. Gina Raimondo's free college tuition plan "unsustainable" and "fiscally irresponsible," while also criticizing her position on the state's car tax.
Mattiello's spokesperson Larry Berman told Eyewitness News the tweet storm was dictated to staffers by Mattiello in response to a press tour by Raimondo's communications team "to discredit the speaker's plan to eliminate the car tax." Berman said he had received requests for comment from local newspapers like the Woonsocket Call and Pawtucket Times after the newspapers met with Raimondo's team.
Speaker Mattiello first promised to eliminate the car tax on the campaign trail, proposing to do it over the course of five years. Rhode Island cities and towns currently collect roughly $215 million in car taxes per year, so state legislators will need to figure out how to offset the costs with state dollars while balancing the budget.
Gov. Raimondo's budget proposal does not include Mattiello's car tax elimination plan, but does propose a 30% cut to the tax starting in 2018 by requiring municipalities to use a car's fair trade-in value to calculate the tax bill. She also proposed a plan to provide free tuition to Rhode Island students at public colleges and universities for two years. The free college plan is estimated to cost $10 million in its first year, eventually reaching $30 million per year.
The governor's director of communications, Mike Raia, responded to Mattiello's tweets Friday, saying the governor's proposal allows for both car tax relief and tuition relief for Rhode Islanders.
The governor's senior adviser David Cruise weighed in with his own series of tweets, saying the free college plan "will give at least 5K kids from the Class of 2017 the opportunity to attend CCRI, RIC or URI tuition free….that includes at least 450 in Cranston," which is where Speaker Mattiello's district is.


Lincolns gate. Corner townhouse. 2 levels, 2 bdrms and 2 baths. Excellent condition. New appliances, freshly painted. New roof. Great rec facilities. Worry free complex. Parking at front. Pets and rentals welcomed. All meas are approx.


text:
Rounds of the Week: Healthcare and AI Capture Funds Despite Decline In VC Outlay
Startups Welbe, Kuona, Cowmed, Inklo and Nomo garnered investments in Latin America this week
Rounds of the week.The sectors that raised rounds this week in Latin America were health, software, agribusiness and telecommunications.(Bloomberg/Stefan Wermuth)
By Isabela Fleischmann and Yanin Alfaro (BR)
December 16, 2022 | 05:30 PM
Bloomberg Línea — Despite a 5% increase in the amount invested in Latin American startups in third quarter compared to second quarter, totaling $2 billion, according to a report by TheVentureCity, a global venture fund for early-stage companies, in November, the amount declined in November, according to Transactional Track Record (TTR).
According to TTR, the number of transactions fell 5% to 977 venture capital financings in Latin America at the end of November.
Venture Capital Investment in Latin America Continues to Decline
In a more challenging year for VC investment, in which investors have reduced the multiples paid on the valuation of tech companies compared to what was seen in the last two years, one of the world's largest venture capital firms, Andreessen Horowitz, has published a report saying which sectors are likely to take off next year.
The Silicon Valley manager cited everything from entertainment gaming franchises, and precision drug delivery to small modular reactors for artificial intelligence (AI) application payloads, among others.
Investment in LatAm Seed-Stage Startups Will Flow Despite Recession, Magical CEO Says
For now, the sectors that raised rounds this week in Latin America were healthcare, software, agribusiness, and telecom:
Welbe
Welbe, a Mexican startup that offers companies an occupational medicine and comprehensive health platform for their employees, raised an 100-million-peso ($5 million) round led by Volpe Capital and Nazca, with SVLC, Kortex and GreenRock also participating.
This is also the first investment by Brazilian Volpe Capital, Kortex, and GreenRock in the Mexican market, with the latter two funds specializing in healthcare technology investments.
The capital injection will help the healthcare technology company consolidate its presence in the Mexican market and strengthen its data technology.
Wellbe offers a B2B solution that benefits employees. Since its founding in January 2022, the platform has raised $7.1 million.
Kuona
Kuona, a software-as-a-service (SaaS) platform, closed a $6 million seed round led by COMETA, which included participation from Seaya Cathay Latam and FEMSA Ventures.
The capital will be used to expand Kuona's presence and team in key geographic areas including Latin America, Europe, and the United States.
The Monterrey, Mexico-based company was founded in 2017 by Chema Sanroman and Agustín Magaña, who combine decades of experience in data science, AI and consumer product revenue and price management.
Cowmed
Agribusiness startup Cowmed received 5.9 million reais ($1.11 million) in an equity crowdfunding round through the Captable platform. The company uses technology to monitor livestock and detect behavioral changes in animals, identifying diseases, among other conditions. The information is detected by AI linked to the animals' collars. With the technology, the company intends to increase the productive efficiency of farms by 25%.
Today, the company monitors around 35,000 cows in 400 farms in Brazil, Paraguay, Uruguay, Bolivia, Canada, and the United States.
Inklo
Inklo, a Brazilian fintech that wants to democratize access to credit for surgeries and medical procedures, received 1.5 million reais in a pre-seed round. The company, which started operations two months ago, intends to use the money to acquire new technologies and hiring.
Brazilian startup Nomo received R$1.5 million ($282,311) in an extension of the 15-million-reais seed funding from the Iporanga fund. The startup was created by Henrique Garrido, who has experience at the fintech startup Stone. Now, with Nomo, the idea is that the company will be a digital telecommunications operator, operating with the antennas of a Vivo representative.
The round also saw the participation of Nextel's former CEO, Roberto Rittes, among other executives.
How a Quarter Bereft of Unicorns Bodes Badly for Latin American Startups
TechBloomberg LíneaLatin StartupsTech & FundingNews in EnglishLatin America

redpajama_set_name: RedPajamaCommonCrawl


Small and medium-sized enterprises are looking to emerging markets for rapid revenue growth as economic recovery in Europe remains slow, according to the Economist Intelligence Unit Report, sponsored by FedEx Express.
Many executives noted that with the "over-subscribed" and congested nature of the European marketplace, emerging markets have been seen as fertile ground for SMEs seeking above average returns.
Almost 90 per cent of the European SMEs surveyed are already doing business with emerging markets, and more than half expect to increase their involvement in 2011 and 2012.
Some 55 per cent of resdonents believe that the traditional BRIC countries of Brazil, Russia, India and China will be crucial to their business in the coming year, with nearly half (48 per cent) singling out Brazil for improved perceptions of the country, bolstered by a smooth transition of political power and better infrastructure in the run-up to major sporting events.


text:
Student - 27 november 2014
Meanwhile in Indonesia
Ondertussen in...
In the news: Women who want to join the police in Indonesia have to undergo a test of their virginity. This 'two-finger test' is seen as humiliating and discriminatory, according to a recent report by Human Rights Watch..
Commentary by Pipiet Larisatie from Semarang. She is doing a course (Market Access for Sustainable Development) at the Centre for Development Innovation.
'There had been rumours for some time that you had to be a virgin to join the police. But nobody knew for sure, or at least no-one I know. One reason that it has now come out in the open is that the police have recently started training a lot of women. And rightly so, for at the moment they are almost all men.
One police chief said that the test was to make sure they didn't take on any prostitutes. That's not a plausible argument; they would be better off doing a background check. The chief also said that the test result doesn't affect the decision whether or not to admit someone. So why are they doing it? Formal statements are not always in line with the facts.
In Indonesia, virginity is seen as an indicator of a good character. Young women are supposed to be virgins because unrestricted sex is seen as a sin. That is a religious norm that enjoys widespread tacit support. Religion plays a major role in Indonesia. Talking about sex is still a taboo, for instance. I don't even discuss it with my female friends.
Of course I don't want bad people joining the police - they are corrupt enough as it is. But I disagree with a criterion that can't be applied to both men and women. How are you supposed to test a man? A psychological test would be much better.
The police shouldn't be scaring off women; they could do with some extra empathy. Many female victims of sexual violence, for example, don't dare go to the police. They are too ashamed to tell male officers about what happened to them.'
Geef de oplossing van deze som in cijfers: tien + zeven = *


An additional loop provided by C# is the foreach loop. foreach is also commonly used in many programming languages, such as Perl. Whenever it's necessary to process all values in a set one after another, foreach loops are far more comfortable than other kinds of loops.
This way, it's truly simple to implement dynamic data structures for storing an undefined amount of data.


Silver Lake helped to take Dell Inc. private. Now, the firm is working with Elon Musk.
The Model 3 assembly line, under a tent, at Tesla's factory in Fremont, California.
The private equity firm Silver Lake is again working with a tech founder who has ambitions to remove his company from Wall Street's harsh light.
Five years ago, Silver Lake teamed up with Michael Dell to help take Dell Inc. private — a deal worth $24.4 billion.
Now, Silver Lake is working with Elon Musk, Tesla's founder and chief executive, as he scrambles to take the electric carmaker private, The New York Times reported, citing people with direct knowledge of the matter. The firm is not being paid for its role; instead, it hopes to participate in whatever deal comes together, something that seems far from certain at this point.
Musk may hope that Silver Lake's past experience will help him achieve his goal. But while Tesla's potential take-private shares some parallels with Dell's, there are also important differences.
Criticism from public shareholders. Dell faced countless questions ahead of its buyout. Its fortunes had darkened: Once the largest PC maker in the world, it had fallen behind Hewlett-Packard and Lenovo by 2013. Earnings were falling, margins were shrinking and its turnaround efforts had yet to gain traction. Tesla, too, has faced questions about its performance, though the primary question isn't about a turnaround, but rather whether the company can ever fulfill the lofty expectations of Musk and its shareholders.
A founder with a substantial stake. At the time of Dell's leveraged buyout, Dell owned about 16 percent of the company. Musk owns about 20 percent of Tesla.
A founder with impulse control. Michael Dell informed the board of his interest in taking Dell private six months before news of the deal broke. Over that period, Dell had lined up partners and financing, both he and the board had hired advisers, and other potential bidders had been approached. By contrast, Musk's tweet last week caught Tesla's board by surprise. He had not lined up partners or financing. Neither he nor the board had hired advisers. And no other potential suitors had been approached.


Gizmodo asked me what I carry in my gadget bag, and I obliged. This isn't even a complete list, but it's the majority of what I carry on a trip when I'll be away from home for three to five days in a hotel. I've fortunately curtailed those kinds of trips with a baby due in the very very near future, and plan to spend less time flying and more at home in the coming months, too.But gadgets are gadgets, and most of mine are relatively inexpensive and highly utilitarian.


Purchased in Florence, Italy, in the 1980s this octohedral sundial represents a style very popular in the Renaissance when knowledge of the geometry necessary to lay out sundials was highly regarded.
It is based on an original in the Galileo Museum collection attributed to Stefano Buonsignori (died 1589).
The hours are numbered in the 'Italian Hours' system with 24 hours starting at sunset.


Is the errand boy sent by grocery clerks cool? No, indeed he is not. The corporate-controlled media is hard at work trying to get the Preezy of the United Steezy reelected.
President "Cool" recently appeared on the Jimmy Fallon show to "prove" his coolness, but instead gave the appearance of utter desperation while diminishing the office of the president. Fallon thought his schtick was funny and Obama was chasing the youth vote.
Is Obama cool? I'd be a helluva lot more impressed with him if he was merely competent—something he is not. He's all microphone and teleprompter—no message. The question to ask is: If you have nothing to say, does it matter that you have endless venues in which to say it?
You know why the campaign is not saying "You know me." It's because we do know him and we haven't liked what we've lived through from Jump Street.
This post was linked at The Other McCain. Thanks, Smitty.


text:
Virtual Injustice — Part 8: A Well-Connected 'IP' Maximalist
Posted in Deception, Europe, FSF, Patents at 2:59 am by Dr. Roy Schestowitz
Previously in the series:
Virtual Injustice — Part 1: António's Increasingly Wonky Legal Fudge Factory
Virtual Injustice — Part 2: The ViCo Oral Proceedings of 28 May 2021
Virtual Injustice — Part 3: All the President's Men…
Virtual Injustice — Part 4: Mihály Ficsor, the EPO's Hungarian "Fixer"
Virtual Injustice — Part 5: Benoît's "Friends" in Budapest
Virtual Injustice — Part 6: Best Buddies With António
Virtual Injustice — Part 7: Musical Chairs and Revolving Doors
Ad hominem attack on RMS [PPT] by Mihály Ficsor at a WIPO seminar held in Romania in 2010.
Summary: The EPO's lobbying for European software patents goes all the way to the top, including António Campinos and his circle
Looking back at Ficsor's career since he left the HIPO in 2016, it seems fair to say that he has become a "job-hopper".
But all things considered he hasn't done too badly for himself so far.
As a matter of fact, in recent years he has managed to secure two well-remunerated public sector jobs: first of all at the EUIPO in March 2017 and subsequently at the EPO in March 2020.
Who says that a rolling stone gathers no moss?
"Ficsor's job-hopping adventures have undoubtedly been facilitated by his close connections with António Campinos."Of course it helps to have the right connections.
Ficsor's job-hopping adventures have undoubtedly been facilitated by his close connections with António Campinos.
As we have seen these connections go back to the days when Ficsor chaired the Administrative Board of the EU trademark agency OHIM/EUIPO between 2011 and 2016, at the same time that Campinos headed the agency.
Ficsor's latest position at the EPO falls short of the "gold medal" typically dished out to former Administrative Council members in the form of a Vice-President sinecure.
One possible explanation here is the question of political support from the candidate's home country which is normally required for an appointment as a Vice-President. Ficsor may have lacked this support if – as has been speculated – he fell out of favour with the Orban government in Hungary.
In any case, by March 2020, Campinos had already dished out all of the available Vice-President vacancies to his buddies, so Ficsor had to make do with the "consolation prize" of a Principal Director's position.
"In any case, by March 2020, Campinos had already dished out all of the available Vice-President vacancies to his buddies, so Ficsor had to make do with the "consolation prize" of a Principal Director's position."In contrast to Vice-Presidents whose appointments require political support and have to be approved by the Administrative Council, EPO Principal Directors can easily be slipped in "via the back-door" because all their appointment requires is the approval of the EPO President, in this case Ficsor's old buddy Campinos.
Even if he didn't make the top grade as Vice-President, Mihály is unlikely to complain about his EPO appointment and the level of remuneration which he currently enjoys.
OECD statistics indicate that salaries in Hungary are far below the OECD average. In the public sector, high-end salaries are reported to be around HUF 855.000 per month which is approximately EUR 2.500 Euro at current conversion rates.
Based on those figures, Ficsor's tax-free salary as a senior manager at the EPO is estimated to be a multiple of somewhere between eight and ten times of his take-home pay as a top-ranking official back home in Hungary.
Apart from that, it shouldn't be forgotten that he is still young enough to make a bid for a Vice-President position when his current boss Christoph Ernst – who is approaching 70 – finally retires.
Ficsor's EPO "handlers": Gilles Requena and Vice-President Christoph Ernst.
Ficsor clearly knows what side his bread is buttered on. He is a "safe pair of hands" who can be counted on to do the bidding of his "handlers", Vice-President Christoph Ernst and Chief International and Legal Officer, Gilles Requena.
Before wrapping up, it is worth drawing attention to a point which should be of interest to readers of Techrights.
"Based on those figures, Ficsor's tax-free salary as a senior manager at the EPO is estimated to be a multiple of somewhere between eight and ten times of his take-home pay as a top-ranking official back home in Hungary."Ficsor is reputed to be an IP maximalist and the public record confirms that he has been an enthusiastic and vociferous advocate of "software patents" in the past.
Back in 2010 he was a guest speaker at a "Sub-regional Seminar on the Protection of Computer Software and Databases" which took place in Mangalia, Romania, from 25 ro 27 August. The seminar was organized by the World Intellectual Property Organization (WIPO), the Romanian Copyright Office (ORDA), and the Romanian State Office for Inventions and Trademarks (OSIM).
In his capacity as chairman of the Central and Eastern European Copyright Alliance (CEECA), delivered a lecture on "The International Intellectual Property Protection of Software".
In a lecture delivered in 2010, Ficsor did his best to misrepresent and ridicule critics of "software patents".
The slides from this lecture which can be accessed via the WIPO's official website reveal that on that occasion Ficsor did his best to misrepresent and ridicule critics of "software patents". In particular, he indulged in a cynical ad hominem attack on Richard Stallman.
"In particular, he indulged in a cynical ad hominem attack on Richard Stallman."It's safe to say that Mihály Zoltán Ficsor is a worthy addition to Team Campinos and that he seems to be well-qualified to act as an overseer of the operations of António's legal fudge factory.
In the next part we will take a look at Ficsor's assistant in case no. G 1/21, the EPO's Nordic Ice-Queen, Heli Pihlajamaa. █
The EPO's Overseer/Overseen Collusion — Part XIII: Battistelli's Iberian Facilitators – Spain
The EPO's Overseer/Overseen Collusion — Part III: Three Missing Votes
G 1/21 is a Catastrophe for the EPO's Legitimacy
Virtual Injustice — Part 15: A Pandora's Box… But for Whom?
Virtual Injustice — Part 14: How Mandatory ViCo Became the "New Normal"
Virtual Injustice — Part 13: Let the Games Continue…
Virtual Injustice — Part 12: Carl Josefsson – Down But Not Out!
Virtual Injustice — Part 11: Perceptive Comments and Caustic Criticism
Virtual Injustice — Part 10: Vapid and Superficial Coverage in the 'IP' Blogosphere
Response to Misinformation From EPO Officials
Virtual Injustice — Part 9: Heli, the EPO's Nordic Ice-Queen
The ISO Delusion: When the Employer Doesn't Realise That Outsourcing Clients' Passwords to LassPass After Security Breaches Is a Terrible Idea
The mentality or the general mindset at Sirius 'Open Source' was not compatible with that of security conscientiousness and it seemed abundantly clear that paper mills (e.g. ISO certification) cannot compensate for that


text:
Determination Edit
Determination an episode from the anime series Zoids: Genesis based on TOMY's Zoids model franchise.
After the battle, Bio Raptor scouts arrive at Pikuru, but leave after confirming the destruction of the Bio Tricera and its associated Bio Raptor forces.
Hopeful that they won't return, Ra Kan and the others begin rebuilding the village. They use their Zoids to do most of the heavy labour, such as moving resources and clearing debris, and, thanks to that, are able get the work done quite rapidly.
Over lunch, they speculate about the Hayate Liger's origins, not knowing what caused it to change, nor what caused it to revert back. They joke about it eating bad food, but without any real information, and without Ron to offer his insight, they come to no conclusions, other than on the name, which Ruuji confirms as "Hayate".
Ruuji takes some of the children around the village, where he is given quite a lot of gifts from the thankful villagers. He ends up talking with some of the older men in the village, who thank Ruuji's group for their assistance, but comment that even with their victory, and the rebuilding of the village, that they will simply not be safe so long as Digald maintain their warlike tendencies. This strikes a cord with Ruuji, who realizes that as soon as his group leaves, the village will be defenseless. He thinks about it, to the extent that when the group decide to head out to the next big city to look for a Generator mechanic, that instead they should be fighting against Digald, as they have many large-scale, Metal-Zi-equipped Zoids. This doesn't sit well with the group, and when Ruuji asks for Ra Kan to become the group's leader, he reminisces and tells Ruuji a "story" .
Ruuji is rewarded for helping repair the village
He talks of a country called "Kira", which, while not large, was prosperous thanks to a rich textile and agricultural industry. They had many large-scale Zoids, and may have been able to defeat Digald's eventual invasion, but the lord decided not to, and instead fled the country, so as to avoid the war, and the inevitable losses that would be associated with it. This, he later realized, was a big mistake, as it gave Digald the belief that they could win easily against any foe. Even if the country had fought and lost, the struggle would have made Digald think twice about starting a war. But instead, by fleeing, Digald gathered their forces and began their tyrannous reign. This lord is revealed to be none other than Ra Kan himself. Thus, he reasons, he no longer has any right to fight Digald.
They decide to leave abruptly, and tell the villagers to give Ron a message if here were to pass through after they leave. But Ruuji confronts Ra Kan once more, again pleading him to lead the anti-Digald movement. Galaga supports Ruuji, having been anti-Digald from the start, Kotona is indecisive, and decides just to stay with them until she can make up her mind. Seijuurou simply agrees to train Ruuji. Mii confesses that she always believed that Ra Kan would be the one to defeat Digald.
With this effectively unanimous decision, Ra Kan confirms that they aren't just choosing to fight Digald out of frustration from not finding a Generator mechanic, and challenges Ruuji to a duel. If Ruuji wins, Ra Kan will lead the resistance. If Ra Kan wins however, he will simply do as he pleases.
The battle begins, but Ruuji takes his hands off the console for a second, and Ra Kan is able to quickly seize victory. It is then that Ron shows up, apparently having forgotten the meeting point.
But having the freedom to do as he wishes proves to be unusual, as Ra Kan reveals his intention is to head to Mirodo Village.
The episode ends with Zairin fishing, but is disturbed by a brief flyby of a new Zoid, the Bio Ptera.
Soul Tiger
Hayate Liger (flashback)
Bamburian
This is the debut episode of the Bio Ptera


Sneak peek for this Friday's show: Wednesday morning, we taped a half-hour interview with Gov. C.L. "Butch" Otter, in which we discuss transportation, education, appointments and more.
After the governor took off his microphone and walked off the set, he was handed a stack of bills that had to be signed before 10:30 a.m. He took a pen out of his jacket and started going through the bills on a table in the Idaho Public Television production lobby. As he looked over the legislation, I asked if he'd let any bills become law without his signature so far this year.
Yes, he said: The tax exemption for prescription glasses and contact lenses, which passed the legislature last week.
Otter said he struggled with the bill. Currently, glasses and contact lenses are the only medical devices that are taxed, but he was concerned about state revenues.
"I don't want to lose $2.8 million out of the general fund, but on the other hand, how fair is that?" Otter said.
For our interview, make sure to watch Idaho Reports on Friday, 8 pm MST/7 pm PST.
but he is ok with throwing 60 million away and how much on the prisions?????


Financial donations, prayers, volunteering (time and talents) or spreading the good news of Catholic Radio in West Michigan, it all helps Holy Family Radio continue to go and grow in West Michigan.
Wondering what to do with that car, camper, or boat you've had for years? Maybe you're ready for an upgrade.


text:
Q: mysql database PHP table I currently have a database on mysql with some products and I am printing them in a table, as you can see here:

Well thats fine for now but... I want to set certain images to the products name.
For example, I would go on top of the name "Jeans Fit" (hover in css) and it would appear the products image. How can I set certain images to the products names? Not randomly, I want to choose each one, if you could guide me on this one ...
Here is my code to print the table:
<?php

// to prevent undefined index notice
$action = isset($_GET['action']) ? $_GET['action'] : "";
$name = isset($_GET['name']) ? $_GET['name'] : "";

if($action=='add'){
    echo "
" . $name . " foi adicionado ao carrinho
";
}

if($action=='exists'){
    echo "
" . $name . " já existe no carrinho
";
}

require "libs/DbConnect.php";

// page is the current page, if there's nothing set, default is page 1
$page = isset($_GET['page']) ? $_GET['page'] : 1;

// set records or rows of data per page
$recordsPerPage = 6;

// calculate for the query LIMIT clause
$fromRecordNum = ($recordsPerPage * $page) - $recordsPerPage;
// select all data
$query = "SELECT
            id, name,price
        FROM
            products
        ORDER BY
            id
        LIMIT
            {$fromRecordNum}, {$recordsPerPage}";

            /*
            page and its LIMIT clause looks like:
            1 = 0, 5
            2 = 5,10
            3 = 10,15
            4 = 15, 20
            5 = 20, 25
            */

$stmt = $con->prepare( $query );
$stmt->execute();

//this is how to get number of rows returned
$num = $stmt->rowCount();

if($num>0){
    echo "
";//start table

        // our table heading
        echo "
";
            echo "Nome Produto	";
            echo "Preço (EUR)	";
            echo "Acção	";
        echo "
";

        while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){
            extract($row);

            //creating new table row per record
            echo "
";
                echo "{$name}	";
                echo "{$price}	";
                echo "";
                    echo "";
                        echo "";
                    echo "";
                echo "	";
            echo "
";
        }

    echo "
";
}

// no products in the database
else{
    echo "No products found.";
}

A: You could try Change:
From:

to:

redpajama_set_name: RedPajamaStackExchange


text:
Крофне, љубав и још по нешто је позоришна представа коју је режирала Тијана Васић према тексту Тијане Грумић. Ауторка Грумић је комад написала на другој години факултета, док је Тијани Васић ово била друга представа на сцени ДАДОВ-а.

Премијерно приказивање било је 30. новембра 2016. године у позоришту ДАДОВ.

Радња
Главна јунакиња девојчица Асја открива да је тешко болесна и живи у окружењу где су због тога сви превише заштитнички настројени према њој док нико заправо не разуме како се она осећа.

Она покушава да живи нормалан живот једне тинејџерке упркос томе у каквој се ситуацији тренутно налази - заљубљује се, бива остављена, склапа пријатељства за цео живот.

Улоге

Референце

Спољашње везе
Текст комада

Позоришне представе
Позориште Дадов

redpajama_set_name: RedPajamaWikipedia