Learn R Programming

PhylogeneticEM (version 1.0.0)

sum.partitions.cardFixed: 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

"sum"(A, N, K, p, cardI)

Arguments

A
a martix with p rows and K column. Each row contains the number of marqued partition in 1
N
a martix with p rows and K column. Each row contains the number of partition in 1
K
an integer. Tne number of groups wanted.
p
an integer. The number of daughters of a node.
cardI
an integer. The cardinal of the subset wanted.

Value

double : the result of the sum.

Details

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