S******y 发帖数: 1123 | 1 Hi. guys,
I am trying to write my own Stochastic Gradient Ascent for logistic
regression in R. But it seems that I am having convergence problem.
Am I doing anything wrong, or just the data is off?
Here is my code in R -
lbw <-
read.table("http://www.biostat.jhsph.edu/~ririzarr/Teaching/754/lbw.dat"
, header=TRUE)
attach(lbw)
lbw[1:2,]
low age lwt race smoke ptl ht ui ftv bwt
1 0 19 182 2 0 0 0 1 0 2523
2 0 33 155 3 0 0 0 0 3 2551
#-----R implementation of l |
|