Class representing the sum of the same expression applied to a list of data. More...
Public Member Functions | |
def | __init__ |
def | getExpression |
Public Attributes | |
function | |
iteratorName | |
operatorIndex |
Class representing the sum of the same expression applied to a list of data.
The concept of iterators identifies a sequence such that, for each instance, the value of the variables is read from the data file, and an expression can be evaluated. The two expressions described in this section consider one iterator and one expression, and evaluate the expression for each instance defined by the iterator. A sum can then be computed. Example:
prob = bioLogit(V,av,CHOICE) rowIterator('obsIter') loglikelihood = Sum(log(prob),'obsIter')
When the iterator is of type drawIterator, the operator Sum actually computes the average and not the sum, as the result is automatically divided by the number R of draws (see loglikelihood::mixedloglikelihood). Example:
drawIterator('drawIter') prob = Sum(condProb,'drawIter')
def bio_expression::Sum::__init__ | ( | self, | |
term, | |||
iteratorName | |||
) |
term | any valid bio_expression |
iteratorName | name of an iterator already defined |
def bio_expression::Sum::getExpression | ( | self ) |
Reimplemented from bio_expression::Expression.
Reimplemented from bio_expression::Expression.