bugGNU Octave - Bugs: bug #54009, [octave forge] (statistics)...

 
 

bug #54009: [octave forge] (statistics) incorrect result for gppdf

Submitted by:  Muhali <muhali>
Submitted on:  Wed 30 May 2018 11:20:57 AM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  John Donoghue <lostbard>
Originator Name:  Open/Closed:  Closed
Release:  4.4.0 Operating System:  Any

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)

Mon 30 Jul 2018 02:18:03 AM UTC, comment #8:

Closing as fixed - changes will appear in next release of statistics

John Donoghue <lostbard>
Project MemberIn charge of this item.
Wed 18 Jul 2018 03:45:36 PM UTC, comment #7:

pushed for gp functions

https://sourceforge.net/p/octave/statistics/ci/957bf4ac93e54282a367c1c9ff1667e50b3c46d8/

John Donoghue <lostbard>
Project MemberIn charge of this item.
Tue 17 Jul 2018 05:11:06 PM UTC, comment #6:

All the other gpXXXX functions are also wrong.

In addition, at a quick look, bbsXXXX, cauchy_XXXXX functions (although not available as is in matlab) are the same format and would make sense to also be swapped.

John Donoghue <lostbard>
Project MemberIn charge of this item.
Tue 17 Jul 2018 07:27:02 AM UTC, comment #5:

works for me now, thanks. But recall that (LOCATION, SCALE, SHAPE) is still in wrong order (compared to gev, or Matlab).

Muhali <muhali>
Thu 12 Jul 2018 07:15:53 PM UTC, comment #4:

Pushed https://sourceforge.net/p/octave/statistics/ci/e28ffe56e12ff45a7dd53fdbc9d96f5b5d75a8bc

John Donoghue <lostbard>
Project MemberIn charge of this item.
Thu 12 Jul 2018 07:10:50 PM UTC, comment #3:

The last 2 changed lines in your diff should be ./ scale(j)

John Donoghue <lostbard>
Project MemberIn charge of this item.
Thu 12 Jul 2018 06:58:46 PM UTC, comment #2:

Applying that change in the code causes 14 of the tests to fail.

Not sure if that's because the tests are not valid or something else.

For example:

x = [-Inf, -1, 0, 1/2, 1, Inf]

gppdf(x, zeros(1,6), ones(1,6), ones(1,6))

John Donoghue <lostbard>
Project MemberIn charge of this item.
Wed 27 Jun 2018 08:37:59 AM UTC, comment #1:

here is more evidence, if needed:

octave> Q = integral(@normpdf, -Inf, Inf)
Q = 1.000
octave> Q = integral(@(x) gampdf(x, 1, 1), -Inf, Inf)
Q = 1.00
octave> Q = integral(@(x) gevpdf(x, 1, 2, 0), -Inf, Inf)
Q = 1.000
octave> Q = integral(@(x) gppdf(x, 0, 2, 1), -Inf, Inf)
Q = 2.00
octave> Q = integral(@(x) gppdf(x, 0, 3, 1), -Inf, Inf)
Q = 3.00
octave> Q = integral(@(x) gppdf(x, 0, 3, 2), -Inf, Inf)
Q = 3.00

Please note also that the order of arguments (LOCATION, SCALE, SHAPE) is reversed relative to Matlab.

I attach a patch that fixes the scale issue.

Muhali <muhali>
Wed 30 May 2018 11:20:57 AM UTC, original submission:

The Generalized Pareto function gppdf produces incorrect results. It misses a factor 1/sigma, which is evident if one compares the relevant line of code

pdf(j) = (shape(j) .* z(j) + 1).^(-(shape(j) + 1) ./ shape(j));

with (e.g.) the corresponding Wikipedia entry.

Muhali <muhali>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by muhali (Submitted the item)
  •  

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

    Only project members can vote.

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-30 lostbard StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2018-07-12 lostbard StatusNone => Ready For Test
        Assigned toNone => lostbard
    2018-06-04 mtmiller Carbon-CopyRemoved 80942 => -
    2018-06-04 mtmiller Summary(statistics) incorrect result for gppdf => [octave forge] (statistics) incorrect result for gppdf

    Back to the top


    Powered by Savane 3.3