octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39636] nbinpdf has floating point error


From: Marco Caliari
Subject: [Octave-bug-tracker] [bug #39636] nbinpdf has floating point error
Date: Thu, 01 Aug 2013 14:02:58 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0

Follow-up Comment #8, bug #39636 (project octave):

Hi,

why not to change the relevant part in nbinpdf.m to


if (isscalar (n) && isscalar (p))
  pdf(k) = bincoeff (x(k) + n - 1, x(k)) .* (p ^ n) .* ((1 - p) .^ x(k));
else
  pdf(k) = bincoeff (x(k) + n(k) - 1, x(k)) .* (p(k) .^ n(k)) .* ((1 - p(k))
.^ x(k));
endif


according to the definition given in comment #2?
About bincoeff.m, I do not understand the formula given on line 92. Where does
it come from?

Marco


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39636>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]