Public Member Functions | Public Attributes

bio_expression::Prod Class Reference

Class representing the product of the same expression applied to a list of data. More...

Inheritance diagram for bio_expression::Prod:
bio_expression::Expression

List of all members.

Public Member Functions

def __init__
def getExpression

Public Attributes

 function
 iteratorName
 positive
 operatorIndex

Detailed Description

Class representing the product 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 product can then be computed. The following example computes the loglikelihood for a model with panel data.

 metaIterator('personIter','__dataFile__','panelObsIter','Id')
 rowIterator('panelObsIter','personIter')
 drawIterator('drawIter')

 condProbIndiv = Prod(prob,'panelObsIter')
 probIndiv = Sum(condProbIndiv,'drawIter')
 loglikelihood = Sum(log(probIndiv),'personIter')

The iterator personIter iterates on each individual in the file, characterized by the identifier Id. The iterator panelObsIter iterates on the observations (that is, the rows in the data file) associated with the current individual. The iterator drawIter iterates on the draws generated for the Monte-Carlo simulation.

Assuming that prob is the likelihood of the observation in one raw, for a given set of draws, the following quantities are computed:

\[ \mbox{condProbIndiv} = P(y_1,\ldots,y_T|\xi_n) = \prod_t P(y_t|\xi_n)\]


Constructor & Destructor Documentation

def bio_expression::Prod::__init__ (   self,
  term,
  iteratorName,
  positive = False 
)
Parameters:
termany valid bio_expression
iteratorNamename of an iterator already defined
positiveSet it to True if all factors of the product are strictly positive. In that case, it will be computed as

\[ \prod_r x_r = \exp(\sum_r \ln x_r)\]


Member Function Documentation

def bio_expression::Prod::getExpression (   self )
Returns:
Return the string representation of the current expression

Reimplemented from bio_expression::Expression.


Member Data Documentation

Reimplemented from bio_expression::Expression.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables