First CMA step: decomposes the the pure "individual" features in the marginals from the pure "joint" information available in the copulas.

cma_separation(x, p = NULL)

# S3 method for default
cma_separation(x, p = NULL)

# S3 method for matrix
cma_separation(x, p = NULL)

# S3 method for xts
cma_separation(x, p = NULL)

# S3 method for data.frame
cma_separation(x, p = NULL)

# S3 method for tbl
cma_separation(x, p = NULL)

Arguments

x

A rectangular (non-tidy) data structure.

p

A probability vector. If NULL (the default) the standard 1 over N is used.

Value

An S3 list of the cma class that contains two elements: marginal and copula.

Details

Arguments x and p must have the same size.

See also

Examples

set.seed(123)
margins <- matrix(stats::rnorm(30), ncol = 3)
cma <- cma_separation(x = margins)
cma
#> # CMA Decomposition
#> marginal: << tbl 10 x 3 >>
#> cdf     : << tbl 10 x 3 >>
#> copula  : << tbl 10 x 3 >>

# Access the elements with `$`
cma$copula
#> # A tibble: 10 × 3
#>      ...1   ...2   ...3
#>     <dbl>  <dbl>  <dbl>
#>  1 0.273  0.818  0.273 
#>  2 0.455  0.455  0.636 
#>  3 0.818  0.545  0.364 
#>  4 0.545  0.364  0.455 
#>  5 0.636  0.182  0.545 
#>  6 0.909  0.909  0.0909
#>  7 0.727  0.636  0.818 
#>  8 0.0909 0.0909 0.727 
#>  9 0.182  0.727  0.182 
#> 10 0.364  0.273  0.909 
cma$marginal
#> # A tibble: 10 × 3
#>       ...1   ...2   ...3
#>      <dbl>  <dbl>  <dbl>
#>  1 -0.560   1.22  -1.07 
#>  2 -0.230   0.360 -0.218
#>  3  1.56    0.401 -1.03 
#>  4  0.0705  0.111 -0.729
#>  5  0.129  -0.556 -0.625
#>  6  1.72    1.79  -1.69 
#>  7  0.461   0.498  0.838
#>  8 -1.27   -1.97   0.153
#>  9 -0.687   0.701 -1.14 
#> 10 -0.446  -0.473  1.25 
cma$cdf
#> # A tibble: 10 × 3
#>      ...1   ...2   ...3
#>     <dbl>  <dbl>  <dbl>
#>  1 0.0909 0.0909 0.0909
#>  2 0.182  0.182  0.182 
#>  3 0.273  0.273  0.273 
#>  4 0.364  0.364  0.364 
#>  5 0.455  0.455  0.455 
#>  6 0.545  0.545  0.545 
#>  7 0.636  0.636  0.636 
#>  8 0.727  0.727  0.727 
#>  9 0.818  0.818  0.818 
#> 10 0.909  0.909  0.909