ic_exact {flexIC}R Documentation

One-Shot Iman–Conover Transformation

Description

Applies the classic Iman–Conover procedure to reorder the columns of a numeric matrix to approximately match a target rank correlation structure, while preserving marginals.

Usage

ic_exact(x, target_r)

Arguments

x

A numeric matrix or data frame with independent columns (desired marginals).

target_r

A square, positive-definite correlation matrix to impose.

Value

A numeric matrix with the same marginal distributions as x and approximately matching the target Spearman correlation.

Examples

set.seed(123)
x <- matrix(rnorm(300), ncol = 3)
R_target <- matrix(c(1, 0.5, 0.3,
                     0.5, 1, 0.4,
                     0.3, 0.4, 1), 3)
out <- ic_exact(x, R_target)
cor(out, method = "spearman")

[Package flexIC version 0.1.4 Index]