Applies a rank-based correlation structure to a numeric matrix using
a flexible, iterative variant of the Iman–Conover algorithm.
The method reorders each column of x based on the rank structure
of a multivariate normal draw whose correlation matrix matches target_r.
If eps is specified, the algorithm will iteratively draw candidates and
select the one with the closest match to the target Spearman structure.
The marginal distributions of x are preserved exactly.
Usage
flexIC(x, target_r, eps = "none", max_iter = 20)
Value
A numeric matrix with same dimensions as x, with transformed columns preserving marginal distributions
and approximately matching the specified rank correlation structure.
Arguments
x
Numeric matrix or data frame. Columns should be independent prior to transformation.
target_r
Target Spearman correlation matrix to impose. Must be square, symmetric, and positive-definite.
eps
Convergence tolerance (maximum absolute deviation allowed between achieved and target Spearman correlation).
If eps = "none", no convergence test is performed and the first draw is used (equivalent to classic Iman–Conover).
max_iter
Maximum number of candidate draws to evaluate when eps is numeric.