bugGNU Octave - Bugs: bug #39280, Wrong results of empirical_pdf

 
 

bug #39280: Wrong results of empirical_pdf

Submitted by:  None
Submitted on:  Wed 19 Jun 2013 06:35:21 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Lutz KelchOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.4
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Mon 09 Nov 2015 10:56:32 PM UTC, comment #6:

This bug is a duplicate of #41008 which has been fixed. Closing report.

Rik <rik5>
Project Administrator
Thu 20 Jun 2013 01:08:55 PM UTC, comment #5:

You are right if you assume that the documentation
about the the arguments is correct.

But, it appears that both the documentation and the function
are incorrect. Both empirical_pdf and discrete_PDF
need checking. Their current tests are incomplete.

Michael Godfrey <godfrey>
Project Member
Thu 20 Jun 2013 12:47:53 PM UTC, comment #4:

but in sum(empirical_pdf([1 2 3], [1 2 2 3])) all values are specified, but the result is just 0.75

Lutz Kelch <luke15153>
Thu 20 Jun 2013 12:44:02 PM UTC, comment #3:

The documentation for empirical_pdf says that
it computes the PDF value at the specified points.
This would only sum to 1 if all possible values were
specified.

Michael Godfrey <godfrey>
Project Member
Thu 20 Jun 2013 06:24:00 AM UTC, comment #2:

in my opinion the result is wrong.

Usually the sum resp. integral over all pdf values should be (about) one. For the normal distribution it works, sum(normpdf([-5:5],0,1)) is 1.
But sum(empirical_pdf([1 2 3], [1 2 2 3])) gives 0.75, what is wrong in my opinion.

Lutz Kelch <luke15153>
Wed 19 Jun 2013 05:22:54 PM UTC, comment #1:

empirical_pdf is given as:

function pdf = empirical_pdf (x, data)

if (nargin != 2)
print_usage ();
endif

if (! isvector (data))
error ("empirical_pdf: DATA must be a vector");
endif

pdf = discrete_pdf (x, data, ones (size (data)));

endfunction

It is appears that the documentation is incorrect.

Michael Godfrey <godfrey>
Project Member
Wed 19 Jun 2013 06:35:21 AM UTC, original submission:

empirical_pdf should give the probability distribution of empirical data.

A call to empirical_pdf([1 2 3], [1 2 2 3]) gives (0.25 0.25 0.25), but in my opinion it should by (0.25, 0.5 0.25).

The value for '2' should be 0.5 as half of the given data are '2'.

Regards,

Lutz

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by luke15153 (Posted a comment)
  • -unavailable- added by godfrey (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 09 Nov 2015 10:56:32 PM UTCrik5CategoryOctave Forge Package=>Octave Function
      StatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1