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

 
 

bug #56118: [octave forge] (statistics) logistic_regression gives incorrect result

Submitted by:  Muhali <muhali>
Submitted on:  Thu 11 Apr 2019 03:08:21 PM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  5.1.0 Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Thu 11 Apr 2019 03:08:21 PM UTC, original submission:

Applying a logistic regression in the following way

pkg load optim
x = (1:20)' ; y = [zeros(10, 1) ; ones(10,1)] ;
Pfun = @(p) exp(p(1) - p(2) * x) ./ (1 + exp(p(1) - p(2) * x)) ; Pin = [0 0]' ;

p1 = nonlin_curvefit (Pfun, Pin, x, y) ;
[p2(1) p2(2)] = logistic_regression(y, x) ;

subplot(2,1,1) ;
plot(x, y, "x", x, Pfun(p1), "-") ;
set(gca, "box", "off")
subplot(2,1,2) ;
plot(x, y, "x", x, Pfun(p2), "-") ;
set(gca, "box", "off")

one sees that the result cannot be correct. The reason is a mismatch between the function description in the help text and what is actually programmed.

Using Pfun(-p2) gives the correct result.

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 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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-11 mtmiller Summary[octave forge] (optim) logistic_regression gives incorrect result => [octave forge] (statistics) logistic_regression gives incorrect result
    2019-04-11 mtmiller Summary(optim) logistic_regression gives incorrect result => [octave forge] (optim) logistic_regression gives incorrect result

    Back to the top


    Powered by Savane 3.4