Page 1 of 1
HYPGEOMDIST function in Calc
Posted: Thu Oct 31, 2013 8:32 am
by Vedha
How can use the Openoffice function "HYPGEOMDIST" into my asp.net web application referencing its .dll file or namespace.
Currently i am using the MS Office "Microsoft.Office.Interop.Excel.dll" for the same.
Please help me.
Thanks in Advance,
Vedha
Re: HYPGEOMDIST function in Calc
Posted: Thu Oct 31, 2013 5:25 pm
by MrProgrammer
Hi, and welcome to the forum.
AOO Help wrote:HYPGEOMDIST: Returns the hypergeometric distribution.
Syntax: HYPGEOMDIST(X; NSample; Successes; NPopulation)
X: the number of results achieved in the random sample.
NSample: the size of the random sample.
Successes: the number of possible results in the total population.
NPopulation: the size of the total population.
It will be far simpler to calculate the value directly than to call the Calc function from an external application. The calculation is easily done in a dozen lines in any decent programming language. I doubt if you can call the Calc function without installing large parts of the Open Office application. AOO is an integrated system; you can't install selected bits and pieces of it. Even if you install the whole suite, it will be more challenging to determine how to utilize the Calc function than it will be to do the calculation yourself.
Read about the Probability Mass Function (pmf) of the
Hypergeometric distribution. In this reference N (population size) is the same as NPopulation above, K (number of success states in the population) is Successes above, n (number of draws) is NSample above, and k (number of successes) is X above. Read about
binomial coefficients if you're not familiar with how to calculate them.
If this answered your question please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Get the source code of HYPGEOMDIST() and use in C#
Posted: Wed Nov 06, 2013 5:15 am
by Vedha
Hi,
i have installed the AOO 4.0 in my system.
How to get an use the source code one of the statistical function HYPGEOMDIST() from AOO and use it in asp.net code?
please provide the suggestion/idea ASAP
Thanks in advance
vedha
Re: Get the source code of HYPGEOMDIST() and use in C# (URGE
Posted: Wed Nov 06, 2013 11:51 am
by Hagar Delest
For such a question about source code, you should ask the dev mailing list.
Re: Get the source code of HYPGEOMDIST() and use in C#
Posted: Wed Nov 06, 2013 3:30 pm
by regina
You can lookup the code in
http://svn.apache.org/viewvc/openoffice/ or search with
http://opengrok.adfinis-sygroup.org/
And the Wiki pages
https://wiki.openoffice.org/wiki/Calc/I ... _Functions tell you, what files are all affected by Calc functions.
The function HYPERGEOMDIST() is in main/sc/source/core/tool/interpr3.cxx, the method ScInterpreter::ScHypGeomDist()