Navigation

Operators and Keywords

Function List:

C++ API

logistic_regression.m File Reference


Functions

 if (nargin< 2) x
 if (mx!=my) error("x and y must have the same number of observations")
 while (abs(dl'*(d2l\dl)/length(dl)) > tol) iter
else while ((dev-devold)/(dl'*(tb-tbold)) > 0) epsilon
 if (epsilon > 1e+15) error("epsilon too large")
 disp ("epsilon")
 disp (epsilon)
 if (print==2) disp("Iteration")
 disp (iter)
 disp ("Deviance")
 disp (dev)
 disp ("First derivative")
 disp (dl')
 disp ("Eigenvalues of second derivative")
 disp (eig(d2l)')
 if (print >=1) printf("\n")
 printf ("Logistic Regression Results:\n")
 printf ("\n")
 printf ("Number of Iterations: %d\n", iter)
 printf ("Deviance: %f\n", dev)
 printf ("Parameter Estimates:\n")
 printf (" Theta S.E.\n")
endfor if (nx > 0) printf(" Beta S.E.\n")
endfor endif endif if (nargout==6) if(nx > 0) e

Variables

 function [theta, beta, dev, dl, d2l, p]
 endif = logistic_regression_derivatives (x, z, z1, g, g1, p)
endif x = -x
 tol = 1e-6
 incr = 10
 decr = 2
 ymin = min (y)
 ymax = max (y)
 yrange = ymax - ymin
 z = (y * ones (1, yrange)) == ((y * 0 + 1) * (ymin : (ymax - 1)))
 z1 = (y * ones (1, yrange)) == ((y * 0 + 1) * ((ymin + 1) : ymax))
 theta = log (g ./ (1 - g))
 tb = [theta
 beta = tb ((nz + 1) : (nz + nx), 1)
 epsilon = logistic_regression_likelihood (y, x, tb, z, z1) logistic_regression_derivatives (x, z, z1, g, g1, p) std (vec (d2l)) / 1000
 iter = 0
 tbold = tb
 devold = dev
 se = sqrt (diag (inv (-d2l)))
for i
else e = (y * 0 + 1) * theta'

Function Documentation

disp ( eig(d2l)'   ) 

disp ( "Eigenvalues of second derivative"   ) 

disp ( dl  ) 

disp ( "First derivative"   ) 

disp ( dev   ) 

disp ( "Deviance"   ) 

disp ( iter   ) 

disp ( epsilon   ) 

disp ( "epsilon"   ) 

endfor endif endif if ( nargout  = =6  ) 

endfor if ( nx  ,
 
)

if ( print >=  1  ) 

if ( print  = =2  ) 

if ( epsilon  ,
1e+  15 
)

if ( mx!  = my  ) 

if (  ) 

printf ( " Theta S.E.\n"   ) 

printf ( "Parameter Estimates:\n"   ) 

printf ( "Deviance: %f\n"  ,
dev   
)

printf ( "Number of Iterations: %d\n"  ,
iter   
)

printf ( "\n"   ) 

printf ( "Logistic Regression Results:\n"   ) 

else while ( (dev-devold)/(dl'*(tb-tbold))  ,
 
)

while ( abs(dl'*(d2l\dl)/length(dl))  ,
tol   
)


Variable Documentation

beta = tb ((nz + 1) : (nz + nx), 1)

decr = 2

else e = (y * 0 + 1) * theta'

endwhile endif[dl, d2l] = logistic_regression_derivatives (x, z, z1, g, g1, p)

epsilon = logistic_regression_likelihood (y, x, tb, z, z1) logistic_regression_derivatives (x, z, z1, g, g1, p) std (vec (d2l)) / 1000

Initial value:

 logistic_regression (y, x, print, theta, beta)


  y = round (vec (y))

for i

Initial value:

 1 : nz
      printf ("   %8.4f     %8.4f\n", tb (i), se (i))

incr = 10

iter = 0

se = sqrt (diag (inv (-d2l)))

tbold = tb

endif endwhile theta = log (g ./ (1 - g))

tol = 1e-6

endif x = -x

ymax = max (y)

ymin = min (y)

z = (y * ones (1, yrange)) == ((y * 0 + 1) * (ymin : (ymax - 1)))

z1 = (y * ones (1, yrange)) == ((y * 0 + 1) * ((ymin + 1) : ymax))