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

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

[Octave-bug-tracker] [bug #41008] empirical_pdf incorrect implementation


From: Rik
Subject: [Octave-bug-tracker] [bug #41008] empirical_pdf incorrect implementation
Date: Fri, 27 Dec 2013 17:30:20 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0

Follow-up Comment #2, bug #41008 (project octave):

If you check discrete_pdf you'll find that it normalizes the probability so
there is no need to divide by the length of the data in empirical_pdf.m.  The
all ones vector is just a convenient way to assume that each value in the
empirical distribution is equally likely.

There is an issue if there are duplicates in the data that determines the
empirical pdf.  There are several different strategies to tackle this.  The
simplest is just to check for any duplicates at the start of the function and
abort with a warning message if any are found.  Something like this would
work


if (numel (data) != numel (unique (data)))
  error ("empirical_pdf: DATA has duplicate observed values");
endif


Alternatively, we could use the current code when all elements are unique and
try to code up a solution for duplicate elements.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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