View source: R/cma_combination.R
| cma_combination | R Documentation |
Second CMA step: "glue" copulas and marginals into the same data structure.
cma_combination(x, cdf, copula)
x |
A rectangular (non-tidy) data structure with the margins. |
cdf |
A rectangular (non-tidy) data structure with the CDF's. |
copula |
A rectangular (non-tidy) data structure with the copulas. |
A tabular (non-tidy) tibble with the joint scenarios.
cma_separation
set.seed(123)
margins <- matrix(stats::rnorm(20), ncol = 2)
colnames(margins) <- c("a", "b")
probs <- rep(1 / 10, 10)
# separate
sep <- cma_separation(x = margins, p = probs)
# combinate
comb <- cma_combination(margins, sep$cdf, sep$copula)
# The result is identical
margins # matrix
comb # tibble
all.equal(margins[ , "a"], comb$a)
all.equal(margins[ , "b"], comb$b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.