ems.
John Nash
> From: Dimitris Rizopoulos
> To: justin bem
> Cc: R Maillist
> Subject: Re: [R] Fitting GLM with BFGS algorithm
> Message-ID: <4cc6c0db.9070...@erasmusmc.nl>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> for instance, for
for instance, for logistic regression you can do something like this:
# simulate some data
x <- cbind(1, runif(100, -3, 3), rbinom(100, 1, 0.5))
y <- rbinom(100, 1, plogis(c( x%*% c(-2, 1, 0.3
# BFGS from optim()
fn <- function (betas, y, x) {
-sum(dbinom(y, 1, plogis(c(x %*% betas)), log
Dear all,
By default the glm function in the stats package use IWLS. How can I fit a glm
model using BFGS algorithm ?
Justin BEM
BP 1917 Yaoundé
Tél (237) 76043774
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing
3 matches
Mail list logo