Skip to contents

Every component keeps exactly its own draws; only their pairing across simulations changes. The correlation of the result's normal scores is close to correlation, and Spearman's rho close to (6 / pi) * asin(correlation / 2).

Usage

iman_conover(x, correlation, seed)

Arguments

x

A predictive_distribution.

correlation

A correlation matrix with one row and column per component.

seed

Seed for shuffling the scores, a whole number.

Value

A predictive_distribution with the same keys and marginals.

Examples

pd <- predictive_distribution(
  cbind(1:1000, (1:1000 * 7919) %% 1000),
  data.frame(lob = c("a", "b"))
)
joined <- iman_conover(pd, matrix(c(1, 0.7, 0.7, 1), 2), seed = 3)
cor(draw_matrix(joined), method = "spearman")
#>           [,1]      [,2]
#> [1,] 1.0000000 0.6815972
#> [2,] 0.6815972 1.0000000