[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [office-formula] domain for x in HYPGEOMDIST(x;n;M;N)
Hello members, in OpenFormula-v1.2-draft11.odt chapter 6.17.36 HYPERGEOMDIST you define the constraints for x, "x<=M, x<=n, n<=N, M<=N with x,n,M,N >=0." And you define HYPGEOMDIST(x;n;M;N) itself as binom(M x)*binom(N-M n-x)/binom(N n). I'll describe an example to show the problems. Example: You have got an urn with M=6 white marbles and 4 black marbles, which is N=10 marbles total. You draw marbles n=7 times without replacement. Define the random variable X as "number of white marbles in the draw". What is the domain of X? I can imagine two answers. (A) The way Excel and OpenOffice.org use it: Constrain x to those numbers, which can be calculated with the given formula, using binom(a b) in a way, that it requires a>=b>=0. Doing this, you get the domain max(0;n-N+M)..M (B) The way Gnumeric uses it: Use the domain 0..n. For x<n-N+M and for x>M the probability is 0. That is the same result as using a tree diagram. You have branches with probabilty 0, for example for x=7 because the urn contains only 6 white marbles or for x=1 because you will get at least 3 white marbles. But in the spec those alternatives are mixed. For example the call HYPERGEODIST(1;7;6;10) is valid in respect to the constraints, but will cause an error in the factor binom(4 6) in the formula binom(6 1)*binom(4 6)/binom(10 7). Because the method(B) eases the use of the function HYPGEOMDIST and fits to the widespread explanation via tree diagram, constraints and formula should be changed to method(B). You need constraints "x<=n, n<=N, M<=N with x,n,M,N >=0" and a case distinction in the formula "For case max(0;n-N+M)<=x<=M result is binom(M x)*binom(N-M n-x)/binom(N n), for all other cases result is 0." kind regards Regina Henschel
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]