Let \((s_1, \ldots, s_d)\) be the sampling order of a random vector
\(V = (V_1, \ldots, V_d)\) with distribution \(F\). For continuous
variables, the Rosenblatt transform \(Z = T(V)\) is defined by
$$
Z_{s_1} = F_{s_1}(V_{s_1}), \qquad
Z_{s_j} = F_{s_j \mid s_1, \ldots, s_{j-1}}
(V_{s_j} \mid V_{s_1}, \ldots, V_{s_{j-1}}),
\quad j = 2, \ldots, d.
$$
If the model is correct, the components of \(Z\) are independent standard
uniforms. The result is stored in the original variable columns; the
sampling order determines only the sequence of conditional distributions.
The inverse transform applies the corresponding conditional quantiles:
$$
V_{s_1} = F_{s_1}^{-1}(Z_{s_1}), \qquad
V_{s_j} = F_{s_j \mid s_1, \ldots, s_{j-1}}^{-1}
(Z_{s_j} \mid V_{s_1}, \ldots, V_{s_{j-1}}),
\quad j = 2, \ldots, d.
$$
Thus \(T^{-1}(Z)\) has distribution \(F\) when \(Z\) contains
independent standard uniforms.
If a variable has atoms, its conditional cdf jumps at the observation. Let
\(G_j\) denote the conditional cdf of \(V_{s_j}\) given the preceding
variables in the sampling order. Following Brockwell
(10.1016/j.spl.2007.02.008), rosenblatt() returns
$$
Z_{s_j} = W_j G_j(V_{s_j}) + (1 - W_j) G_j(V_{s_j}^{-}),
$$
where \(G_j(V_{s_j}^{-})\) is the left limit and the \(W_j\) are
independent standard uniforms. This randomization is used by default and
yields uniform components under the fitted model. Set
randomize_discrete = FALSE to return the upper endpoint
\(G_j(V_{s_j})\) instead.