Learn R Programming

PhylogeneticEM (version 1.0.0)

prod.index: Product of elements of a matrix

Description

prod.index return the procuct of choosen elements of a matrix.

Usage

"prod"(X, Id)

Arguments

X
a martix with p rows and K column. Each row contains the number of partition in 1
Id
a vector of length p, result of the function xsimplex.

Value

double : the result of the product.

Details

This function is to be used in sum.simplex to be applied to all the elements given by xsimplex. Performs the product : X[1,Id[1]]*X[2,Id[2]]*...*X[p,Id[p]] if all the elements of Id are positive. Otherwise, just return 0.