R: Sum on a simplex

sum.prod.comb {PhylogeneticEM} | R Documentation

## Sum on a simplex

### Description

`sum.prod.comb` returns the sum on k_1+...+k_p=K+|I|-1, k_i>0 of the products of prod(A[i,k_i], i in I)*prod(N[i,k_i], i not in I).

### Usage

    ## S3 method for class 'prod.comb'
    sum(I, A, N, K, p)

### Arguments

`I` | a vector of integers representing a subset of [1,p]
`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.

### Details

This function uses `sum.simplex` to perform the wanted sum on a ad-hoc matrix, combination of rows of A and N.

### Value

double : the result of the sum.

[Package PhylogeneticEM version 1.1.0 Index]