R: Sum on subsets of a given cardinal.

sum.partitions.cardFixed {PhylogeneticEM} | R Documentation

## Sum on subsets of a given cardinal.

### Description

`sum.partitions.cardFixed` returns the sum on I subset of [1,p], |I| fixed, of the sums computed by `sum.prod.comb`.

### Usage

    ## S3 method for class 'partitions.cardFixed'
    sum(A, N, K, p, cardI)

### Arguments

`A` | a matrix with p rows and K column. Each row contains the number of marked partition in 1<=k<=K groups for one of the p children of a given node.
`N` | a matrix with p rows and K column. Each row contains the number of partition in 1<=k<=K groups for one of the p children of a given node
`K` | an integer. The number of groups wanted.
`p` | an integer. The number of daughters of a node.
`cardI` | an integer. The cardinal of the subset wanted.

### Details

This function uses `combn` to enumerate all the subsets I of [1,p] of a given cardinal, and then performs the wanted sum on these subsets.

### Value

double : the result of the sum.

[Package PhylogeneticEM version 1.1.0 Index]