sum_prod.comb: Sum on a simplex

View source: R/partitionsNumber.R

sum_prod.combR 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

sum_prod.comb(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.


pbastide/PhylogeneticEM documentation built on Feb. 12, 2024, 1:27 a.m.