Date: prev next · Thread: first prev next last
2020 Archives by date, by thread · List index


Hi  Eike,

Thank you for taking time to give me answer.  Much appreciated.
Regards
Nick

-----Original Message-----
From: LibreOffice [mailto:libreoffice-bounces@lists.freedesktop.org] On Behalf Of Eike Rathke
Sent: Wednesday, June 03, 2020 3:15 PM
To: Nicholas Ferguson
Cc: LibreOffice@lists.freedesktop.org
Subject: Re: trying to prove out negbinomdist

Hi Nicholas,

On Wednesday, 2020-06-03 08:49:01 -0400, Nicholas Ferguson wrote:

This might be an unusual question for this site.  But I cannot prove out the negative binomial 
distribution, by so called hard coding the function per LibreOffice docs….a jpg of that function 
is attached.  Does anyone have a clue. Though I will add…Microsoft Excel has the same problem.   
I did search for its corresponding code in C++/H in libreoffice source…but that didn't help 
either…
 
=negbinomdist(1;14.4;.92)

=(FACT(1+14.4-1)/(FACT(1)*FACT(14.4-1)))*(power(.92;14.4)*power(1-.92;
1))

You are overlooking that X and R are defined to be integer values, so
=negbinomdist(1;14.4;.92)
effectively is calculated as
=negbinomdist(1;14;.92)
and if you substitute 14.4 with 14 in your manual approach to form
=(FACT(1+14-1)/(FACT(1)*FACT(14-1)))*(POWER(0.92;14)*POWER(1-0.92;1))
you'll discover that both results are almost equal, apart from some precision error of 
5.55111512312578E-17

See also the ODF Formula (ODFF) definition at 
https://docs.oasis-open.org/office/OpenDocument/v1.3/cs01/part4-formula/OpenDocument-v1.3-cs01-part4-formula.html#NEGBINOMDIST

  Eike

--
GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.