Let $(X,Y)$ be a pair of random variables on a measure space $\mathcal T \subseteq \text{"subsets of }\mathbb R^2\text{"}$, with joint probability distribution $P$.



> 
> We don't assume $X$ and $Y$ are independent!
> 
> 
> 


Let $P\_X$ (resp. $P\_Y$) be the marginal distribution of $X$ (resp. $Y$), defined by $P\_X(A) := \int\_{p\_1(A)} \,dP$, where $\mathcal p\_k(A) := \{(z\_1,z\_2) \in \mathcal T \mid z\_k \in A\}$ defines the projection operator unto the $k$ coordinate of $\mathcal T$. Let $\Pi(X,Y)$ be the set of all couplings of $X$ and $Y$, i.e the set of all probability distributions on $\mathcal T$, with same margins as $P$. Finally, let $P\_X \otimes P\_Y \in \Pi(X,Y)$ be the independence coupling of $X$ and $Y$ defined by
$$
(P\_X \otimes P\_Y)(U) := P\_X(p\_1(U))\cdot P\_Y(p\_2(U)).
$$


Let $k$ and $n$ be positive integers, presumably, with $n \gg k$.



> 
> **Question.** *Given $n$ independent copies $(X\_1,Y\_1),\ldots,(X\_n,Y\_n)$ of $(X,Y)$ (i.e an iid sample of size $n$ from the joint distribution $P$), what is a principled way to obtain an iid sample from $P\_X \otimes P\_Y$ of size $k$ ?*
> 
> 
> 



Given iid samples from the joint distribution $P$ of pair of r.v.'s $(X,Y)$, how to get iid samples from independence coupling $P_X \otimes P_Y$?
It is unclear to me what "a principled way" could mean.


However, given $n$ iid pairs $(X\_1,Y\_1),\dots,(X\_n,Y\_n)$, it is easy to get $k:=\lfloor n/2\rfloor$ iid pairs $(X\_1,Z\_1),\dots,(X\_k,Z\_k)$ such that, for each $j\in\{1,\dots,k\}$, (i) the random variables $X\_j$ and $Z\_j$ are independent and (ii) $Z\_j$ equals $Y\_j$ in distribution:


Just let $Z\_j:=Y\_{k+j}$ for all $j\in\{1,\dots,k\}$.




---


If the joint probability distribution $P\_{X,Y}$ of the pair $(X,Y)$ is known, then it may be possible to get an iid sample of size $n$ from the distribution $P\_X\otimes P\_Y$ using an iid sample of (the same) size $n$ from the distribution $P\_{X,Y}$. This could be done by applying a transformation $T\colon\mathbb R^2\to\mathbb R^2$ to the pair $(X,Y)$ to get a pair $(U,V):=T(X,Y)$ with distribution $P\_X\otimes P\_Y$.


The transformation $T$ can apparently be obtained by discrete approximation, as follows. For each natural $n$, let $X\_n$ and $Y\_n$ be discrete random variables (r.v.'s), say each taking only finitely many values, such that $X\_n\to X$ and $Y\_n\to X$ in probability (as $n\to\infty$). Then $P\_{X\_n,Y\_n}\to P\_{X,Y}$, $P\_{X\_n}\to P\_X$, $P\_{Y\_n}\to P\_Y$, and $P\_{X\_n}\otimes P\_{Y\_n}\to P\_X\otimes P\_Y$ weakly.


Then for each natural $n$ there is a transformation $T\_n\colon\mathbb R^2\to\mathbb R^2$ such that the pair $(U\_n,V\_n):=T\_n(X\_n,Y\_n)$ has the distribution $P\_{X\_n}\otimes P\_{Y\_n}$. This follows because any discrete set can be transformed bijectively to a set on the real line.


If now the set $\{T\_n\colon n\in\mathbb N\}$ is compact in an appropriate sense, then, passing to a subsequence, from the pairs $(U\_n,V\_n)=T\_n(X\_n,Y\_n)$ with distributions $P\_{X\_n}\otimes P\_{Y\_n}$ one will get a pair $(U,V):=T(X,Y)$ with distribution $P\_X\otimes P\_Y$.


