Library: | xplore |
See also: | prod sumex |
Quantlet: | prodex | |
Description: | an extended form of the prod function - NaN and all values contained in excl are excluded from computation |
Usage: | prodx = prodex(x{, excl {, s}}) | |
Input: | ||
x | d1 x d2 x .. x dn array, n <= 7 | |
excl | a matrix containing values to be excluded | |
s | integer (number of dimension, default = 1) | |
Output: | ||
prodx | d1 x d2 x .. x d(j-1) x 1 x d(j+1) x .. x dn array |
library("xplore") randomize(666) x = rint(10 * uniform(2, 4)) x[2,1] = NaN x excl = 9 prodex(x,excl)
Contents of x [1,] 3 1 7 4 [2,] +NAN 9 9 2 Contents of prodx [1,] 3 1 7 8