[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #60348] [octave forge] (statistics) logistic_r
From: |
Nicholas Jankowski |
Subject: |
[Octave-bug-tracker] [bug #60348] [octave forge] (statistics) logistic_regression |
Date: |
Mon, 8 Aug 2022 16:31:05 -0400 (EDT) |
Follow-up Comment #3, bug #60348 (project octave):
the opening parameter checks are concerning too.
the function definition is:
[theta, beta, dev, dl, d2l, p] = logistic_regression (y, x, print, theta,
beta)
then we get to:
if (nargin < 4)
beta = zeros (nx, 1);
endif;
if (nargin < 5)
g = cumsum (sum (z))' ./ my;
theta = log (g ./ (1 - g));
endif;
tb = [theta; beta];
theta is the 4th argument, beta the 5th. if I follow this right, if i supply
3 arguments, it will set beta and theta. if I supply 4 arguments (meaning
i've supplied theta), it'll... define theta for me, but not define beta.
verifying this, if you supply theta but not beta, beta is never defined and
you get an error at line 119.
[THETA, BETA, DEV, DL, D2L, P] = logistic_regression (Y, X,0,THETA) ;
error: Invalid call to beta. Correct usage is:
-- beta (A, B)
error: called from
print_usage at line 105 column 5
beta at line 54 column 5
logistic_regression at line 119 column 6
>> edit logistic_regression
I'll try to come back to this, but IMHO it seems like this function is in need
of a complete overhaul by someone more familiar with the statistical process
being used.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60348>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/